-
Notifications
You must be signed in to change notification settings - Fork 53
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
Load engine-dependent queries #5
Comments
The style of hugsql seems good. -- :name insert-user
-- :doc Insert one user
-- :type mysql
insert into user (name, email) values (?, ?) -- :name insert-user
-- :doc Insert one user
-- :type pg
insert into user (name, email) values ($, $) I thnk Adding extra tags to instruct which db it is for is a good way. |
that might work 👍 . How would you handle duplication, to avoid repeating |
emmm, in mybatis from Java, duplication will cause runtime-exception. I think |
my point is, how can u define the same operation |
Also, how should the API look like? |
Every engine has its own queries map. Only one per name is allowed for one engine. dotsql.MySQL().Get("name") Also, we can set the default engine. So dotsql.Default("mysql")
dotsql.Get("name") will work too. If integrated with sqlx, we can supply a rebind method, just like |
I like it |
So let's say we have set of queries that we know are able to run on mysql/postgres/sqlite3. But we also have queries that uses specific engine extensions.
So I'm looking for a confortable way to implement this, I'm not sure if an extra tag (@krisajenkins?) is the right way to do it, or expose a
DotSql.Merge()
method that allows to add more queries to the actual loader.Ideas will be appreciated :)
The text was updated successfully, but these errors were encountered: