@appurist/offlinedb 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/sql.js +2 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appurist/offlinedb",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Browser-first offline table client for Neon Auth and Postgres RLS.",
6
6
  "exports": {
package/src/sql.js CHANGED
@@ -63,12 +63,11 @@ BEGIN
63
63
  next_owner_id := NEW.owner_id;
64
64
  next_revision := NEW.revision;
65
65
  next_key := NEW.id::TEXT;
66
- next_payload := to_jsonb(NEW);
66
+ next_payload := to_jsonb(NEW) - 'global_id';
67
67
  next_local_id := NEW.local_id;
68
68
  END IF;
69
69
 
70
70
  INSERT INTO ${qualified(schema, "global_mutation")} (
71
- global_id,
72
71
  table_name,
73
72
  row_key,
74
73
  owner_id,
@@ -78,7 +77,6 @@ BEGIN
78
77
  row_data
79
78
  )
80
79
  VALUES (
81
- CASE WHEN TG_OP = 'DELETE' THEN OLD.global_id ELSE NEW.global_id END,
82
80
  TG_TABLE_NAME,
83
81
  next_key,
84
82
  next_owner_id,
@@ -331,5 +329,5 @@ function quoteText(value) {
331
329
 
332
330
  function qualified(schema, name) {
333
331
  return `${quoteIdentifier(schema)}.${quoteIdentifier(name)}`;
334
- }
332
+ }
335
333