210 Commits

Author SHA1 Message Date
Billy Chan
7d537748b7
Bump dependency 2024-06-25 10:45:18 +08:00
Billy Chan
3758f0c51d
1.0.0-rc.6 2024-06-19 20:41:58 +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
Chris Tsang
987cb38aaf 1.0.0-rc.5 2024-05-29 13:46:38 +01:00
Billy Chan
aa626fc1fd
clippy 2024-05-06 13:53:41 +08:00
Billy Chan
0798bf2037
1.0.0-rc.4 2024-05-03 16:07:49 +08:00
Billy Chan
36a151bba7
Added ColumnType::Blob (#2213)
* Added `ColumnType::Blob`

* Fix

* Fix

* Use latest rc versions

* bump sea-query & sea-schema

* fix loco examples

* fix loco examples

* revert
2024-05-03 16:07:36 +08:00
Billy Chan
33f4659db7
clippy 2024-05-03 13:46:38 +08:00
Rafael Oliveira
c59e28f8c0
use @generated mark in files created by sea-orm-codegen (#2199)
This makes it easier for external tools to identify these files as
generated and treat them differently according to their own
configuration.
2024-04-17 23:51:01 +01:00
Billy Chan
0ff000b8f8
Upstream Changes - 4 (#2168)
* cli: generate entity ignore default database schema

* fixup

* select result is `i32`

* fix

* clippy

* revert

* revert

* revert

* revert
2024-03-27 16:19:03 +08:00
Billy Chan
cdf216ccb1
1.0.0-rc.3 2024-03-27 00:17:41 +08:00
Chris Tsang
65de9f929c 1.0.0-rc.2 2024-03-15 23:31:56 +00:00
Billy Chan
b775027fee
Explicit StringLen on ColumnType::String (#2123) 2024-03-05 15:31:58 +08:00
Billy Chan
42553b6624
1.0.0-rc.1 2024-02-06 14:14:09 +08:00
Billy Chan
cef380b977
SQLite type mappings (#2077)
* sqlite: deps

* sqlite: update data type mappings

* sqlite: decimal test cases

* sqlite: try negative numbers

* fixup

* fixup

* fmt

* clippy

* fixup

* fixup

* fixup

* refactor

* fix

* Drop the use of `rust_decimal_macros` (#2078)

* sqlite: decimal -> real

* revert

* Bump dependencies

* Fixup

* Fixup

* Fixup

* Fixup

* Refactor

* Refactor

* Refactor
2024-02-05 14:42:55 +08:00
Chris Tsang
1abb0b2d91 Fix #1851 2024-01-24 18:24:23 +00:00
Chris Tsang
70d4278598 0.12.12 2024-01-22 09:48:29 +00:00
Billy Chan
c6e1a84a12
codegen: testing entity generation of composite foreign key (#2071) 2024-01-19 18:47:49 +08:00
Zhang Yao
d8582c30ab
Fix problems in #1819 (#1821)
* Fix problems in #1819

* Add test cases

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2024-01-19 18:39:57 +08:00
Chris Tsang
260b8a4076 0.12.11 2024-01-14 16:10:33 +00:00
Chris Tsang
e10dcd012f Revert "Fixup"
This reverts commit 8a29cba78a45fc6c7fa578dfb0163ec44a77de98.
2023-12-14 20:20:25 +00:00
Chris Tsang
8a29cba78a Fixup 2023-12-14 20:03:02 +00:00
Chris Tsang
4a59ca681b 0.12.10 2023-12-14 19:42:32 +00: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
Chris Tsang
1ce3778c61 0.12.6 2023-11-13 09:03:26 +00:00
Chris Tsang
070a30aab1 0.12.5 2023-11-12 20:14:29 +00:00
Chris Tsang
8ab24cf884
Enum extra attributes (#1966)
* Feature: Adds sea-orm-cli generate `--enum-extra-attributes` option (#1952)

* Adds `--enum-extra-derives`

* Adds test_enum_extra_attributes

---------

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

* Fixup

---------

Co-authored-by: Zander Milroy <zander.milroy+github@gmail.com>
2023-11-09 03:41:57 +08:00
Lev Khoroshansky
0dbfb42bb7
Support --enum-extra-derives (#1934)
* feat: Support `--enum-extra-derives`

* test: Enum extra derives

* style: Don't format derives

* fix: Put `quote!` inside a function with `#[rustfmt::skip]`
2023-11-09 03:04:24 +08:00
Zander Milroy
5fe81c5867
Fix duplicated active enum use statements on generated entities (#1953)
* fix: Only generate `use` statements once per enum

* Adds gen_import_active_enum tests

---------

Co-authored-by: Schlüter Lukas <lukas.schlueter@gmail.com>
2023-11-09 01:06:33 +08:00
Chris Tsang
240620176c 0.12.4 2023-10-19 19:28:46 +01:00
Chris Tsang
f9db14c686 0.12.3 2023-09-22 18:13:25 +01:00
Billy Chan
9d033d01a8
Fix: generate relation for related entity of composite foreign key (#1693)
* Fix: generate relation for related entity of composite foreign key

* clippy
2023-09-22 02:28:49 +08:00
Chris Tsang
edd6c9b362 cargo clippy 2023-08-25 22:02:33 +01:00
Chris Tsang
242237aa51 0.12.2 2023-08-04 20:44:05 +01:00
Chris Tsang
1e6b10b532 0.12.1 2023-07-27 15:01:42 +01:00
Chris Tsang
96087291c2 0.12.0-rc.5 2023-07-25 16:28:35 +08:00
Billy Chan
9b54797dd7
Upgrade SQLx to v0.7 (#1742)
* Upgrade SQLx to v0.7

* Refactoring

* Fixup

* Bump SeaSchema version

* Fixup

* Refactoring

* Refactoring

* dep

* Bump

* Update sea-schema

* Update sea-schema

---------

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-07-22 01:56:48 +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
Chris Tsang
4e8d0b0c0c 0.12.0-rc.4 2023-07-08 00:14:02 +08:00
Billy Chan
acca634e03
Revert "Upgrade SQLx to v0.7"
This reverts commit 832fabf8ff296896231c0d00bc42ecde779c6d5f.
2023-07-07 16:31:15 +08:00
Billy Chan
832fabf8ff
Upgrade SQLx to v0.7 2023-07-07 16:30:21 +08:00
darkmmon
64342b105c
Upgrading to syn v2 (#1713)
* resetted and re-did the changes

* fmt

* upgraded to syn2 for sea-orm-codegen

* Rename `bae2`

* Drop the use of `#[sea_orm(table_name = "col_name")]` in `DeriveColumn`

* unified derived input metadata parsing filter

* Propagate errors

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-06-26 20:15:37 +08:00
Chris Tsang
c4f1a3c4af Give up
This reverts commit 27af2c9c056be580d22d3a32fd0f766cf4443e3c.
2023-06-22 17:05:33 +08:00
Chris Tsang
27af2c9c05 cargo fmt check 2023-06-22 07:42:48 +08:00
Chris Tsang
b45534c8c2 0.12.0-rc.3 2023-06-22 07:00:42 +08:00
Chris Tsang
20312b776d Revert "Changelog"
This reverts commit 5e5aa7cbd184db141446960e7960d12c9a61363a.
2023-06-20 17:31:25 +08:00
Chris Tsang
5e5aa7cbd1 Changelog 2023-06-20 17:23:05 +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
44a94d65d2
Bump SeaQuery and SeaSchema to new latest RC version (#1661) 2023-05-18 16:51:13 +08:00