Skip to content

SQLite JSON datatype support - #6500

Closed
arcanis wants to merge 3 commits into
sequelize:masterfrom
arcanis:master
Closed

arcanis wants to merge 3 commits into
sequelize:masterfrom
arcanis:master

Conversation

@arcanis

@arcanis arcanis commented Aug 25, 2016 •

Copy link
Copy Markdown

Pull Request check-list

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does your issue contain a link to existing issue (Closes JSON type should stringify/parse in mysql/mssql/sqlite #4873)
  • Have you added new tests to prevent regressions?
  • Have you added an entry under Future in the changelog?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Description of change

Partial fix for #4873 (cc @mickhansen) - only add JSON support to SQLite, because I don't use MySQL and MSSQL, and I feel much less confident writing tests for these environments (especially since I won't be able to see it myself if something is wrong).

I haven't been able to fix a test, because I'm not familiar enough with how CREATE INDEX queries should look like 😞 Some help on this would be great here.

I wasn't sure if JSONB should also be implemented or if there was too much differences for it to matter, so I figured I should first submit this PR and ask for your input.

Due to the previous point, I splitted some tests in order for a dialect to be able to run JSON-related tests but not JSONB-related tests nor ARRAY-related tests.

Comment thread lib/data-types.js Outdated
if (!(this instanceof DATEONLY)) return new DATEONLY();
}
util.inherits(DATEONLY, ABSTRACT);
inherits(DATEONLY, ABSTRACT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for the JSON to work? Could you do this in a seperate PR? The commits will get squashed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not needed at all, I've simply noticed it hadn't been changed like other inherits calls. I've removed its commit from this PR.

@wmertens

wmertens commented Oct 17, 2016 •

Copy link
Copy Markdown

@arcanis why did you change the tests to JSONB? Sqlite doesn't support that?

self-answer: oh duh, because you don't have the correct answers for Sqlite, nevermind :)

mrwade added a commit to mrwade/sequelize that referenced this pull request Nov 22, 2016
@arcanis

arcanis commented Dec 29, 2016

Copy link
Copy Markdown
Author

I have no use for this PR any longer, should I close it? @mickhansen

@rokoroku

Copy link
Copy Markdown
Contributor

@arcanis May I continue your work?
Maybe I can add some features to query-generators and some tests ...

@arcanis

arcanis commented Jan 10, 2017

Copy link
Copy Markdown
Author

@rokoroku For sure, go for it :) I'm not using sequelize right now, so I can't really champion this feature anymore.

@sushantdhiman

Copy link
Copy Markdown
Contributor

New implementation continued in #7094

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.

JSON type should stringify/parse in mysql/mssql/sqlite

5 participants