-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add simple example of library usage and consuming generated output #111
base: main
Are you sure you want to change the base?
Conversation
use models::todo::Todo; | ||
|
||
fn main() { | ||
println!("Hello, world!"); |
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.
In the future, we'll want to add actual DB calls using the generate code and either use an in-memory sqlite db or spin up a postgres container to make sure those calls are working
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.
println!("Hello, world!"); | |
// This file (should) demonstrate the usage of the generated dsync output | |
println!("Hello, world!"); | |
// TODO: This file in the example still needs to be expanded on |
add a note so we dont forget the purpose
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.
i change the title of this PR to better reflect what this PR is doing |
@hasezoey please give this another look when you have the time. It's been a long time since we visited this, so feel free to suggest another approach entirely. |
cebbff7
to
cec637f
Compare
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.
Looks mostly good to me now, some small Cargo.toml suggestions and adding some notes.
@@ -0,0 +1,2 @@ | |||
[workspace] | |||
members = ["todo"] |
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.
members = ["todo"] | |
members = ["todo"] | |
resolver = "2" |
remove the cargo warning:
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
use models::todo::Todo; | ||
|
||
fn main() { | ||
println!("Hello, world!"); |
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.
println!("Hello, world!"); | |
// This file (should) demonstrate the usage of the generated dsync output | |
println!("Hello, world!"); | |
// TODO: This file in the example still needs to be expanded on |
add a note so we dont forget the purpose
Adds a simple example that we use as a compilation test.
We'll need to expand this going forward to ensure robustness
Note: This will fail until #104 is merged in as that fixes a few compilation issues with
once_common_*
flags