dsync
dsync copied to clipboard
Generate rust structs & query functions from diesel schema files
After thinking about this for some time, I've come to the conclusion that #[tsync] additions shouldn't be the default like it currently is. Users should manually copy and edit the...
Currently code generation is basically done by string concatenation, which is "good enough" but could be improved, current suggestions are: - `tera` (https://github.com/Wulf/dsync/pull/89#issuecomment-1783916991) - `quote` + `prettyplease`
Currently, we have a `GenerationConfig#table(name)` method that retreives the config for a particular table. This should be a simple retrieval, but instead, we make some changes to the table config...
Maybe sometimes custom derives would be needed, IMHO. ```rs #[derive(Debug, Clone)] pub struct TableOptions } ``` How about this? Thanks.
The generated code from dsync (for `create` and `update`) uses `get_result` which implicitly adds a `RETURNING` to the generated SQL statement. MySQL does not support `RETURNING` hence, the trait check...
Hey, one of the creators of [lemmy](https://github.com/LemmyNet/lemmy) here, this looks like a really interesting project that could help us. We have a lot of tables, and generating a lot of...
How should this be supported? - I'm thinking: ```sql CREATE TABLE "profiles" ( alias VARCHAR(50) PRIMARY KEY -- user-modifiable alias ); ``` Or maybe: ```sql COMMENT ON COLUMN profiles.alias IS...
Diesel internally uses the [`diesel_table_macro_syntax`](https://docs.rs/diesel_table_macro_syntax/latest/diesel_table_macro_syntax/) crate to parse the `schema.rs` file. It might be a good idea to just use the same code in `dsync` to make sure that it...
Running: ``` dsync -i 'src/schema.rs' -o 'src/generated_models' -c 'diesel::pg::Pg' --single-model-file ``` Which produces a bunch of files with a bunch of errors. ### 0 For example, this one (which seems...