Feedback for “Aws Data API”
How can i use this type of connection for drizzle studio and using drizzle-kit push
import { RDS } from "sst/node/rds";
const rdsClient = new RDSDataClient({
region: "ap-southeast-1",
});
export const db = drizzle(rdsClient, {
database: RDS.database.defaultDatabaseName,
secretArn: RDS.database.secretArn,
resourceArn: RDS.database.clusterArn,
schema,
});
since in drizzle.config.ts, it requires a connections string which i can't directly get from my connection type with Aws Data API.
Context: I am using SST and created my RDS with SST as well with:
const rds = new RDS(stack, "database", {
engine: "postgresql13.9",
defaultDatabaseName: "dbname",
});
I'm already able to connect, and do crud on my db, also was able to do migrations but programatically:
import { migrate } from "drizzle-orm/aws-data-api/pg/migrator";
import { db } from "../connection";
const main = async () => {
await migrate(db, { migrationsFolder: "drizzle" });
};
main().catch(console.error);
Is there any way I can use other drizzle-kit cli like studio, push, etc with AWS Data API?
Any updates/progress here?
My DB is provisioned using SST ion/v3, which does not expose username/password or the components of connectionString
This issue is still there in the latest version. There's no way to configure a region in drizzle config so we are unable to use any of the drizzle-kit commands. For example if we run drizzle-kit push we get the following error: Pulling schema from database...Error: Region is missing
@princejoogie Hey! This should help: Drizzle with SST