sonar icon indicating copy to clipboard operation
sonar copied to clipboard

Tracking issue for new Schema API

Open Frando opened this issue 6 years ago • 1 comments

A tracking issue for the new Schema API.

High-level overview:

  • Add a schema module in sonar-common that is available to both the client and the schema
  • In the server, the core queries the island for all schemas, adds additional schemas defined in source code, and adds them to the schema module
  • In the client, when opening an island, the client asks the server for all schemas and adds to its instance of the schema module
  • The schema module exposes functions to decompose and map a record
    • decompose(record) returns an array of all (field, value) tuples of the record, with the field schema readily available (containing type, indexing properties, metadata)
    • validate(record) validate a record against its schema
    • map(record, targetSchema) try to map a record onto a targetSchema
  • The schema module might also need some ways to work with out CRDT - or at least a way to decompose/reduce a list of records with the same ID onto a target schema
  • We'll also want to revisit our schema definition. Internally, we'll want to define a format we own for the schema definition.
    • import/export from/to JSON schema
    • import/export into a more-simple toml

Frando avatar Apr 24 '20 12:04 Frando

This is mostly done. Documentation is mostly still missing though.

Frando avatar Mar 11 '21 11:03 Frando