mardi 7 juillet 2015

Arel in SQLite and other databases

I am new in databases and Ruby on rails applications.

I have a question about generating queries from ORM.

When my database is SQLite, and I am using a code for creating queries for this database, if I change my database am I still able to use the same code?

In addition, when I am using Arel, because it provides more ready methods for more complex queries, before I am generating a query I call the method .to_sql If I want to use the same code but for another database am I still able to execute the query? Using instead of to_sql something else?

Aucun commentaire:

Enregistrer un commentaire