Comments (3)
Thank you for your suggestion! We are keen to make this change. JSON support on SQL databases is a messy matter, even MySQL and MariaDB are different. We are not a day to day user of Postgres, so its nice to have your opinion!
When people use json
in Postgres, do they usually use json
or jsonb
? I think option a) is a 'reasonable default', while b) is more explicit. I personally incline on b), but I want to know your preference as a heavy Postgres user. Speaking of that I would prefer for both json
and json_binary
to yield json
on the MySQL side.
from sea-query.
"Heavy postgres user" is a bit too flattering for me, this is the first time I'm actually using it for a real project :D
I've now looked at the mariadb side and wow, that really doesn't help this case. So MariaDB's json type with a JSON_VALID check is equivalent to the postgres json
type, while MySQL's new json type is equivalent to postgres jsonb
.
I'm basically also just learning this myself, so for reference, here's all the info about json in postgres. In short, json is a bit cheaper on insert, but jsonb allows indexing and querying of the data, so it's more useful for data you might want to query/filter.
I would probably take the .json_binary()
approach and just document that there's no difference on the mysql side (and possibly also document the difference between mariadb and mysql at that point, since mysql is technically always json_binary and mariadb is technically always json).
from sea-query.
thank you for your input! this sounds like a reasonable solution at this point. we will implement this change and make a new release
from sea-query.
Related Issues (20)
- Support `COUNT(DISTINCT a.b)`
- Support window functions like `LEAD(...) OVER (...)` and `LAG(...) OVER (...)` (and others)
- Support `IF(<cond>, <then-expr>, <else-expr>)`
- Combine sea-query-attr functional with sea-orm model creation HOT 2
- Ignoring array nesting HOT 5
- Support `JOIN`s in `UpdateStatement` (`join_subquery`, `inner_join`, etc.) HOT 4
- Add support for PostgreSQL's geometric point type HOT 1
- Add support for key length in MySQL
- Correlated subqueries HOT 3
- (PG) Support ALTER COLUMN TYPE USING
- Support delete with join `DELETE alias FROM tbl alias JOIN other_tbl ...` HOT 1
- Add support for `get_json_field` and `cast_json_field` for all backends HOT 1
- Add support for generated columns
- Compilation fails with postgres-array HOT 3
- Add overlap operator for Postgres HOT 1
- Postgres Backend: the type alias 'bigserial' and 'serial' are not valid in the context of a TableAlterStatement HOT 2
- Iden all columns HOT 3
- sea-query-derive 0.3.1 backward incompatible with 0.3.0 HOT 1
- Support bigdecimal 0.4
- Wrong casting of array of Datetime<FixedOffset>
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-query.