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

Inheritable JSON schemas for result models #28

Open
azimov opened this issue May 10, 2023 · 0 comments
Open

Inheritable JSON schemas for result models #28

azimov opened this issue May 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@azimov
Copy link
Collaborator

azimov commented May 10, 2023

JSON Schemas will allow several more configurable options over the basic csv files that are currently used.

  • define indexes
  • Support SqlRender hinting for different platforms
  • define foreign keys
  • define views across multiple tables
  • Allow inheritance and or linking between schemas.
  • Allow significantly more specification and automatic type validation on table column types
  • List migrations in the schema as well as in the project tree
  • Very easy to do an object level diff between two schema versions to see what tables are added, altered or removed
  • Implementable in other languages in a consistent manner
  • Naturally provides an OpenAPI style specification which can be leveraged to produce RESTFUL web services with little to no code
  • More naturally provide a dplyr interface to tables that could be used as an alternative and compatible interface to dbplyr

Inheritance allows extendable models that can be used. For example we could have the cohort_diagnostics schema which extends the cohort_generator schema (using all of its tables).
Similarly, this would allow packages and reporting apps to extend existing packages.
For example, it may be desirable to add a diagnostic to CohortDiagnostics that adds a page into the shiny app as well as populating tables.

Steps

  • Define basic db object model in R (started)
  • Current table view (column_name, data_type, primary_key, empty_is_na) etc
  • Add foreign keys
  • Allow indexes (note that configuration on what index types are is highly platform specific)
  • Allow extension/dependencies on other schemas
  • Support for jsonvalidate package
@azimov azimov added the enhancement New feature or request label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant