148 Commits

Author SHA1 Message Date
Chris Tsang
33fc350e76 Readme 2023-07-30 06:00:14 +08:00
Chris Tsang
c5529b33f9 Readme 2023-07-27 14:29:38 +01:00
Chris Tsang
ae8dcceb43 Community Survey 2023-07-27 19:11:17 +08:00
Chris Tsang
ad33d7745d Readme 2023-07-26 19:07:36 +08:00
Chris Tsang
2ce41fa6f2 Readme 2023-07-26 18:59:16 +08:00
Chris Tsang
a5f2ae69e9 Organize entity prelude 2023-07-13 16:53:24 +01:00
darkmmon
866025a733
implement DeriveIden in sea-orm only (#1740)
* WIP, implementing Iden

* completed implementation for DeriveIden and added basic test cases

* added feature flag to prevent sea-orm::sea-query::DeriveIden from crashing when sea-query is not used

* fixed doc test and adjusted test case

* enable `sea-query-derive`'s `sea-orm` feature

* Bump `sea-query-derive` to v0.4

* Update Cargo.toml

* Update Cargo.toml

* adjusted test cases and updated so that iden attribute will not be snake cased

* Update Cargo.toml

* Update main.rs

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-07-13 16:28:35 +08:00
darkmmon
902c0ed5ff
DeriveDisplay macro for enum (#1726)
* WIP

* WIP

* WIP

* changed from storing ident to storing TokenStream internally

* Push for code sharing

* fmt

* changing test target to string

* updated Display not showing extra single quote, fixed clippy

* removed DeriveDisplay for test case not using display trait

* added test cases for display_value attribute

* Remove useless clone

* Add comment

* Remove useless clone

* Rename method

* Refactoring

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
2023-07-10 11:51:19 +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
ForzenString
744e063222 add SelectColumns only modify select columns
add `PartialModelTrait` for a part of model

re-export `PartialModelTrait`

cargo fmt

add fn`into_partial_model` on `Select`&`SelectTwo`

add `DerivePartialModel` to impl `PartialModel`

add macro `DerivePartialModel` to `sea-orm`

disambiguate `SelectColumns` function

fix macro error

cargo fmt && cargo clippy

move `SelectColumns` from helper.rs to traits.rs

cargo fmt

Reduce nest hell of load attribute argument fetch

 test `DerivePartialModel`  input parse

`DerivePartialModel` not derive with generic

fix `DerivePartialModel` code generate error

remove unused use

cargo fmt

add `into_partial_model` for `SelectTwoMany`
2023-04-26 18:28:44 +08:00
Billy Chan
2eda8aa3f2
Drop the use of sea-strum and depends on the original strum with a tailored EnumIter provided (#1535)
* Update heck dependency

* Fix formatter error

* Drop the use of `sea-strum` and depends on the original `strum` with a tailored `EnumIter` provided

* fmt

* Depends on `strum` 0.23

* Depends on `strum` 0.24

* Source code adapted from https://github.com/Peternator7/strum

* Update LICENSE

---------

Co-authored-by: Sergei Ivankov <sergeiivankov@pm.me>
Co-authored-by: Sergei Ivankov <96142843+sergeiivankov@users.noreply.github.com>
Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2023-03-22 11:47:15 +08:00
Billy Chan
91c4930391
Cleanup panic and unwrap (#1231)
* Add clippy linter checks

* Mock

* InnerConnection

* panic -> Err

* panic -> Err

* More panic -> Err

* Replace unwrap

* Fix clippy

* add clippy linters

* Refactor

* Dump DbErr::Mock

* Revert if...else rewrite

* Remove except

* DbErr helper functions

* Fix clippy

* Negative SQLite last_insert_rowid throw unreachable

* Update panics docs

* Fixup

* Fixup

* Fixup

* Fixup

* Revert adding `ExecResultHolder::Disconnected`

* More fixup

* Fix

* Revert adding `QueryResultRow::Disconnected`

* Fix

* Refactoring

* Fix

* Refactoring

* More refactoring

* More refactoring

* Fix

* Revert `InnerConnection::Disconnected`

* Revert breaking changes

* Fix

* Fix

* Fix

* Refactor `.take().expect()`

* Revert changing `if ... else` to `match` block

* Revert changing return type of `MockDatabaseConnection` transaction method

* Borrow sqlcipher_key

* Fetching unsupported type from query result will thrown `DbErr::Type(...)` error

* Revert adding `DatabaseConnection::try_into_transaction_log()` method

* Refactoring

* Refactoring
2023-02-02 00:02:53 +08:00
Chris Tsang
2cb9824a18 Mascot 2023-01-10 16:45:38 +08:00
Billy Chan
e246d3faaf
Cont. Upgrade to SeaQuery 0.28.0 (#1366)
* Upgrade to SeaQuery 0.28.0

* Remove unnecessary heap allocation

* Upgrade sea-query-binder

* Upgrade sea-schema

* Fix

* Upgrade sea-schema

* refactoring

Co-authored-by: Ivan Krivosheev <py.krivosheev@gmail.com>
2023-01-05 20:41:28 +08:00
Chris Tsang
19f0ecd0bc Readme 2022-11-16 14:09:48 +08:00
Chris Tsang
0ac8ff8db7 Update Spyglass 2022-11-16 13:53:09 +08:00
Billy Chan
a0b3c58c5f
README 2022-11-14 14:43:14 +08:00
Billy Chan
0ca62ba145
Links to cookbook 2022-10-13 21:24:17 +08:00
Billy Chan
3c19d7c3e4
Exclude test_cfg module from SeaORM (#1077) 2022-10-06 23:45:09 +08:00
Horu
49c1a6d716
docs(readme): fix architecture link (#1086) 2022-10-03 12:12:39 +08:00
Billy Chan
5e34bcecbe
Edit README 2022-08-11 15:39:50 +08:00
Billy Chan
1a2090fb5e
Give a shout-out to our contributors 2022-08-10 13:40:18 +08:00
Billy Chan
710ef7a66b
Add example links 2022-07-26 14:50:55 +08:00
Billy Chan
b0ea1138b4
Update lib.rs 2022-07-07 15:20:43 +08:00
Billy Chan
ab2f784701
(de)serialize custom JSON types - 2 (#794)
* de(serialize) custom JSON types

* Rename DeriveTryGetableFromJson -> FromJsonQueryResult

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-07-01 01:27:46 +08:00
Billy Chan
1054d6451c
Use file!() macro to avoid manually defining the name of migration (#736)
* Add `DeriveMigrationName`

* CLI migrate generate without replacing migration name

* Update migrations

* Fixup
2022-06-29 00:42:59 +08:00
Billy Chan
b59f3c58de
cargo fmt 2022-05-13 18:20:59 +08:00
Chris Tsang
b51b1f63d8 Readme 2022-05-13 00:33:07 +08:00
Billy Chan
664f42d22d
cargo fmt 2022-04-26 12:24:17 +08:00
Chris Tsang
66ba234156 Readme 2022-04-18 23:53:47 +08:00
Chris Tsang
2e12e29c38 Readme 2022-04-18 23:17:52 +08:00
Chris Tsang
ac1071a778 Readme 2022-04-05 21:25:58 +08:00
Chris Tsang
31edb2c409 Rename 2022-04-05 21:23:55 +08:00
Chris Tsang
6175166c79 Add jsonrpsee to example list 2022-04-03 22:16:05 +08:00
Chris Tsang
311a14a470 Rename example 2022-04-03 22:12:48 +08:00
Billy Chan
6091629adb
cargo fmt 2022-03-25 15:25:49 +08:00
Billy Chan
3c0fe9bc0a
Update lib.rs 2022-03-16 18:18:27 +08:00
Billy Chan
942f1a9914
Update lib.rs 2022-03-14 13:12:31 +08:00
Chris Tsang
b2954d84af Readme 2022-03-14 03:19:45 +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
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
Sunli
211029356c Add Poem example 2022-01-13 12:24:42 +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
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
4072e74284
cargo fmt 2021-12-17 11:14:54 +08:00