Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Querying tables with timestamp field in where query not working in aws data api #1934

Closed
livingforjesus opened this issue Feb 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@livingforjesus
Copy link
Contributor

What version of drizzle-orm are you using?

0.29.3

What version of drizzle-kit are you using?

0.19.13

Describe the Bug

in queries

When making select queries, in where statements if there is a clause that
includes a timestamp field(with timestamps with mode:string), you get an error like

ERROR: operator does not exist: timestamp without time zone >= text; Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

This is because the data api is treating the string timestamp as a text not a string.
So in code like:

const [newUser] = await db.insert(usersTable).values({ name: 'John' }).returning()
const [result] = await db.select().from(usersTable).where(and(eq(usersTable.id, newUser!.id), gte(usersTable.updatedAt, newUser!.updatedAt)))

The select statement doesn't work

Expected behavior

The query should work

Environment & setup

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants