-
-
Notifications
You must be signed in to change notification settings - Fork 233
ColumnDef with default expression
#428
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
Conversation
|
Hey @ikrivosheev, I remember you said you got some ideas for this PR? |
@billy1624 hello! Sorry for delay. I worked on this task and came to the conclusion that we need new trait: pub trait SqlWriter: Write {
fn push_param(&mut self, value: &Value, query_builder: &dyn QueryBuilder);
fn query(self) -> String;
}And two new struct: pub struct SqlStringWriter {
query: String,
}and pub struct SqlWriterObj { // TODO: better name
counter: usize,
placeholder: String,
numbered: bool,
values: Vec<Value>,
query: String,
}And the backend will no longer have to worry about where and how to put the parameter. What do you think? I can create draft PR. |
@tyt2y3 what do you think about it? |
|
Cool! If I understand it correctly. @ikrivosheev
|
Yes, exactly! I started work on that. If you want, I can prepare draft PR. |
|
Feel free to work on that :D |
|
@billy1624 hello! I create draft PR: #436 |
|
I think we don't need this now since #436 is merged? |
Correct! |
PR Info
Adds
ColumnDef::default_expr()setting the default expression of a columnColumnDef::default_value()setting the default value of a columnBreaking Changes
ColumnDef::default()now takesInto<SimpleExpr>instead ofInto<Value>. Users are advised to useColumnDef::default_value().