ppakalns / diesel_json Goto Github PK
View Code? Open in Web Editor NEWWrapper type to use with JsonB fields in diesel Queryable, Insertable structures
License: MIT License
Wrapper type to use with JsonB fields in diesel Queryable, Insertable structures
License: MIT License
It looks like you just created this project, and its perfect timing for me as I need a way to query json data. The only thing missing for that is support for the ->
operator in postgres, to allow filtering data based on specific fields in the json data. Do you have any plans to add that?
Example from the postgres docs:
Query: '{"a": {"b":"foo"}}'::json->'a'
Result: {"b":"foo"}
When changing the version to 2.0, the build fails with
> rustup run stable cargo build
Updating crates.io index
Compiling version_check v0.9.4
Compiling syn v1.0.107
Compiling serde v1.0.152
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling serde_derive v1.0.152
Compiling diesel_derives v2.0.1
Compiling serde_json v1.0.91
Compiling diesel v2.0.3
Compiling diesel_json v0.1.1 (/home/jayvdb/rust/diesel_json)
warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = sql_types::Jsonb)]` instead
warning: #[sql_type] attribute form is deprecated
= help: use `#[diesel(sql_type = sql_types::Jsonb)]` instead
error[E0107]: this struct takes 1 generic argument but 2 generic arguments were supplied
--> src/lib.rs:84:38
|
84 | out: &mut diesel::serialize::Output<W, Pg>,
| ^^^^^^ -- help: remove this generic argument
| |
| expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `DB`
--> /home/jayvdb/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-2.0.3/src/serialize.rs:35:12
|
35 | pub struct Output<'a, 'b, DB>
| ^^^^^^ --
For more information about this error, try `rustc --explain E0107`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.