Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PostgreSQL support #7

Merged
merged 18 commits into from
Mar 22, 2017
Merged

Add PostgreSQL support #7

merged 18 commits into from
Mar 22, 2017

Conversation

khiav223577
Copy link
Owner

@khiav223577 khiav223577 commented Mar 11, 2017

See issue #5

@khiav223577 khiav223577 mentioned this pull request Mar 11, 2017
return relation.joins("JOIN (SELECT id.val, row_number() over() FROM (VALUES(#{ids.join('),(')})) AS id(val)) AS id ON (#{column} = id.val)")
.order('row_number')
when String
ids.map!{|s| s.gsub("'", "''") }
Copy link

@le0pard le0pard Mar 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better ids.map!{|s| ActiveRecord::Base.connection.quote_string(s)} ?

Copy link
Owner Author

@khiav223577 khiav223577 Mar 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I have been searching for this method for awhile

@khiav223577 khiav223577 merged commit 7ddc4d1 into master Mar 22, 2017
@khiav223577 khiav223577 deleted the feature/support_postgreSQL branch June 22, 2017 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants