ReviewOS

also looking at this

stacks/bun-query-builder

fix(client)!: bind db.raw and db.sql fragment values or refuse them

#1152
Merged glennmichael123 wants to merge fix/db-sql-raw-bindings into main
16 files +455 -118
docs/guide/update.mdmodified+3-3
Changes to docs/guide/update.md
@@ -151,8 +151,8 @@ await db.transaction(async (trx) => {
151151await db
152152 .updateTable('users')
153153 .set({
154 login_count: sql`login_count + 1`,
155 last_login: sql`NOW()`
154 login_count: db.raw('login_count + 1'),
155 last_login: db.raw('CURRENT_TIMESTAMP')
156156 })
157157 .where({ id: userId })
158158 .execute()
@@ -165,7 +165,7 @@ await db
165165await db
166166 .updateTable('users')
167167 .set({
168 preferences: sql`JSON_SET(preferences, '$.theme', 'dark')`
168 preferences: db.raw("JSON_SET(preferences, '$.theme', 'dark')")
169169 })
170170 .where({ id: userId })
171171 .execute()