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

Alco/send enum sql to satellite #1166

Closed
wants to merge 11 commits into from
Closed

Conversation

alco
Copy link
Member

@alco alco commented Apr 17, 2024

No description provided.

@alco alco force-pushed the alco/send-enum-sql-to-satellite branch from 7c88a1a to 7f78a02 Compare April 18, 2024 07:46
@alco
Copy link
Member Author

alco commented Apr 18, 2024

@kevin-dp One e2e test is failing because the client fails to create the enums table that the server sent to it. Here's the relevant client log from that test:

> await client.get_tables(db)
[
  { name: '_electric_oplog' },
  { name: 'sqlite_sequence' },
  { name: '_electric_meta' },
  { name: '_electric_migrations' },
  { name: '_electric_trigger_settings' },
  { name: '_electric_shadow' }
]

[proto] recv: #SatRelation{for: public.enums, as: 16813, cols: [id: text PK, c: color]}
[proto] recv: #SatOpLog{ops: [#Begin{lsn: MjU5MzY3NDQ=, ts: 1713427134792, isMigration: true}, #Migrate{vsn: 20230908, for: undefined, stmts: [-- CREATE TYPE "color" AS ENUM ('RED','GREEN','BLUE');\n]}, #Migrate{vsn: 20230908, for: enums, stmts: [CREATE TABLE "enums" (\n  "id" TEXT NOT NULL,\n  "c" TEXT,\n  CONSTRAINT "enums_pkey" PRIMARY KEY ("id")\n) WITHOUT ROWID;\n]}, #Commit{lsn: MjU5MzY3NDQ=}]}

> await client.get_tables(db)
[
  { name: '_electric_oplog' },
  { name: 'sqlite_sequence' },
  { name: '_electric_meta' },
  { name: '_electric_migrations' },
  { name: '_electric_trigger_settings' },
  { name: '_electric_shadow' }
]

> await client.syncTable(db, "enums")

[rpc] send: #SatSubsReq{id: 38cc67c1-8412-46af-9cdf-3fd8464aba77, shapes: [{"$type":"Electric.Satellite.SatShapeReq","requestId":"1f77d530-6cf9-46b4-8c0f-eacd66796a8f","shapeDefinition":{"$type":"Electric.Satellite.SatShapeDef","selects":[{"$type":"Electric.Satellite.SatShapeDef.Select","tablename":"enums","where":"","include":[]}]}}]}
[proto] send: #SatRpcRequest{method: subscribe, requestId: 3}
[proto] recv: #SatRpcResponse{method: subscribe, requestId: 3}
[rpc] recv: #SatSubsResp{id: 38cc67c1-8412-46af-9cdf-3fd8464aba77}
[proto] recv: #SatSubsDataBegin{id: 38cc67c1-8412-46af-9cdf-3fd8464aba77, lsn: MjU5Mzc0MjQ=}
[proto] recv: #SatShapeDataBegin{id: 1f77d530-6cf9-46b4-8c0f-eacd66796a8f}
[proto] recv: #SatOpLog{ops: [#Insert{for: 16813, tags: [postgres_1@1713427136236], new: ["row1", "RED"]}]}
[proto] recv: #SatShapeDataEnd{}
[proto] recv: #SatSubsDataEnd{}
encountered a subscription error: Error applying subscription data: no such table: main.enums
resetting client state
Connectivity state changed: disconnected

@alco alco closed this May 14, 2024
@alco alco deleted the alco/send-enum-sql-to-satellite branch May 14, 2024 12:31
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.

None yet

2 participants