Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support json_contains in JSON field #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

iamdavidzeng
Copy link

@iamdavidzeng iamdavidzeng commented Jun 17, 2020

Intro

  1. Add new Operator json_contains to support JSON field in mysql5.7 or higher
  2. Add mysql test for json_contains and ignore sqlite and postgres
  3. Only support sqlalchemy1.3.x or higher for now

More

  1. Not sure format is correct for this repo.
  2. Please let me know if there is something necessary need to add for this PR.

Confused

  1. Can't find sqlite3 version, and sqlalchemy1.1.x or higher support JSON but sqlite will raise an says that:
 CompileError: (in table 'til', column 'refer_info'): Compiler <sqlalchemy.dialects.sqlite.base.SQLiteTypeCompiler object at 0x7f045429d9d0> can't render element of type <class 'sqlalchemy.sql.sqltypes.JSON'>

I think the error might be cause by sqlalchemy version and restrict it to 1.3.x or higher then test pass.

but still can't figure out why sqlalchemy1.1 and sqlalchemy1.2 will raise such error with sqlite3, any idea about this?

@iamdavidzeng iamdavidzeng force-pushed the support-json-contains branch from c12e948 to c5dce9b Compare June 18, 2020 05:57
@juliotrigo
Copy link
Owner

Thank you @iamdavidzeng for your request!

I will review your changes in the next days.

@Gijsbertbas
Copy link

@juliotrigo thank you for this great package!

Any chance this PR might be merged and released soon? it would be a nice feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants