You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you try to insert row into a table with default values, there is no DEFAULT VALUES statement in the query itself. This causes problems, for example, if you want to conditionally clear rows you want to insert and have RETURNING statement.
To Reproduce
If applicable provide a small code snippet to reproduce the issue:
INSERT INTO "table" DEFAULT VALUES RETURNING "id" [] <nil>
Actual:
INSERT INTO `table` RETURNING `id` [] <nil>
The code above with postgres dialect will have expected output.
Dialect:
postgres
mysql
sqlite3
Additional context
Default values fragment for sqlite seems to have empty string for a value. Removing this option setting solves the problem. However, it is noted in the comments for this fragment that only postgres supports it:
The SQL fragment to use when generating insert sql and using DEFAULT VALUES (e. g. postgres="DEFAULT VALUES", mysql="", sqlite3=""). (DEFAULT=[] byte(" DEFAULT VALUES"))
Is there a reason for that? Thank you in advance.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you try to insert row into a table with default values, there is no DEFAULT VALUES statement in the query itself. This causes problems, for example, if you want to conditionally clear rows you want to insert and have RETURNING statement.
To Reproduce
If applicable provide a small code snippet to reproduce the issue:
Expected behavior
Expected:
Actual:
The code above with postgres dialect will have expected output.
Dialect:
Additional context
Default values fragment for sqlite seems to have empty string for a value. Removing this option setting solves the problem. However, it is noted in the comments for this fragment that only postgres supports it:
Is there a reason for that? Thank you in advance.
The text was updated successfully, but these errors were encountered: