datajoint-python icon indicating copy to clipboard operation
datajoint-python copied to clipboard

Add `json` data type

Open guzman-raphael opened this issue 3 years ago • 0 comments
trafficstars

  • Add support for json type. Useful doc on querying with JSON_VALUE.
    • [x] insert
    • [x] fetch
    • [x] projection
    • [x] querying
    • [x] indexing
    • [x] describe
    • [ ] documentation
  • Proposing here that we should only support json type in MySQL >=8.0 since JSON_VALUE approach is quite useful in returning with specific types, however, it was introduced in 8.x.
  • Implement using MySQL's approach since it should be compatible with Percona as well. Though there is similar functionality in MariaDB, they've chosen to use json as an alias for longtext + check constraint using JSON_VALID. Due to how different the implementations are, MariaDB won't be supported in our implementation of json type.
  • Full fetch is supported and partial fetches can be performed by projecting first (since a proper attribute name should be set).
  • From MySQL docs, looks like the size upper limit is the same as longblob (i.e. 4GB) per value.
  • Other items:
    • [x] Replace prints with logs
    • [x] table.progress() defaults to no display
    • [x] table.describe() defaults to no display
    • [x] Optimize database healthcheck in tests
    • [x] Fix bug in test_drop test
    • [x] Bump version to 0.14.0
  • ~~Known gaps:~~
    • ~~support for creating indexes. It is possible but there is more needed work to make it compatible with describe().~~

Depends on #1052

guzman-raphael avatar Sep 10 '22 16:09 guzman-raphael