selda icon indicating copy to clipboard operation
selda copied to clipboard

JSON support on SQLite backend

Open valderman opened this issue 5 years ago • 5 comments

This seems like it could be easily done using json1. This could be done either as a flagged (off by default) module in selda-sqlite or as a separate selda-sqlite-json1 package.

The reason for not including the functionality in selda-sqlite by default is to avoid pulling in aeson's massive list of dependencies when they're not needed.

valderman avatar May 08 '19 16:05 valderman

I'd like to work on this. I'm going to add a flag json if that's okay.

herberteuler avatar Feb 15 '22 20:02 herberteuler

Sounds great! I'll be happy to merge it!

valderman avatar Feb 17 '22 12:02 valderman

Development happens here. I'll create a pull request when I finish.

herberteuler avatar Feb 19 '22 06:02 herberteuler

An update: The json_extract function was causing troubles because it did not preserve JSON types in its results. However, SQLite >= 3.38.0 introduces the -> and ->> operators, which strive to be compatible with the PostgreSQL operators -> and ->>. I am currently working on trying these operators out.

herberteuler avatar Mar 09 '22 08:03 herberteuler

Okay, with the newest SQLite 3.38.0, and a similar implementation to that of selda-postgresql, the build on my personal branch passes all of the tests. But I am not yet able to produce a pull request. Things to cover before that:

  1. Wait and see how an issue would be resolved, which is blocking the upgrade of direct-sqlite's SQLite version.
  2. Upgrade direct-sqlite's embedded SQLite version to 3.38.0. I have forked a repository, and will create a pull request for that as soon as the above issue is resolved.
  3. Tidy the changes on my branch, and finally create a pull request here.

herberteuler avatar Mar 10 '22 11:03 herberteuler