Skip to content

Update select to allow dot syntax on filters, and possibly spans and sort #27

@cblanquera

Description

@cblanquera

Describe the feature you'd like to request

In the generate model store class or model action, we should be able to specify JSON column key names using dot syntax in filter, and possibly span and sort query inputs.

Describe the solution you'd like

Basic filter syntax example:

 filter[references.fbid]=abc123

Should be able to access deep nested keys like the following example:

filter[data.user.name]=john

Should be able to access arrays like the following example:

filter[tags.0]=article

Should be able to filter by many items in an array like the following example:

filter[tags][]=home&filter[tags][]=work

Should be able to access deep object/arrays like the following example:

filter[chess.board.2.3.white]=pawn

Other query inputs like span and sort should also accept the above examples as well (as it may apply)

Describe alternatives you've considered

  • Some DBs like SQLite don’t support JSON columns. In this case we just ignore these kind of filters
  • Implementation of JSON columns differ between MySQL and Postgres
  • Need to check the dialect name (from @stackpress/inquire) for DB type engine.dialect.name and write solution per type

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions