140 Commits

Author SHA1 Message Date
Billy Chan
cd3b11a503
Fix codegen with Enum in expanded format (#624) 2022-03-22 23:27:14 +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
Billy Chan
4ee6eac313
CLI generate enum with numeric like variants 2022-03-08 17:50:01 +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
Chris Tsang
377205d6a5 sea-orm-codegen 0.6.0 2022-02-07 00:10:07 +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
Billy Chan
8eb095385d Migration (#335)
* Refactor `ConnectionTrait`

* Refactoring

* Build index & foreign key statements

* Fix imports

* Fixup

* Rocket example with migration

* async-std compatible with the tokio 1.0 runtime

* Use reexported dependency

* Compile without selecting any db backend

* Updating sea-orm-cli dep

* sea-orm-cli migrate commands

* cargo fmt

* Test [cli]

* Refactoring

* Clap app name should be "sea-orm-cli"

* Correctly capture MIGRATION_DIR

* Rename README

* Add `sea-orm-cli migrate init` command

* Update README

* Try restructured sea-query dependency (SeaQL/sea-schema#41)

* Set `DATABASE_URL` environment variable
2022-02-05 20:34:54 +08:00
Billy Chan
8145088814 Refactoring
`ColumnDef` with default value

Cargo fmt

Update docs

Fixup

Support `DateTimeLocal`

Update docs

Codegen write db timestamp column as `DateTimeUtc` type

Update dependency

Merge branch 'sea-query/add-new-column-ref' into pr/429

feat: apply alias on `ColumnRef::SchemaTableColumn`
2022-02-01 14:29:03 +08:00
Benoit Jeaurond
2a2b5d7b62 feat: add serde derives to enums, if specified 2022-01-16 16:16:11 -05:00
Chris Tsang
82bad4a376 0.5.0 2022-01-01 16:05:36 +08:00
Chris Tsang
9beb572afb sea-orm-codegen 0.5.0-rc.1 2021-12-26 02:27:44 +08: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
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
Chris Tsang
6767e8b834 sea-orm-codegen 0.4.2 2021-12-12 22:45:34 +08:00
Chris Tsang
f2273eac71 sea-orm-codegen 0.4.1 2021-12-05 00:13:03 +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
c78fa48fff sea-orm-codegen 0.4.0 2021-11-19 23:03:48 +08:00
Billy Chan
8b217239fd
Fix clippy warnings 2021-11-08 12:13:29 +08:00
Carter Snook
058f6d5d2b
chore: update to Rust Edition 2021 (#273) 2021-10-26 17:27:53 +08:00
Chris Tsang
3cef4d5ebf sea-orm-codegen 0.3.1 2021-10-23 16:00:02 +08:00
Billy Chan
b65d441dea
Fix clippy warnings 2021-10-21 16:26:42 +08:00
Chris Tsang
0789ee71bf sea-orm-codegen 0.3.0 2021-10-16 01:41:06 +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
Chris Tsang
7c8e766e8b sea-orm-codegen 0.2.6 2021-10-09 23:15:03 +08:00
Chris Tsang
cab0f6ba6e Merge pull request #224 from SeaQL/rust-keywords
Escape rust keywords with `r#` raw identifier
2021-10-07 16:36:56 +08:00
Billy Chan
a9f9599a4d Codegen date & time column Rust type mapping 2021-10-07 16:36:47 +08:00
Chris Tsang
a2767eb6fe sea-orm-codegen 0.2.5 2021-10-06 18:43:43 +08:00
Chris Tsang
12affaf0c1 sea-orm-codegen 0.2.4 2021-09-26 16:44:55 +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
Chris Tsang
3c608ad9c3 Bump sea-query 2021-09-26 16:07:06 +08:00
Billy Chan
6638a2262c Codegen classify ordinary relation wrongly as conjunct relation (#186) 2021-09-25 18:32:50 +08:00
Billy Chan
360436ceac
Codegen compact-format generate unique attribute 2021-09-24 15:45:22 +08:00
Billy Chan
06a26ace2e
Codegen parse column unique key from index 2021-09-24 15:30:41 +08:00
Chris Tsang
995a9d0045 sea-orm-codegen 0.2.3 2021-09-22 17:37:34 +08:00
Billy Chan
8dfbbc8385 Fix clippy warnings 2021-09-20 18:30:31 +08:00
Billy Chan
c9047d49e7 Update README & lib.rs 2021-09-20 18:30:31 +08:00
Billy Chan
cb60c4afa3 Keep match catchall 2021-09-20 11:37:44 +08:00
Billy Chan
57201788ef Codegen TimestampWithTimeZone fixup 2021-09-20 11:37:44 +08:00
Chris Tsang
903fda0e87 sea-orm-codegen 0.2.2 2021-09-17 23:39:58 +08:00
Billy Chan
ffb0f1f07d
Codegen supports ColumnType::TimestampWithTimeZone 2021-09-17 21:57:16 +08:00
Billy Chan
5cb1088fd9 Update sea-query dependency 2021-09-15 12:40:37 +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
848a15856b
Fix test cases 2021-09-14 00:08:20 +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