3 ms·
You can always have a function "roll" the query string for you, but the point is you pick the function and you handle its output, instead of making a metaquery
by mantrax5 12y ago
You can always have a function "roll" the query string for you, but the point is you pick the function and you handle its output, instead of making a metaquery to some engine, which calls your SQL server itself with something, but unclear what, unless it produces a log for you to inspect.
In the latter case it's also unclear when your queries run in a transaction, which isolation level the transaction is, heck, in many ORM you barely know when the server gets called at all (it's usually not when you expect it's called), nor you have any guarantees about the order in which your updates are fed to the server.
You also have no control to supply direct SQL when you need to as you have no direct access to the connection, or the ORM relies on caching where direct access would cause inconsistent data.
The difference between an ORM, and a simple query generator under your control seems like a subtle detail, but as the wise ones said, the devil's always in the details.
- Jake232 12y agoAuthor of the article here (although not submitter). Pony actually has a way to log so that you can see every SQL query being ran against your DB. You can activate it with sql_debug(True). I monitored it for my first few Pony projects, although now I've just come to trust it will do the right thing. You also can supply direct SQL to the DB via Pony, the documentation covers this: http://doc.ponyorm.com/database.html#using-parameters-in-sql-queries http://doc.ponyorm.com/database.html#using-parameters-in-sql...
- marcosdumay 12y agoThat does not fit any ORM I've looked at (and, sorry, Java people, I don't care to look at your tools anymore). ORMs normaly default to either "in transaction" or "not in transaction", and require explicit code to change that. They guarantee the order of commands that change data, and let you get into the database any time you want. The only characteristic that fits my experience is that you don't know when SELECTs are executed. And, if this is a problem for you, you are doing something very strange.