© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
4 replies
Dayblox

prepared statements placeholder typing

Schema
const users = sqliteTable("user", {
  id: text("id").primaryKey(),
  text: text("text"),
})
const users = sqliteTable("user", {
  id: text("id").primaryKey(),
  text: text("text"),
})

const updateUser = db
  .update(users)
  .set({ text: sql.placeholder("text") })
  .where(eq(users.id, sql.placeholder("id")))
  .prepare()
const updateUser = db
  .update(users)
  .set({ text: sql.placeholder("text") })
  .where(eq(users.id, sql.placeholder("id")))
  .prepare()

On the text property I get the following
Type 'Placeholder<"text", any>' is not assignable to type 'string | SQL<unknown> | null | undefined'.
Type 'Placeholder<"text", any>' is not assignable to type 'string | SQL<unknown> | null | undefined'.

The issue only seems to occur in the
set
set
part, is there a reason? A better way?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Prepared Update statements
Drizzle TeamDTDrizzle Team / help
3y ago
Prepared statements with TRPC
Drizzle TeamDTDrizzle Team / help
3y ago
BUG: Prepared statements with placeholder values .execute() not working on postgres
Drizzle TeamDTDrizzle Team / help
3y ago
[Postgres] prepared with inArray & placeholder
Drizzle TeamDTDrizzle Team / help
3y ago