28 Commits

Author SHA1 Message Date
Billy Chan
b3db9dec3a
Fix clippy warnings (#2379)
* Fix clippy warnings

* fmt

* Disable loco example CI for now
2024-10-04 16:12:21 +08:00
Billy Chan
bca933a055
CLI: generate has_one relation for foreign key of unique index / constraint (#2254)
* CLI: generate `has_one` relation for foreign key of unique index / constraint

* Primary key column is unique

* Bump dependency

* Fix
2024-06-19 20:40:07 +08:00
Billy Chan
33f4659db7
clippy 2024-05-03 13:46:38 +08:00
Chris Tsang
d4f8e7226e Revert sea-orm-codegen 2023-12-14 10:44:31 +00:00
94eac96513
create_table_from_entity support comment (#2009)
* support table and column comment

* create_table_from_entity support comment

* fmt code

* fmt code

* add comment test

* fix test
2023-12-14 18:22:36 +08:00
Niklas Korz
73a57836fa
sea-orm-codegen: PostgreSQL enum arrays (#1678)
* sea-orm-codegen: PostgreSQL enum arrays

* Refactoring

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-07-21 21:45:11 +08:00
Panagiotis Karatakis
3300336b1a
Expand SeaORM entity generator with Seaography related data (#1599)
* Add DeriveRelatedEntity macro

* Add generation for related enum and seaography

* Add seaography cli param

* update codegen tests

* Fix DeriveRelatedEntity macro doc and includes

* Fix all RelatedEntity variants for RelationBuilder

* Add tests for code

* Cargo format

* Fix clippy code

* Fix format

* Fix unit tests

* Fix unit tests

* Provide default for seaography::RelationBuilder

* Update changelog

* Update tests

* Modify code to match feedback
* Bring old Related Impl trait generation
* Modify DeriveRelatedEntity to gen impl seaography::RelationBuilder
* Generate RelatedEntity enum when seaography flag is enabled

* Update documentation

* Update Changelog

* Fix format errors

* Fix code generation
* relations with suffix are definition based
* Rev => Reverse easier to read
* snake_case to cameCase for name generation

* Fix unit tests

* Update lib.rs

* derive `seaography::RelationBuilder` only when `seaography` feature is enabled

* Try constructing async-graphql root for "related entity" and "entity" without relation

* Update demo

* CHANGELOG

* Update Cargo.toml

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>

* Revert "Update Cargo.toml"

This reverts commit 6b1669836a4fb5040bfb08999f0cf640c74dc64d.

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-05-19 22:14:46 +08:00
Billy Chan
2c082558df
Generate entity for duplicated many-to-many paths (#1435)
* Generate entity for duplicated many-to-many paths

* CI: run cargo fmt with nightly channel
2023-04-13 11:16:49 +08:00
Billy Chan
8982d88774
Skip implementing Related if the same related entity is being referenced by a conjunct relation (#1298) 2022-12-17 12:52:04 +08:00
Billy Chan
ccca35ab1a
clippy 2022-12-16 16:48:16 +08:00
jiayi
8e888eda7b
generate Related for many-to-many relation with extra columns (#1260) 2022-12-01 13:14:20 +08:00
Billy Chan
a7c8970800
[sea-orm-cli] generate entity with relation variant order by name of reference table (#1229) 2022-11-24 12:15:31 +08:00
Billy Chan
a3fb8e8b0d
[cli] generate Related for m-to-n relation (#1075) 2022-10-26 11:20:33 +08:00
Billy Chan
77bddd85a5
Fixup 2022-09-22 15:07:37 +08:00
Allen
bdd9133aa6 fix lints and warnings
also clean up impl_into_active_value macro
2022-04-09 16:52:47 -07:00
Billy Chan
9036d27da7
Codegen SQLite (#386)
* Codegen SQLite

* Remove debugging

* Fixup

* Add SQLite "sakila.db" demo [issues]
2021-12-25 11:31:47 +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
Chris Tsang
be01782ac7
Merge pull request #193 from SeaQL/codegen-col-unique-keys
Codegen parse column unique key from index
2021-09-26 16:12:50 +08:00
Billy Chan
6638a2262c Codegen classify ordinary relation wrongly as conjunct relation (#186) 2021-09-25 18:32:50 +08:00
Billy Chan
06a26ace2e
Codegen parse column unique key from index 2021-09-24 15:30:41 +08:00
Billy Chan
e852a09498
cargo clippy 2021-09-03 16:51:22 +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
Billy Chan
f8f3d128fd
Fix clippy warming 2021-06-30 22:50:01 +08:00
Billy Chan
9a25bb9c36
Use belongs_to, has_one and has_many 2021-06-22 23:42:10 +08:00
Billy Chan
cab4b5a3f7
Codegen: Entity Generator (#23) 2021-06-19 19:47:59 +08:00