34 Commits

Author SHA1 Message Date
kyoto7250
0ce8ee6a31
feat(sea-orm-cli): output log about generated file name. (#735)
* feat(sea-orm-cli): output lof about  generated file name.

https://github.com/SeaQL/sea-orm/issues/722

* include column names in info

* cargo fmt

* Update sea-orm-cli/src/commands.rs

Avoid multiple initializations

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>

* show info per column

* refactor: use write! macro

* Refactoring

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2022-06-12 20:30:49 +08:00
Billy Chan
6091629adb
cargo fmt 2022-03-25 15:25:49 +08:00
Billy Chan
73701fef9a
Codegen Unsigned Integer - 2 (#397)
* feat: codegen unsigned integer

* feat: apply alias on `ColumnRef::SchemaTableColumn`

* Update SQLite test cases, quote identifier with double quotes

* Bump sea-query version to 0.22

* Add dummy line

* Tests [cli] and [issues]

* update sea-schema

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-03-14 12:40:02 +08:00
Chris Tsang
6b33d67f7c
Merge pull request #463 from BenJeau/master
Codegen add serde derives to enums, if specified
2022-03-06 21:56:50 +08:00
Billy Chan
21216f3a97
Codegen column_name proc_macro attribute (#433)
* feat: codegen `column_name` proc_macro attribute

* test: codegen `column_name`
2022-02-05 21:14:10 +08:00
Benoit Jeaurond
2a2b5d7b62 feat: add serde derives to enums, if specified 2022-01-16 16:16:11 -05:00
Billy Chan
4072e74284
cargo fmt 2021-12-17 11:14:54 +08:00
Billy Chan
f5f6a6774f
Codegen ActiveEnum & Create Enum From ActiveEnum (#348) 2021-12-15 00:52:50 +08:00
Billy Chan
ccb8b95324
Codegen Handle Self Referencing & Multiple Relations to the Same Related Entity (#347)
* [sea-orm-codegen] handle self referencing relation & multiple relations to the same related entity

* Test [cli]

* Test [cli]
2021-12-04 21:22:10 +08:00
Billy Chan
8b217239fd
Fix clippy warnings 2021-11-08 12:13:29 +08:00
Billy Chan
b65d441dea
Fix clippy warnings 2021-10-21 16:26:42 +08:00
Tim Eggert
d9306126cf Incorporate requested CR changes 2021-10-12 13:06:56 +02:00
Tim Eggert
b6c5d71fe2 Introduce optional serde support for model code generation
This introduces several things to optionally support automatic derive attributes for `serde::{Deserialize, Serialize}` for the generated models:
- introduces a `WithSerde` enum to indicate if Serialize, Deserialize, or even both should be derived from,
- adds an optional cli argument `--with-serde [none: default, serialize, deserialize, both]`
- adds test harness for both compact and expanded generation
2021-10-11 14:55:00 +02:00
Billy Chan
d6b53abd95
Handle crate, Self and self rust keywords 2021-10-06 22:24:52 +08:00
Billy Chan
7779ac886e
Escape rust keyword on codegen 2021-10-05 10:49:06 +08:00
Billy Chan
360436ceac
Codegen compact-format generate unique attribute 2021-09-24 15:45:22 +08:00
Billy Chan
01011cf0f4
Generate macro attribute "nullable" 2021-09-15 10:46:12 +08:00
Billy Chan
39902deaef
Remove unused import 2021-09-15 10:44:24 +08:00
Billy Chan
39c5a4d134
Derive attributes 2021-09-13 23:54:42 +08:00
Billy Chan
a6f117a908
sea-orm-cli with --expanded-format & --compact-format flags 2021-09-10 23:08:30 +08:00
Billy Chan
9c3aba8c0e
codegen of compact entity files 2021-09-10 22:28:08 +08:00
Billy Chan
10a5a34cd9
Move files 2021-09-10 22:28:08 +08:00
Billy Chan
e852a09498
cargo clippy 2021-09-03 16:51:22 +08:00
Billy Chan
484da8f6b6
WIP 2021-08-28 20:00:59 +08:00
Billy Chan
aea4ec2d54 Codegen mod.rs include prelude 2021-08-17 12:45:21 +08:00
Billy Chan
ba226a2b62
Generate arbitrary named entity (#70)
* Generate arbitrary named entity (#69)

* Bump cli & codegen version

* CI tests no caching

* Remove local dependency path
2021-08-10 16:35:10 +08:00
Billy Chan
0b10d30c64 Codegen not depends on sea-schema & sqlx 2021-07-27 21:48:41 +08:00
Billy Chan
daa0ed947d Handle conjunction table 2021-07-22 19:08:42 +08:00
Billy Chan
a94224e0f2 Unit test sea-orm-codegen 2021-07-12 23:45:27 +08:00
Chris Tsang
6ff5a32b7a cargo fmt 2021-07-11 22:08:37 +08:00
Billy Chan
dd8d8c3431
Codegen without find_* helper fn 2021-06-30 23:01:23 +08:00
Billy Chan
9a25bb9c36
Use belongs_to, has_one and has_many 2021-06-22 23:42:10 +08:00
Chris Tsang
91023d06c5 Codegen: update ColumnDef 2021-06-19 20:53:08 +08:00
Billy Chan
cab4b5a3f7
Codegen: Entity Generator (#23) 2021-06-19 19:47:59 +08:00