-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Insert Default #266
Insert Default #266
Conversation
Okay I am just being curious, does MySQL/Pg/SQLite actually allow multiple DEFAULT VALUES? |
src/backend/mysql/query.rs
Outdated
@@ -58,4 +58,8 @@ impl QueryBuilder for MysqlQueryBuilder { | |||
) { | |||
// MySQL doesn't support declaring materialization in SQL for with query. | |||
} | |||
|
|||
fn insert_default_keyword(&self) -> &str { | |||
"VALUES (DEFAULT)" |
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.
it does seem like it's only for inserting one row
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.
It will insert only one row with default values
@billy1624 can you resolve the merge conflict? |
23fdb81
to
1c338e4
Compare
I think we need to investigate this and if it's valid SQL supported by at least 2 DB we should implement accordingly |
Yes, it's possible to insert multiple default rows in single insert statement on MySQL & PostgreSQL but not SQLite Demo
|
Well then may be we should further work on it |
I have added a method, |
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.
@billy1624 thank you! Some comments.
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.
@billy1624 LGTM!
Cool. I think the important piece is how we are implementing the backend |
* Insert default * Insert multiple rows with default values * Refactoring
PR Info
Dependents:
Adds
InsertStatement::or_default_values
methodReferences