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]: Inserting of string timestamps not working in data api #1932

Closed
livingforjesus opened this issue Feb 27, 2024 · 0 comments
Closed

[BUG]: Inserting of string timestamps not working in data api #1932

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

If you want to insert or update a record with a timestamp (mode:string)
You got an error which suggested that data api was recognizing it as a string not a timestamp

Inserting when a schema field is as follows:

updatedAt: timestamp('updated_at', { withTimezone: true, mode: 'string' }).notNull().defaultNow(),

A code like this doesn't work in rds data api:

await db.insert(usersTable).values({ name: 'John', updatedAt: new Date().toIsoString() })

Expected behavior

I expect the call to rds to actually work and not give out an error

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