-
-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Prepare new crate for diesel * feat: add sqlite support for diesel integration * fix: diesel sqlite change some type mapping * fix: More sqlite fixes * feat: add mysql support for diesel integration * fix: Multiple small fixes to diesel integration * feat: add postgres support for diesel integration * chore: add diesel mysql example * chore: add diesel postgres example * fix: remove defaults for diesel integration * chore: add diesel sqlite example * fix: fix diesel postgres example missing features * chore: use official diesel commit * Add diesel to build * Update Diesel version * Fix workflow expression * Fix problem with bigdecimal build * Remove useless install step * Simplify update logic
- Loading branch information
Showing
18 changed files
with
1,862 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[workspace] | ||
# A separate workspace | ||
|
||
[package] | ||
name = "sea-query-diesel-mysql-example" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
chrono = { version = "0.4", default-features = false, features = ["clock"] } | ||
time = { version = "0.3", features = ["parsing", "macros"] } | ||
serde_json = { version = "1" } | ||
uuid = { version = "1", features = ["serde", "v4"] } | ||
diesel = { version = "2.1.1", features = ["mysql"] } | ||
sea-query = { path = "../.." } | ||
sea-query-diesel = { path = "../../sea-query-diesel", features = [ | ||
"mysql", | ||
"with-chrono", | ||
"with-json", | ||
"with-uuid", | ||
"with-time", | ||
] } | ||
|
||
# NOTE: if you are copying this example into your own project, use the following line instead: | ||
# sea-query = { version = "0"} | ||
# sea-query-diesel = { version = "0", features = [...] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# SeaQuery Diesel MySQL example | ||
|
||
Running: | ||
|
||
```sh | ||
cargo run | ||
``` | ||
|
||
Example output: | ||
|
||
``` | ||
Create table character: Ok(()) | ||
Insert into character Ok(4) | ||
Select one from character: | ||
CharacterStructChrono { id: 4, uuid: UUID(3a23c42d-8cd9-4a0f-a8c3-0ced15d42228), name: "A", font_size: 12, meta: Object {"notes": String("some notes here")}, created: Some(2020-01-01T02:02:02) } | ||
Select one from character: | ||
CharacterStructTime { id: 4, uuid: UUID(3a23c42d-8cd9-4a0f-a8c3-0ced15d42228), name: "A", font_size: 12, meta: Object {"notes": String("some notes here")}, created: Some(2020-01-01 2:02:02.0) } | ||
Update character: Ok(1) | ||
Select one from character: | ||
CharacterStructChrono { id: 4, uuid: UUID(3a23c42d-8cd9-4a0f-a8c3-0ced15d42228), name: "A", font_size: 24, meta: Object {"notes": String("some notes here")}, created: Some(2020-01-01T02:02:02) } | ||
Select one from character: | ||
CharacterStructTime { id: 4, uuid: UUID(3a23c42d-8cd9-4a0f-a8c3-0ced15d42228), name: "A", font_size: 24, meta: Object {"notes": String("some notes here")}, created: Some(2020-01-01 2:02:02.0) } | ||
Count character: Ok(CountField { count: 4 }) | ||
Delete character: Ok(1) | ||
``` |
Oops, something went wrong.