Giter Site home page Giter Site logo

Postgres jsonb support about sea-query HOT 3 CLOSED

seaql avatar seaql commented on August 16, 2024
Postgres jsonb support

from sea-query.

Comments (3)

tyt2y3 avatar tyt2y3 commented on August 16, 2024

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.

Follpvosten avatar Follpvosten commented on August 16, 2024

"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.

tyt2y3 avatar tyt2y3 commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.