electric-sql / electric-sql/pglite

Live query: error: UNION types uuid and integer cannot be matched code: "42804"

Open
#233 3 comments 0 reactions 1 assignee Claimed by @msfstef View on GitHub
Dominant language
TypeScript
Stars
16k
Forks
442
Avg merge
20h 19m
Merged PRs (30d)
7

Description

Report from Discord:
https://discord.com/channels/933657521581858818/1273001835346657384

> Using PGlite in Bun I get error: UNION types uuid and integer cannot be matched code: "42804"

> My query:
```ts
pg.live.incrementalQuery(`select * from "public"."users";`, [], "id", () => {})
```

> My schema:
```ts
import { relations } from "drizzle-orm"
import { pgTable, text, timestamp, uuid } from "drizzle-orm/pg-core"

export const users = pgTable("users", {
id: uuid("id").notNull().primaryKey(),
createdAt: timestamp("created_at").notNull(),
updatedAt: timestamp("updated_at").notNull(),
})

export const posts = pgTable("posts", {
id: uuid("id").notNull().primaryKey(),
createdAt: timestamp("created_at").notNull(),
updatedAt: timestamp("updated_at").notNull(),
userId: uuid("user_id")
.notNull()
.references(() => users.id),
content: text("content").notNull(),
})

export const usersRelations = relations(users, ({ many }) => ({
posts: many(posts),
}))

export const postsRelations = relations(posts, ({ one }) => ({
user: one(users, {
fields: [posts.userId],
references: [users.id],
}),
}))
```

> Using the non-live query works:
```ts
pg.query(`select * from "public"."users";`)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.