beneidel
beneidel
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
thank you, let’s hope it makes it into next version. I moved on but happy to at least help test when ready
17 replies
DTDrizzle Team
Created by Mohammed Anas on 8/10/2023 in #help
Aws Rds with drizzle
(it unearthed a little bug with AWS RDS data api and deserializing array values, that I sent a little PR for https://github.com/drizzle-team/drizzle-orm/pull/1200 )
22 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
fixed on last version ❤️
17 replies
DTDrizzle Team
Created by Mohammed Anas on 8/10/2023 in #help
Aws Rds with drizzle
fixed on last version, thank you!!
22 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
I created this as github issue here: https://github.com/drizzle-team/drizzle-orm/issues/1164
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
using AWS Data API (maybe related to this specific driver)
17 replies
DTDrizzle Team
Created by Mohammed Anas on 8/10/2023 in #help
Aws Rds with drizzle
ps: I see from the above that you’re way ahead ❤️
22 replies
DTDrizzle Team
Created by Mohammed Anas on 8/10/2023 in #help
Aws Rds with drizzle
I monkeypatched this in my local env touching a line of code (shared how in the linked github issue), very nasty but happy to share if that helps troubleshooting
22 replies
DTDrizzle Team
Created by Mohammed Anas on 8/10/2023 in #help
Aws Rds with drizzle
22 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
oh thanks this is def a duplicate of that, thanks 👍
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
thanks, which version worked for you?
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
any workarounds? or a way I can help?
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
drizzle-orm version 0.27.2
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
ts
import { RDSDataClient } from '@aws-sdk/client-rds-data';
import { drizzle } from 'drizzle-orm/aws-data-api/pg';
import { migrate as migratePostgres } from 'drizzle-orm/aws-data-api/pg/migrator';
import { RDS } from 'sst/node/rds';

const rdsClient = new RDSDataClient({});

export const db = drizzle(rdsClient, {
database: RDS.Cluster.defaultDatabaseName,
secretArn: RDS.Cluster.secretArn,
resourceArn: RDS.Cluster.clusterArn,
logger: true,
});

export const migrate = async (path: string) => {
console.log('running migrations...');
await migratePostgres(db, { migrationsFolder: path });
console.log('migrations done.');
};
ts
import { RDSDataClient } from '@aws-sdk/client-rds-data';
import { drizzle } from 'drizzle-orm/aws-data-api/pg';
import { migrate as migratePostgres } from 'drizzle-orm/aws-data-api/pg/migrator';
import { RDS } from 'sst/node/rds';

const rdsClient = new RDSDataClient({});

export const db = drizzle(rdsClient, {
database: RDS.Cluster.defaultDatabaseName,
secretArn: RDS.Cluster.secretArn,
resourceArn: RDS.Cluster.clusterArn,
logger: true,
});

export const migrate = async (path: string) => {
console.log('running migrations...');
await migratePostgres(db, { migrationsFolder: path });
console.log('migrations done.');
};
17 replies
DTDrizzle Team
Created by beneidel on 8/19/2023 in #help
only first db migration runs
aws-data-api pg
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
nope, I just skipped that field bc it was a small pet project, but have no solution yet
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
"drizzle-orm": "^0.27.2",
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
the query (the updatedAt is the offending line, error goes away if I comment that one)
const result = await db
.insert(userTable)
.values(newUser)
.onConflictDoUpdate({
target: userTable.email,
set: {
...newUser,
email: undefined,
id: undefined,
updatedAt: new Date(),
updatedBy: newUser.updatedBy || newUser.createdBy,
},
where: eq(userTable.email, newUser.email),
})
.returning()
.execute();
const result = await db
.insert(userTable)
.values(newUser)
.onConflictDoUpdate({
target: userTable.email,
set: {
...newUser,
email: undefined,
id: undefined,
updatedAt: new Date(),
updatedBy: newUser.updatedBy || newUser.createdBy,
},
where: eq(userTable.email, newUser.email),
})
.returning()
.execute();
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
{
"name": "15",
"value": {
"stringValue": "Sat, 15 Jul 2023 06:51:54 GMT"
},
"typeHint": "TIMESTAMP"
}
,
{
"name": "15",
"value": {
"stringValue": "Sat, 15 Jul 2023 06:51:54 GMT"
},
"typeHint": "TIMESTAMP"
}
,
17 replies
DTDrizzle Team
Created by beneidel on 7/15/2023 in #help
"Cannot parse date or time" using AWS Data API, aurora postgres
turned the logger on, and effectively it shows this:
17 replies