Skip to content

Commit ac935f5

Browse files
committed
add missing update check in drizzle
1 parent c208cd6 commit ac935f5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

testing/postgres-client-tests/drizzle/src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ async function main() {
3737
})
3838
.where(eq(usersTable.email, user.email));
3939
console.log('User info updated!')
40+
41+
// Verify the update
42+
const result = await db
43+
.select()
44+
.from(usersTable)
45+
.where(eq(usersTable.age, 31));
46+
console.log('Retrieved updated record:', result);
47+
48+
// Clean up
49+
await db.delete(usersTable).where(eq(usersTable.email, user.email));
50+
console.log('User deleted!')
4051
}
4152

4253
main();

testing/postgres-client-tests/postgres-client-tests.bats

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,6 @@ teardown() {
9797
run query_server -c "SELECT * FROM users" -t
9898
[ "$status" -eq 0 ]
9999

100+
# this inserts and updates row and check its updated result
100101
npx tsx src/index.ts
101102
}

0 commit comments

Comments
 (0)