Comments (1)
Looks like implementations are defined starting here for the following:
- Option<V>> where V: IntoActiveValue<V> + Into<Value> + Nullable,
- Option<Option<V>> where V: IntoActiveValue<V> + Into<Value> + Nullable,
- bool
- i8
- i16
- i32
- i64
- u8
- u16
- u32
- u64
- f32
- f64
- &'static str
- String
- Vec<u8>
The first two are implemented manually, with the rest being implemented using the impl_into_active_value macro. The explanation for the implementation being only for Vec<u8> and not other Vec types is presumably that ActiveValue::Set(V) has the trait bound V: Into, and Into is implemented for Vec<u8> because Vec<u8> is converted into Value::Bytes. It's also implemented here for Vec<V>, but inside a module that requires the "postgres-array" feature to be enabled. Any fix for this would therefore need to be gated behind the "postgres-array" feature in order to work properly.
Edit: I tried doing this
#[cfg(feature = "postgres-array")]
impl IntoActiveValue<Vec> for Vec
where
V: IntoActiveValue + Into + Nullable + sea_query::ValueType + sea_query::with_array::NotU8
but got an error helpfully informing me that
upstream crates may add a new impl of trait
sea_query::with_array::NotU8
for typeu8
in future versions
Removing the sea_query::with_array::NotU8 bound produces conflicting implementations. Removing the NotU8 bound and deleting impl_into_active_value!(Vec<u8>) just gives me an error informing me that
the trait bound
V: NotU8
is not satisfied
required forsea_query::Value
to implementFrom<Vec<V>>
required forVec<V>
to implement `Into<sea_query::Value>
So it looks like we might be blocked on the stabilization of negative trait bounds.
from sea-orm.
Related Issues (20)
- PostgresQL error `no schema has been selected to create in` HOT 1
- sea-orm-cli does not generate named relations
- `sea-orm-migration` CLI shouldn't always connect to a database
- FromJsonQueryResult should also work with generic types HOT 1
- sea-orm-cli generates uncompilable model from pre-existing autoincrement primary key in sqlite
- Surprising ordering of native MySQL enums
- Entity generation fails if `model-extra-attributes` include a comma surrounded by parentheses HOT 2
- DataLoader load_many and load_many_to_many can't handle capital letters in column name
- Using DeriveIden for enum HOT 3
- Less verbose migration HOT 3
- `referential_key_table_name` empty for multi-column index (Option::unwrap on None during migration)
- `enum`s are always lowercased in queries despire `enum_name` leading to `type does not exist` HOT 2
- Entity Generation Fails to Skip Ignored Tables HOT 3
- DateTimeUtc is recognized as TimestampWithTimeZone HOT 1
- (maybe bug) PaginatorTrait does not apply to generic method. HOT 1
- can sea-orm-cli generate model support model field name camel case option?
- Shared lock syntax incompatible with MariaDB
- SeaORM issue with UUID stored as binary(16) in MySQL
- [BUG] `DerivePartialModel` attr `entity` not support `syn::Path` token HOT 3
- Field name 'is_2fa' converted to 'is2fa' during insertion in SeaORM HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sea-orm.