-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Feature request] Execute raw SQL queries #145
Comments
I use that: final QUERY = "#whatever query you have in mind";
@:privateAccess (cast db.User.cnx:MySqlConnection<Db>).run({sql:QUERY}); //this returns Promise that you can cast to whatever you expect at function declaration A bit dirty but fits the need. But your approach is more advanced I give you that :) |
Thanks both of you 👍 i just made use of this as well. (I had to handle unsigned BIGINT's and converted them to strings via |
I've added |
We still don't have easy/obvious access to the connection object and the |
Some SQL statements are not yet implemented (cf.
DISTINCT
), and others will probably never be implemented (i.e.SET foreign_key_checks = 0
orALTER TABLE my_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
on MySQL).So we need a way to execute raw SQL queries to be able to escape from TinkSQL, that is probably expose the
ident
,run
andvalue
methods from the underlying driver.Currently, I use this kind of horror (with Node.js and MySQL):
The text was updated successfully, but these errors were encountered: