Skip to content

💥 Comply with sharedb spec #24

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

Merged
merged 1 commit into from
Jun 25, 2024
Merged

💥 Comply with sharedb spec #24

merged 1 commit into from
Jun 25, 2024

Conversation

alecgibson
Copy link
Collaborator

@alecgibson alecgibson commented Jun 7, 2024

This is a BREAKING change that:

  • adds tests against the upstream sharedb DB test suite
  • adds a CI build for the tests against current Node.js and Postgres versions
  • breaks the API to conform to the upstream tests, including adding metadata support

The breaks are:

  • Dropping non-null constraints on snapshots.doc_type and snapshots.data (to allow Docs to be deleted)
  • Adding a new snapshots.metadata json column
  • Respecting options.metadata and fields.$submit, which were previously ignored on getOps(), and useless on getSnapshot() (which didn't store metadata)
  • snapshot.m is now undefined if not present, or null if unrequested (inline with the spec)

On top of this it also makes some bugfixes to conform to the spec:

  • Ignore unique key validations when committing, since this may happen during concurrent commits
  • JSON.stringify() JSON fields, which break if passed a raw array
  • Default from = 0 if unset in getOps()

@alecgibson alecgibson force-pushed the setup-ci branch 3 times, most recently from 85d1a10 to 9240653 Compare June 7, 2024 16:05
@alecgibson alecgibson changed the title 👷‍♀️ Add CI build 💥 Comply with sharedb spec Jun 7, 2024
@alecgibson alecgibson force-pushed the setup-ci branch 8 times, most recently from 48f1221 to 7e11116 Compare June 10, 2024 15:47
@alecgibson alecgibson mentioned this pull request Jun 12, 2024
@alecgibson alecgibson force-pushed the setup-ci branch 2 times, most recently from 1f3774c to 6e3eb2d Compare June 12, 2024 14:38
@alecgibson alecgibson marked this pull request as ready for review June 12, 2024 14:38
This is a **BREAKING** change that:

 - adds tests against the [upstream `sharedb` DB test suite][1]
 - adds a CI build for the tests against current Node.js and Postgres
   versions
 - breaks the API to conform to the upstream tests, including adding
   metadata support

The breaks are:

 - Dropping non-null constraints on `snapshots.doc_type` and
   `snapshots.data` (to allow `Doc`s to be deleted)
 - Adding a new `snapshots.metadata` `json` column
 - Respecting `options.metadata` and `fields.$submit`, which were
   previously ignored on `getOps()`, and useless on `getSnapshot()`
   (which didn't store metadata)
 - `snapshot.m` is now `undefined` if not present, or `null` if
   unrequested (inline with the spec)

On top of this it also makes some bugfixes to conform to the spec:

 - Ignore unique key validations when committing, since this may happen
   during concurrent commits
 - `JSON.stringify()` JSON fields, which [break][2] if passed a raw
   array
 - Default `from = 0` if unset in `getOps()`

[1]: https://github.com/share/sharedb/blob/7abe65049add9b58e1df638aa34e7ca2c0a1fcfa/test/db.js#L25
[2]: brianc/node-postgres#442
@alecgibson alecgibson merged commit 5a5fd6d into main Jun 25, 2024
24 checks passed
@alecgibson alecgibson deleted the setup-ci branch June 25, 2024 16:10
This was referenced Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants