@syncular/client 0.20.1 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/client.d.ts +6 -6
- package/dist/client.js +120 -34
- package/dist/encryption.d.ts +1 -1
- package/dist/encryption.js +36 -9
- package/dist/outbox.d.ts +8 -7
- package/dist/outbox.js +9 -10
- package/dist/outcomes.d.ts +6 -0
- package/dist/outcomes.js +2 -0
- package/dist/remote.js +40 -6
- package/dist/schema.d.ts +8 -0
- package/dist/schema.js +4 -1
- package/package.json +3 -3
- package/src/client.ts +147 -39
- package/src/encryption.ts +42 -11
- package/src/outbox.ts +25 -14
- package/src/outcomes.ts +14 -1
- package/src/remote.ts +54 -7
- package/src/schema.ts +7 -1
package/src/schema.ts
CHANGED
|
@@ -318,6 +318,9 @@ function createSyncedTable(
|
|
|
318
318
|
db: ClientDatabase,
|
|
319
319
|
table: CompiledClientTable,
|
|
320
320
|
): void {
|
|
321
|
+
// §6.11: a declared reference is deliberately NOT emitted here. Windowing
|
|
322
|
+
// evicts a parent independently of its children, so local SQLite never
|
|
323
|
+
// enforces a reference; the server enforces it.
|
|
321
324
|
const columns = table.columns.map((column) => {
|
|
322
325
|
const notNull = column.nullable ? '' : ' NOT NULL';
|
|
323
326
|
const pk = column.name === table.primaryKey ? ' PRIMARY KEY' : '';
|
|
@@ -716,7 +719,10 @@ export function normalizeRecordKeys(
|
|
|
716
719
|
* may surface integers as bigint. Anything else passes through untouched —
|
|
717
720
|
* the codec still fails loud on genuine type garbage at encode time.
|
|
718
721
|
*/
|
|
719
|
-
function coerceSqlRepresentation(
|
|
722
|
+
export function coerceSqlRepresentation(
|
|
723
|
+
column: RowColumn,
|
|
724
|
+
value: unknown,
|
|
725
|
+
): unknown {
|
|
720
726
|
switch (localColumnType(column)) {
|
|
721
727
|
case 'boolean':
|
|
722
728
|
return value === 0 ? false : value === 1 ? true : value;
|