Skip to content

Conversation

@Wulf
Copy link
Owner

@Wulf Wulf commented Nov 2, 2023

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

@Wulf Wulf requested a review from hasezoey November 2, 2023 01:01
use models::todo::Todo;

fn main() {
println!("Hello, world!");
Copy link
Owner Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@Wulf Wulf mentioned this pull request Nov 2, 2023
Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont really see why it would require #104, would #112 suffice?

@hasezoey hasezoey changed the title Add simple compilation test Add simple example of library usage and consuming generated output Nov 6, 2023
@hasezoey
Copy link
Collaborator

hasezoey commented Nov 6, 2023

i change the title of this PR to better reflect what this PR is doing

@hasezoey hasezoey mentioned this pull request Nov 19, 2023
@Wulf Wulf requested a review from hasezoey January 2, 2024 01:49
@Wulf
Copy link
Owner Author

Wulf commented Jan 2, 2024

@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.

@Wulf Wulf force-pushed the add-simple-example branch from cebbff7 to cec637f Compare January 2, 2024 01:54
Copy link
Collaborator

@hasezoey hasezoey left a 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"] No newline at end of file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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!");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@hasezoey
Copy link
Collaborator

hasezoey commented Sep 6, 2025

Its been a few years since the opening of this PR.
This is still something that would be great to have (dsync as a library usage example), and it is mostly done (aside from maybe adding a simple main impl?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants