-
Notifications
You must be signed in to change notification settings - Fork 213
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
Fixes to sqlite dialect: do not add FOR UPDATE in SELECT, fix support for INSERT ON CONFLICT #218
Fixes to sqlite dialect: do not add FOR UPDATE in SELECT, fix support for INSERT ON CONFLICT #218
Conversation
@@ -121,6 +121,7 @@ if err != nil{ | |||
Output: | |||
``` | |||
SELECT * FROM "test" WHERE "id" = 10 [] | |||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover from my previous PR with sqlserver support :)
Codecov Report
@@ Coverage Diff @@
## master #218 +/- ##
=======================================
Coverage 96.51% 96.51%
=======================================
Files 60 60
Lines 4189 4195 +6
=======================================
+ Hits 4043 4049 +6
Misses 131 131
Partials 15 15
Continue to review full report at Codecov.
|
) | ||
|
||
func init() { | ||
RegisterDialect("default", DefaultDialectOptions()) | ||
} | ||
|
||
func RegisterDialect(name string, do *SQLDialectOptions) { | ||
dialectsMu.Lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar to this: https://github.com/golang/go/blob/master/src/database/sql/sql.go#L45
faced problem with concurrent map writes in our test environment
@doug-martin could you please proceed with review? |
SQLite lacks support of SELECT FOR UPDATE: https://sqlite.org/lang_select.html
To enable cross-database queries building with that syntax and avoid additional conditions in application code, need to insert empty fragment for SQLite dialect