Add simple example of library usage and consuming generated output#111
Add simple example of library usage and consuming generated output#111
Conversation
| use models::todo::Todo; | ||
|
|
||
| fn main() { | ||
| println!("Hello, world!"); |
There was a problem hiding this comment.
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.
| 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
|
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
hasezoey
left a comment
There was a problem hiding this comment.
Looks mostly good to me now, some small Cargo.toml suggestions and adding some notes.
| @@ -0,0 +1,2 @@ | |||
| [workspace] | |||
| members = ["todo"] No newline at end of file | |||
There was a problem hiding this comment.
| 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.
| 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
|
Its been a few years since the opening of this PR. |
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