-
Notifications
You must be signed in to change notification settings - Fork 15
Migration notes and README updates #102
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
hasezoey
left a comment
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.
some things i noticed.
also converting this pr to WIP because of requirements
|
|
||
| Currently, it's more advantageous to generate code over deriving code with macros because intellisense and autocompletion isn't quite there when it comes to macro expansion. | ||
|
|
||
| **Migrating from v0 to v1? See migration notes below.** |
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.
| **Migrating from v0 to v1? See migration notes below.** | |
| **Migrating from v0 to v1? See [migration notes below](#migrating-from-v0-to-v1).** |
Note that i have not checked the slug, but it should likely be this
| - Supports `diesel-async` (enable `async` feature flag) | ||
| - Generates structs based on your `schema.rs` file (see the `test/simple_table` folder for sample output) | ||
| - Optionally generates CRUD functions and helper methods | ||
| - Use as a binary or library (read more below) |
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.
| - Use as a binary or library (read more below) | |
| - Usable as a binary or library (read more below) |
i think this reads better with better understanding
| Now we have everything we need! | ||
|
|
||
| ```rust | ||
| use models::todos; |
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.
why remove that line? i think this would make sense to get to know where some things come from
| /* | ||
| CRUD examples | ||
| */ | ||
| let created_todo = todos::create(&mut db, todos::CreateTodo { |
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.
| let created_todo = todos::create(&mut db, todos::CreateTodo { | |
| let created_todo = Todo::create(&mut db, todos::CreateTodo { |
unless i missed something, this should likely be the actual case (error from before this PR)
| let updated_todo = todos::update(&mut db, created_todo.id, UpdateTodo { | ||
| })?; | ||
|
|
||
| let todos_list = Todo::paginate(db, 1, 10)?; |
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.
if this PR requires #103, then shouldnt this take one more parameter?
| /* | ||
| CRUD examples | ||
| */ | ||
| let created_todo = todos::create(&mut db, todos::CreateTodo { |
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.
| let created_todo = todos::create(&mut db, todos::CreateTodo { | |
| let created_todo = todos::create(&mut db, CreateTodo { |
also to be consistent with later calls
| Use the "Filter" helper | ||
| --> Works well with intellisense! <-- | ||
| --> Easily create reusable/portable queries! <-- | ||
| (Support for date/time and other types coming soon) |
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.
what support is missing?
| ## Migrating from v0 to v1 | ||
| * For those that use plural table names: English-based pluralization is no longer handled. If you had a table named `todos`, dsync will not generate a struct named `Todo` anymore, but instead, `struct Todos` will be generated. It might be easier to rename your tables entirely to singular case. |
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.
| ## Migrating from v0 to v1 | |
| * For those that use plural table names: English-based pluralization is no longer handled. If you had a table named `todos`, dsync will not generate a struct named `Todo` anymore, but instead, `struct Todos` will be generated. It might be easier to rename your tables entirely to singular case. | |
| ## Migrating from v0 to v1 | |
| * For those that use plural table names: English-based pluralization is no longer handled. If you had a table named `todos`, dsync will not generate a struct named `Todo` anymore, but instead, `struct Todos` will be generated. It might be easier to rename your tables entirely to singular case. |
|
I'm going to close this -- we can always reference it later if needed! |
Requires #104 which requres #103!