* Implement `IntoActiveValue` for `time` types. I tried to implement a [custom active model](https://www.sea-ql.org/SeaORM/docs/advanced-query/custom-active-model/), and one of the columns was `Option<TimeDateTimeWithTimeZone>`. I got a compiler error: ``` error[E0277]: the trait bound `std::option::Option<sea_orm::prelude::TimeDateTimeWithTimeZone>: IntoActiveValue<_>` is not satisfied ``` Looking into the source code, it seemed a simple oversight that this trait was implemented for the `chrono` types but not the `time` types, and it was easy enough to fix since there's already a macro to implement it for new types. I also noticed that the `time` types are not accounted for in `src/query/json.rs` while the `chrono` types are, which I assume is also an oversight. However, I don't have a need for that at this point and the fix for that seemed less trivial, so I'm just bringing it to your attention. Thanks for SeaORM! * Implement `IntoActiveValue` for `Vec<u8>` types * Add tests to double check and prevent it from happening again * Add docs * Fixup * Serialize `time` types as `serde_json::Value` Co-authored-by: Jimmy Cuadra <jimmy@jimmycuadra.com>
99 lines
3.5 KiB
TOML
99 lines
3.5 KiB
TOML
[workspace]
|
|
members = [".", "sea-orm-macros", "sea-orm-codegen"]
|
|
|
|
[package]
|
|
name = "sea-orm"
|
|
version = "0.10.0"
|
|
authors = ["Chris Tsang <tyt2y7@gmail.com>"]
|
|
edition = "2021"
|
|
description = "🐚 An async & dynamic ORM for Rust"
|
|
license = "MIT OR Apache-2.0"
|
|
homepage = "https://www.sea-ql.org/SeaORM"
|
|
documentation = "https://docs.rs/sea-orm"
|
|
repository = "https://github.com/SeaQL/sea-orm"
|
|
categories = ["database"]
|
|
keywords = ["async", "orm", "mysql", "postgres", "sqlite"]
|
|
rust-version = "1.60"
|
|
|
|
[package.metadata.docs.rs]
|
|
features = ["default", "sqlx-all", "mock", "runtime-async-std-native-tls"]
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
[lib]
|
|
name = "sea_orm"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
async-stream = { version = "^0.3" }
|
|
async-trait = { version = "^0.1" }
|
|
chrono = { version = "^0.4.20", default-features = false, features = ["clock"], optional = true }
|
|
time = { version = "^0.3", optional = true }
|
|
futures = { version = "^0.3" }
|
|
futures-util = { version = "^0.3" }
|
|
log = { version = "^0.4" }
|
|
tracing = { version = "^0.1", features = ["log"] }
|
|
rust_decimal = { version = "^1", optional = true }
|
|
sea-orm-macros = { version = "^0.10.0", path = "sea-orm-macros", optional = true }
|
|
sea-query = { version = "^0.26.3", features = ["thread-safe"] }
|
|
sea-strum = { version = "^0.23", features = ["derive", "sea-orm"] }
|
|
serde = { version = "^1.0", features = ["derive"] }
|
|
serde_json = { version = "^1.0", optional = true }
|
|
sqlx = { version = "^0.6", optional = true }
|
|
uuid = { version = "^1", features = ["serde", "v4"], optional = true }
|
|
ouroboros = "0.15"
|
|
url = "^2.2"
|
|
once_cell = "1.8"
|
|
thiserror = "^1"
|
|
|
|
[dev-dependencies]
|
|
smol = { version = "^1.2" }
|
|
smol-potat = { version = "^1.1" }
|
|
async-std = { version = "^1", features = ["attributes", "tokio1"] }
|
|
tokio = { version = "^1.6", features = ["full"] }
|
|
actix-rt = { version = "2.2.0" }
|
|
maplit = { version = "^1" }
|
|
rust_decimal_macros = { version = "^1" }
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
sea-orm = { path = ".", features = ["mock", "debug-print", "tests-cfg"] }
|
|
pretty_assertions = { version = "^0.7" }
|
|
time = { version = "^0.3", features = ["macros"] }
|
|
|
|
[features]
|
|
debug-print = []
|
|
default = [
|
|
"macros",
|
|
"with-json",
|
|
"with-chrono",
|
|
"with-rust_decimal",
|
|
"with-uuid",
|
|
"with-time",
|
|
]
|
|
macros = ["sea-orm-macros"]
|
|
mock = []
|
|
with-json = ["serde_json", "sea-query/with-json", "chrono/serde", "time/serde", "sqlx?/json"]
|
|
with-chrono = ["chrono", "sea-query/with-chrono", "sqlx?/chrono"]
|
|
with-rust_decimal = ["rust_decimal", "sea-query/with-rust_decimal", "sqlx?/decimal"]
|
|
with-uuid = ["uuid", "sea-query/with-uuid", "sqlx?/uuid"]
|
|
with-time = ["time", "sea-query/with-time", "sqlx?/time"]
|
|
sqlx-dep = []
|
|
sqlx-all = ["sqlx-mysql", "sqlx-postgres", "sqlx-sqlite"]
|
|
sqlx-mysql = ["sqlx-dep", "sea-query/sqlx-mysql", "sqlx/mysql"]
|
|
sqlx-postgres = ["sqlx-dep", "sea-query/sqlx-postgres", "sqlx/postgres"]
|
|
sqlx-sqlite = ["sqlx-dep", "sea-query/sqlx-sqlite", "sqlx/sqlite"]
|
|
runtime-async-std = []
|
|
runtime-async-std-native-tls = [
|
|
"sqlx/runtime-async-std-native-tls",
|
|
"runtime-async-std",
|
|
]
|
|
runtime-async-std-rustls = [
|
|
"sqlx/runtime-async-std-rustls",
|
|
"runtime-async-std",
|
|
]
|
|
runtime-actix = []
|
|
runtime-actix-native-tls = ["sqlx/runtime-actix-native-tls", "runtime-actix"]
|
|
runtime-actix-rustls = ["sqlx/runtime-actix-rustls", "runtime-actix"]
|
|
runtime-tokio = []
|
|
runtime-tokio-native-tls = ["sqlx/runtime-tokio-native-tls", "runtime-tokio"]
|
|
runtime-tokio-rustls = ["sqlx/runtime-tokio-rustls", "runtime-tokio"]
|
|
tests-cfg = []
|