849 Commits

Author SHA1 Message Date
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
b2954d84af Readme 2022-03-14 03:19:45 +08:00
Billy Chan
351efd0d6b
Update ActiveModel by JSON (#492)
* Update ActiveModel by JSON

* Add `ActiveModel::from_json`

* Update test cases
2022-03-13 18:41:32 +08:00
Billy Chan
9687819a7e
Supports time crate 2022-03-13 18:18:15 +08:00
Chris Tsang
0a26dee674 Readme 2022-03-09 00:21:34 +08:00
Chris Tsang
0f0b482931 Readme 2022-03-09 00:14:33 +08:00
Billy Chan
f3a7a1398a
Merge branch 'master' into pulls/471 2022-03-07 15:52:12 +08:00
Ken-Miura
483de17da8
Describe default value of ActiveValue on document (#556) 2022-03-02 12:24:49 +08:00
Billy Chan
858953b478
cargo fmt 2022-02-17 15:44:40 +08:00
Billy Chan
56cf4ea662
Update README.md 2022-02-15 23:32:52 +08:00
Bastian
47f2f4cec8
Easy joins with MockDatabase #447 (#455)
* Easy joins with MockDatabase #447

* fix MR

* add unit test

* Add test cases

* Cargo fmt

Co-authored-by: Bastian Schubert <bastian.schubert@crosscard.com>
Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-02-06 14:45:51 +08:00
Chris Tsang
e305c6669c
Merge pull request #493 from SeaQL/max-lifetime-connection-opt
Add `max_lifetime` connection option
2022-02-05 20:50:39 +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
Chris Tsang
e63d463155
Merge pull request #489 from SeaQL/date-time-utc-local
Support `DateTime<Utc>` & `DateTime<Local>`
2022-02-01 15:25:39 +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
Charles Chege
52f38a10ea Support the use of chrono::DateTime<Utc> in sea-orm
Add documentation for this

Temporarily use a fork to include new Sea-query code

Add tests for DateTimeUtc

Solve Github actions error by add the code to create a table

Assertion accuracy tests

Rectify incorrect format
2022-02-01 14:27:33 +08:00
Billy Chan
15dc9576ea
Add max_lifetime connection option 2022-01-28 11:51:44 +08:00
Billy Chan
76c0d7fff5
Name conflict of foreign key constraints when two entities have more than one foreign keys (#417)
* fix: name conflict of foreign key constraints when two entities have more than one fk

* test: update test case's foreign keys

* feat: override default name of foreign key constraint
2022-01-28 01:03:24 +08:00
Chris Tsang
946a03b426
Merge pull request #446 from sunli829/master
Add Poem example
2022-01-23 17:31:39 +08:00
Sebastian Pütz
949e3115f5 Make TransactionStream::build sync 2022-01-19 23:55:26 +01:00
Sebastian Pütz
f012ccaec3 Add Send bound to streams. 2022-01-19 20:46:10 +01:00
Billy Chan
0f5516b6bf
fix: support up to 6-ary composite primary key (#423) 2022-01-14 01:16:39 +08:00
Sunli
211029356c Add Poem example 2022-01-13 12:24:42 +08:00
Chris Tsang
6120d82924 cargo fmt 2021-12-26 00:36:33 +08:00
Chris Tsang
d5c9c65079 Revert save to return Self 2021-12-26 00:13:56 +08:00
Chris Tsang
47cbf50c3c
Merge branch 'master' into pulls/361 2021-12-25 17:41:29 +08:00
Billy Chan
17631512bb
feat(Model): add wrapper method delete 2021-12-21 18:24:05 +08:00
Chris Tsang
09fd9ba725 Docs 2021-12-19 02:23:23 +08:00
Billy Chan
adfb9ead54
Rework ActiveValue (#340)
* WIP

* Fixup

* Fixup

* Update docs & rename `unset`

* Deprecate `Unset()` and reexport `ActiveValue::NotSet`

* Docs

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2021-12-19 02:22:30 +08:00
Billy Chan
5104cd3573
Insert & Update Return Model (#339)
* Update insert & update API

* Update test cases

* Update README

* Fix clippy warnings

* Fixup

* Fixup
2021-12-18 14:30:10 +08:00
Billy Chan
006d35313b
Fix clippy warnings 2021-12-17 11:39:53 +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
9ef44be422
Merge pull request #370 from SeaQL/bump-query-dep-to-pr-202 2021-12-15 00:50:53 +08:00
Chris Tsang
7da5b6bf90
Merge pull request #373 from nappa85/master 2021-12-15 00:49:52 +08:00
Billy Chan
66a005237c
Update sea-orm to depends on sea-query 0.20.0 2021-12-12 23:03:11 +08:00
Billy Chan
b9fe878542 Handling MySQL & SQLite timestamp columns 2021-12-11 14:25:45 +08:00
Billy Chan
0f164b62d5
Fix related & linked with enum columns (#376)
* Fix related & linked with enum columns

* Add test cases
2021-12-10 23:41:43 +08:00
Marco Napetti
9a342546f3 use macro to simplify code, add failure boolean 2021-12-10 10:09:09 +01:00
Marco Napetti
aaf11dd265 Into doesn't works 2021-12-09 19:17:41 +01:00
Marco Napetti
4abe8310a5 Per-connection metric 2021-12-09 19:03:46 +01:00
Marco Napetti
6b94673dd9 First metric and tracing implementation 2021-12-09 15:12:41 +01:00
Billy Chan
1aea3f6c6c
Delete::many with TableRef 2021-12-08 15:56:37 +08:00
Billy Chan
af1ffdad83
Rename sea-strum lib back to strum 2021-12-07 17:21:03 +08:00
Billy Chan
1229287fd8
Support Up to 6 Values Composite Primary Key (#353)
* Support up to 6 composite primary key

* Test [issues]

* Test [issues]
2021-12-04 20:57:05 +08:00
lz1998
273dc0dd1a
add offset and limit (#351)
* add offset and limit

* move offset&limit to QuerySelect
2021-12-03 01:12:49 +08:00
Chris Tsang
cc4904993a Readme 2021-11-24 00:56:01 +08:00
Jaebum Lee
bc952b3787 Add TryFromU64 trait for DateTime<FixedOffset>.
The timestamp column (with time zone) generates the field with `chrono::DateTime<chrono::FixedOffset>`.
Sadly, `DeriveEntityModel` macro fails because `TryFromU64` is not implemented for this type.

I added the trivial implementation for `chrono::DateTime<chrono::FixedOffset>`.
2021-11-21 23:36:13 -08:00
Chris Tsang
d952a3e42a Readme 2021-11-21 17:57:33 +08:00
Chris Tsang
af3632de11 New tagline 2021-11-21 17:46:47 +08:00