© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•3y ago•
10 replies
enalmada

parameterized insert and update

How does one do parameterized inserts and updates?

When I try and do something like this:
const preparedUpdate = db
    .update(TaskTable)
    .set({
        title: eq(TaskTable.id, sql.placeholder('title')),
    })
    .where(eq(TaskTable.id, sql.placeholder('id')))
    .returning()
    .prepare('Task.update');
const preparedUpdate = db
    .update(TaskTable)
    .set({
        title: eq(TaskTable.id, sql.placeholder('title')),
    })
    .where(eq(TaskTable.id, sql.placeholder('id')))
    .returning()
    .prepare('Task.update');


I get "expression is of type boolean" for all the columns.
ERR PostgresError: column "title" is of type status but expression is of type boolean
   ...
ERR PostgresError: column "title" is of type status but expression is of type boolean
   ...


Is there another syntax necessary for placeholder in set?

Thanks for your help.
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

Cannot update / insert default value
Drizzle TeamDTDrizzle Team / help
17mo ago
[solved] Parameterized Column Selection
Drizzle TeamDTDrizzle Team / help
3y ago
Using default values removes columns from insert and update types
Drizzle TeamDTDrizzle Team / help
2y ago
drizzle-zod insert/update schema refinements type
Drizzle TeamDTDrizzle Team / help
11mo ago