40 Commits

Author SHA1 Message Date
Billy Chan
9282ce2ded
Cont. Add serde skip options for hidden columns to the CLI (#1320)
* Add serde skip options for hidden columns to the CLI (#1171)

* Add serde skip options for hidden columns to the CLI

* Resolve rustfmt and clippy issues

* Use SerdeDeriveOptions instead of WithSerde in tests

* Resolve upstream conflict

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

* [CLI] serde_skip_hidden_column

* clippy

* clippy

Co-authored-by: Jacob Trueb <jtrueb@northwestern.edu>
2022-12-20 00:43:21 +08:00
Billy Chan
3f00725ee2
Cli serde skip deserialize for primary key option (#1186) (#1318)
* Cli serde skip deserialize for primary key option (#1186)

* Add CLI option to skip primary keys with serde

Implements: https://github.com/SeaQL/sea-orm/issues/841

* Codegen: fix tests

* complete skip_deserialize cli feature

* run fmt

* fix tests

Co-authored-by: witcher <witcher@wiredspace.de>

* [cli] should be `#[serde(skip_deserializing)]`

* [CLI] code refactor

* [cli] rename

Co-authored-by: Isaiah Gamble <77396670+tsar-boomba@users.noreply.github.com>
Co-authored-by: witcher <witcher@wiredspace.de>
2022-12-19 22:11:45 +08:00
Billy Chan
b5b9790252
Support array datatype in PostgreSQL (#1132)
* PostgreSQL array (draft)

* Fixup

* Fixup

* Fixup

* Fixup

* Fixup

* Refactoring

* generate entity for Postgres array fields

* Add tests

* Update Cargo.toml

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-10-23 18:26:57 +08:00
Billy Chan
77bddd85a5
Fixup 2022-09-22 15:07:37 +08:00
Billy Chan
f6672137a2
cargo fmt 2022-07-26 12:20:40 +08:00
Anshul Chauhan
b566ea6e12
Update get_info method to respect date-time crate (#910)
Refer https://github.com/SeaQL/sea-orm/issues/869
2022-07-26 12:19:43 +08:00
Billy Chan
13d2abf5a8
Codegen supports VarBinary column type (#746)
* [cli]: codegen supports `VarBinary` column type

* Fixup
2022-07-17 18:05:39 +08:00
Chris Tsang
a24df5a91e Tweaks & fmt 2022-07-11 00:03:40 +08:00
Billy Chan
65017bdc08
Add various blob column types with size (#850) 2022-07-10 22:52:50 +08:00
Nahua
a1bf662fc3
#661: Add flag to sea-orm-cli to generate code for time crate (#724)
* Implement entity writer context and date time crate enum

* Use entity writer context to render correct rust type according to chrono/time enum

* Add unit test to get col rs type with time crate

* Add date-time-crate flag for cli

* Edit usage of updated get_rs_type method

* Use arg enum for date time crate

* Move date time crate arg enum conversion into commands module

* Directly use arg enum

* Fixing import issues for arg enum w/ help from Billy
2022-07-10 15:22:47 +08:00
Billy Chan
d6831e5295
Bump version of sqlx, sea-query, sea-schema, time and uuid (#834)
* Bump version of sqlx, sea-query, sea-schema, time and uuid

* PostgreSQL `u32` was wrapped in `Oid` (launchbadge/sqlx#1602)

* Update test cases

* Fix clippy warnings

* cargo fmt

* Fix clippy warnings

* Bump sea-schema to ^0.9.2

* Update test cases

* Pin on sea-query minor version
2022-07-05 01:05:11 +08:00
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
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
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
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
Billy Chan
f5f6a6774f
Codegen ActiveEnum & Create Enum From ActiveEnum (#348) 2021-12-15 00:52:50 +08:00
Billy Chan
a970e43f50
Merge branch 'master' into rust-keywords 2021-10-06 22:04:55 +08:00
Billy Chan
18c245c72d Codegen date & time column Rust type mapping 2021-10-06 21:25:37 +08:00
Billy Chan
7779ac886e
Escape rust keyword on codegen 2021-10-05 10:49:06 +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
Billy Chan
ffb0f1f07d
Codegen supports ColumnType::TimestampWithTimeZone 2021-09-17 21:57:16 +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
e852a09498
cargo clippy 2021-09-03 16:51:22 +08:00
Billy Chan
2db5c5e8c9 Change manifest for SeaQL/sea-schema#14 2021-08-21 22:59:52 +08:00
Billy Chan
b1d28db5ad
Fix clippy warnings 2021-08-10 11:03:41 +08:00
Chris Tsang
c1ac7baae9 cargo fmt 2021-08-08 16:13:27 +08:00
Chris Tsang
b9a537db3b Support sea-query 0.12.9 2021-08-08 15:42:53 +08:00
Chris Tsang
478d2a9b37 Improve codegen column to Rust type mapping 2021-08-07 21:43:32 +08:00
Sam Samai
b205fc48aa Add Uuid to col_type for codegen 2021-07-25 21:45:08 +10: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
83e4859776
codegen ColumnDef null() and unique() 2021-06-22 22:40:43 +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