-
Notifications
You must be signed in to change notification settings - Fork 85
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
Ruby page is a bit out of date #66
Comments
Thanks for that. Can you add any more text about either of those? I don't know Ruby at all. |
Okay then, lets leave out RDBI. I know little about it and between ActiveRecord and Sequel we pretty much have it covered (unfortunately...) Feel free to edit/ignore as you please: Using ActiveRecordActiveRecord is the default when using Ruby On Rails. Once you have defined a model for your table -- say, customer -- you can then query it with parameters like this:
or
Using SequelThe simplest approach: for a query that returns results, use
For an update, delete or insert, build the query with
More information here and here. NotesThe secureness of the above depends on how well the underlying database supports parameter substitution, but it's always better to do it than not. If you are using an ORM and not passing it an SQL string, then you are probably already protected by the ORM. |
Thank you for this. |
Happy to help -- no problem. |
Sorry for necro-posting (though the issue is not closed still) and offtopic, but could some Ruby+SQL guru look at https://stackoverflow.com/questions/53500616/ ? |
Ruby/DBI appears to be long gone. Some alternatives:
Sequel
http://sequel.jeremyevans.net/
RDBI
https://github.com/RDBI/rdbi
The text was updated successfully, but these errors were encountered: