We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
drizzle-orm
^0.28.2
drizzle-kit
^0.19.12
This is a simple schema
import { timestamp, pgTable } from "drizzle-orm/pg-core"; export const test = pgTable("test",{ date:timestamp("date",{mode:"date"}).notNull() })
when i try to run this
async function main() { try { const res = await db.insert(test).values({ date:new Date(), }); console.log(res); } catch (error) { console.log(error); } } main()
I get this error
BadRequestException: Cannot parse date or time "2023-08-15T19:57:42.417Z" at de_BadRequestExceptionRes (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/client-rds-data/dist-cjs/protocols/Aws_restJson1.js:485:23) at de_ExecuteStatementCommandError (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/client-rds-data/dist-cjs/protocols/Aws_restJson1.js:390:25) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async eval (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js:9:32) at async eval (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js:15:28) at async eval (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@smithy/middleware-retry/dist-cjs/retryMiddleware.js:29:54) at async eval (webpack-internal:///(rsc)/../node_modules/.pnpm/@[email protected]/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:9:34) at async AwsDataApiPreparedQuery.values (webpack-internal:///(rsc)/../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/drizzle-orm/aws-data-api/pg/index.mjs:135:28) at async AwsDataApiPreparedQuery.execute (webpack-internal:///(rsc)/../node_modules/.pnpm/[email protected]_@[email protected]/node_modules/drizzle-orm/aws-data-api/pg/index.mjs:117:22) at async main (webpack-internal:///(rsc)/./db/index.ts:24:21) { '$fault': 'client', '$metadata': { httpStatusCode: 400, requestId: 'be13c96b-e262-477a-b286-0ba48cbdcffe', extendedRequestId: undefined, cfId: undefined, attempts: 1, totalRetryDelay: 0 } }
I am unable to parse a JS Date Object into Postgres compatable TimeStamp object
No response
The text was updated successfully, but these errors were encountered:
Having the same issue. We pass in the the proper javascript Date(), but it's not being passed correctly to RDS data.
Date()
Sorry, something went wrong.
There is a workaround for now , but still might lose your querying capabilities
https://medium.com/@anasmohammed361/implement-next-auth-auth-js-with-drizzle-adapter-aws-rds-postgres-15a8d148ec99
This is most likely closed by #1659
AndriiSherman
No branches or pull requests
What version of
drizzle-orm
are you using?^0.28.2
What version of
drizzle-kit
are you using?^0.19.12
Describe the Bug
This is a simple schema
when i try to run this
I get this error
I am unable to parse a JS Date Object into Postgres compatable TimeStamp object
Expected behavior
No response
Environment & setup
No response
The text was updated successfully, but these errors were encountered: