-
Notifications
You must be signed in to change notification settings - Fork 602
Create table builder structure #659
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
Pull Request Test Coverage Report for Build 3207601177
💛 - Coveralls |
I think this makes a lot of sense to me 👍 I think it needs some docstrings (ideally with an example) but otherwise 🚀 |
Ok! Will be done in 10 :) |
@alamb done! |
Looks like there is a minor issue with rustfmt/clippy |
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.
LGTM -- thanks @AugustoFKL
src/ast/helpers/stmt_create_table.rs
Outdated
/// This structure is a facilitator to allow building and accessing a create table with more ease, | ||
/// without needing to: |
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.
/// This structure is a facilitator to allow building and accessing a create table with more ease, | |
/// without needing to: | |
/// This structure helps building and accessing a `create table` with more ease, | |
/// without needing to: |
src/ast/helpers/stmt_create_table.rs
Outdated
/// builder.build().to_string(), | ||
/// "CREATE TABLE IF NOT EXISTS table_name (c1 INT)" | ||
/// ) | ||
/// |
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.
/// |
assert_eq!(builder, CreateTableBuilder::try_from(stmt).unwrap()); | ||
} | ||
|
||
#[test] |
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 just needs to get a clean CI and we can merge it. |
Proposal of usage of a
CreateTableBuilder
structure, instead of the pure create table that we've been using right now.This has 2 benefits:
@alamb @nickolay what do you think?
I know this resembles #315 (comment) but, instead of replacing our current API, we can give the upstream the possibility of creating the struct, moving it with more ease around the code. If you think that's OK, I'll add a
TryFrom<Statement>
for this (or maybe just a convert method), and expand that going from the biggest statement to the smallest.