977 Commits

Author SHA1 Message Date
Dmitrii Aleksandrov
605ea19672
Merge branch 'master' into set-if-not-equals 2024-05-09 23:08:32 +04:00
Chris Tsang
e77cc5fa65
Merge pull request #2186 from SeaQL/entity-behavior
Associate `ActiveModel` to `EntityTrait`
2024-05-09 17:53:31 +01:00
Chris Tsang
c2b8c44118
Merge pull request #2185 from SeaQL/pk-arity-trait
`PrimaryKeyArity` trait
2024-05-09 17:50:34 +01:00
Dmitrii Aleksandrov
e162a1be9e
Add ActiveValue::try_as_ref() (#2197) 2024-05-09 17:44:37 +01:00
Billy Chan
aa626fc1fd
clippy 2024-05-06 13:53:41 +08:00
Billy Chan
33f4659db7
clippy 2024-05-03 13:46:38 +08:00
Billy Chan
e6649988dd
docs 2024-04-26 11:56:52 +08:00
Joe
c724ec5751
Add method for retrieiving column names (#2148)
* Add method for retrieiving column names

* Address PR comments as well as add test
2024-04-17 23:12:57 +01:00
Dmitrii Aleksandrov
b2b0a404e4 Add ActiveValue::set_if_not_equals() 2024-04-10 23:01:07 +04:00
Chris Tsang
1c269a081f Associate ActiveModel to EntityTrait 2024-04-03 21:14:22 +01:00
Chris Tsang
fe3e92bfdf Make use of ARITY 2024-04-03 20:51:39 +01:00
Billy Chan
f066b7a4d2
PrimaryKeyArity trait 2024-04-03 12:00:46 +08:00
Billy Chan
c8c02f6f6e
Upstream Changes - 5 (#2176)
* Upstream Changes - 5

* clippy

* more
2024-03-28 16:25:31 +08:00
Billy Chan
b866236704
examples: deprecate actix3_example (#2154) 2024-03-13 13:46:53 +08:00
Dmitrii Aleksandrov
159c53e65f
Add RelationDef::from_alias() (#2146)
* Add `RelationDef::from_alias()`

* Fix code formatting

* Fix code formatting again
2024-03-10 23:55:22 +00:00
Billy Chan
f3967fdaca
Upstream Changes - 1 (#2145)
* upstream changes

* universal `#[sea_orm_macros::test]`

* fix

* fix

* `ColumnTrait::into_returning_expr`

* fix

* fix

* Do not pub sqlx_common

---------

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2024-03-10 18:14:46 +00:00
Billy Chan
b775027fee
Explicit StringLen on ColumnType::String (#2123) 2024-03-05 15:31:58 +08:00
Forest Anderson
88fafa57d9
Add mock feature flag docs (#2109) 2024-02-28 20:04:12 +00: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
Billy Chan
76f73e778d
README 2024-02-02 17:01:25 +08:00
Billy Chan
ab7de834b9
README 2024-02-02 16:51:30 +08:00
Billy Chan
9cd96462e8
Gold Sponsor 2024-02-02 13:35:30 +08:00
Billy Chan
116cfebece
Gold Sponsor 2024-02-02 13:22:13 +08:00
Billy Chan
2adbf8cd22
Gold Sponsor 2024-02-02 13:21:35 +08:00
Chris Tsang
0016eff73b Update 2024-01-28 01:50:43 +00:00
Andrea Corradi
c56c072f27
Enable sqlite returning with feature flag (#2070)
* Enable sqlite returning with feature flag

* Add runtime check for sqlite version

* Apply suggestions from code review

* Fix clippy

* Rename feature

* Fix tests when feature flag is not enabled

---------

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2024-01-26 04:28:59 +08:00
Chris Tsang
4690bafcbd Edit 2024-01-20 22:08:35 +00:00
Chris Tsang
382ffa3054 Add ConnectOptions::test_before_acquire #2066 2024-01-20 22:05:16 +00:00
Chris Tsang
361924336d clippy 2024-01-14 15:55:08 +00:00
Chris Tsang
f27526b79d Changelog 2024-01-14 15:43:57 +00:00
Francis Le Roy
7eb3e12294
Updated the 'QuerySelect' trait to expose 'lock_with_behavior' (#1867) 2024-01-14 23:51:51 +08:00
Maksim Zaborovskiy
c5adb9d1d1
Add cursor pagination desc order (#2037)
* feat: add cursor pagination desc order

* feat: add cursor pagination desc order

* test: add cursor integration tests

* test: add cursor integration tests

* test: add query cursor_by tests

* test: add query cursor_by tests

* test: add query cursor_by tests

* test: add query cursor_by tests

* test: add query cursor_by tests

* test: add query cursor_by sort tests

* chore: remove unused import
2024-01-14 23:23:55 +08:00
Dmitrii Aleksandrov
a73f699578
Cast enums in lt(), lte(), gt(), gte() (#2014)
* Cast enums in lt, lte, gt, gte (revert 10f3de0, discussed under #1527)

* Add tests for enum order comparisons
2024-01-12 22:42:29 +08:00
Anshul Sanghi
f019d6ab22
Add Ability To Configure SQLx Slow Statement Logging Settings (#2055)
* Add Ability To Configure SQLx Slow Statement Logging Settings

* Disable SQLX Slow Statement Logging By Default
2024-01-12 19:16:24 +08:00
Chris Tsang
f54683d365
Refactor/fix clippy errors (#2056) (#2057)
* chore: add clippy config file

* refactor: fix clippy errors and wornings of runtime-async-std-native-tls,sqlx-all

* refactor: fix clippy errors and wornings of sqlx-sqlite, sqlx-mysql, sqlx-postgres

* chore: format

* refactor: fix clippy

* fix: import path

* refactor: fix clippy errors and wornings of sqlx-sqlite, sqlx-mysql, sqlx-postgres

* fix: revert some space and comma removal

* fix: revert some space and comma removal

* refactor: add feature flag

* fix: import path

* test: remove mismatch feature flag

* test: remove mismatch feature flag

* chore: add proper feature flag

* chore: remove feature flag

* refactor: remove clippy.toml file

* fix: re-export driver

* fix: re-export JoinType

* fix: remove feature flag

* chore: add #[allow(unused_imports)] for driver

Co-authored-by: Shogo Nakano <61229807+shogo-nakano-desu@users.noreply.github.com>
2024-01-11 00:21:22 +08:00
Shogo Nakano
3dc66aa17d
refactor: add clear_order_by for num_items (#2030) 2024-01-10 18:30:30 +08:00
Chris Tsang
0ad6c2fb14 Readme 2023-12-16 19:44:32 +00:00
Chris Tsang
84a24bab01 Rename things 2023-12-14 21:13:04 +00:00
Dmitrii Aleksandrov
1abc47b5f1
Cast enums in is_in and is_not_in (#1527) (#2002)
* Cast enums in `is_in` and `is_not_in` (#1527)

* Restore original tests, add tests for generated SQL
2023-12-15 03:41:05 +08:00
Chris Tsang
5859d261f1 Cleanup feature flags 2023-12-14 17:03:16 +00:00
Chris Tsang
955bbcbc12
Database Proxy (#2000)
* feat: Add proxy connection type

* feat: Add proxy database's proxy functions trait.

* fix: Remove some unused impl to fix the unit test

* test: Create the proxy by empty declaration.

* test: Try to genereate query and exec commands.

* perf: Add more query debug trait for debugging.

* chore: Add the example for wasi + proxy.

* chore: Try to read string from wasmtime vm.

* chore: Sucks, but how to do without tokio::spawn?

* chore: Complete the basic memory read logic.

* chore: Abandon the WASI demo, native demo first...

* refactor: Use single proxy connection generator
to avoid stack overflow

* refactor: Rename the inner structs' name

* fix: Fix CI clippy and unit test

* fix: Rename the example.

* chore: Try to embed surrealdb for proxy test.

* fix: Transfer the query result correctly.

* refactor: Rename the example.

* chore: Ready to add example for wasmtime proxy.

* feat: Try to compile sea-orm into wasm binary.
But it would failed on wasm32-wasi target because of the socket deps.
It can be compiled on wasm32-unknown-unknown target.

* fix: WASM targets can't use sqlx.

* fix: Try to fix CI by remove toml.

* fix: Try to fix CI by remove toml.

* fix: Move vm to the example's root dir.

* fix: Add a pre-build script.

* chore: Add README.

* fix: Try to fix CI.

* feat: Add proxy logic in wasm module.

* fix: Try to run the wasi module.
But WASI cannot support multi threads..
so the module was run failed.

* refactor: Bump wasmtime to 14.

* fix: Now we can use async traits on wasmtime.
The solution is add the current thread tag to tokio-wasi.

* build: Use build.rs instead of dynamic command.

* feat: Add the execute result's transfer logic.

* fix: Convert sqlx query result for sea-query.

* fix: Now we can transfer wasm's query to outside.

* refactor: Convert to ProxyRow first.
It's the solution to know the type information about the value.

* fix: Multiple time library reference.

* feat: Add a new proxy example which uses GlueSQL.

* test: Add the test cases for three new examples.
Just try to run once...

* ci: Add wasm component's compiler for unit test.

* ci: Add wasi target.

* ci: It may needs wasi target twice...

* feat: Add more keys for proxy execute result.
To transfer the fully information of the execute result.

* fix: Use custom id type instead of json value.

* fix: Wrong reference type.

* fix: Rewrite the transformer.

* perf: Add ToString trait for proxy exec result.

* revert: Again.
Refs: 9bac6e91ca9df04ccd8368906e1613cfc5b96218

* revert: Back to the basic proxy exec result.
Refs: e0330dde73a54d461d5f38c69eec5e13bcc928d4

* refactor: Update GlueSQL and SurrealDB examples. (#1980)

* refactor: Bump gluesql to 0.15
Relate to https://github.com/gluesql/gluesql/issues/1438

* Use SQLParser to parse and replace placeholders.

* Use SQLParser for surrealdb demo.

* Transform the query by SQLParser.

* Tweaks

* Remove wasmtime example. (#2001)

* ci: Add additional targets.

* Remove proxy wasmtime example.

* Format

---------

Co-authored-by: 伊欧 <langyo.china@gmail.com>
Co-authored-by: 伊欧 <m13776491897@163.com>
2023-12-14 19:40:55 +08: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
Bouke van der Bijl
a1396f3679
Add source annotations to errors (#1999) 2023-12-08 21:50:57 +08:00
Chris Tsang
2eb3d8e465 Cherry pick tests from #1679 2023-12-01 11:29:05 +00:00
Chris Tsang
8210428674 Implement StatementBuilder for sea_query::WithQuery #1960 2023-12-01 10:16:22 +00:00
Chris Tsang
d471c4e022 Change method signature of expr_as to accept self #1979 2023-11-22 22:32:34 +00:00
Chris Tsang
091eb4d85d Readme 2023-10-19 19:30:51 +01:00
Chris Tsang
72e9a140e3 Update Readme 2023-10-19 19:25:48 +01:00
Erik Wegner
fef3a67856
Typo (#1923) 2023-10-20 02:02:26 +08:00
Chris Tsang
93623f0d02 Support MySQL / SQLite 2023-10-16 09:55:30 +01:00