Angel
DTDrizzle Team
•Created by piscopancer on 6/4/2024 in #help
need postgres explanation
Moving from SQLite to PostgreSQL involves a few changes, mainly because SQLite is a serverless database, while PostgreSQL requires a running server. Here’s a breakdown of what you need to know and do:
SQLite: Stores the entire database in a single file (e.g., local.db), which can be easily accessed and managed without needing a separate server. With SQLite you need a minimal setup, the SQLite library and a local file like {localdb} to use it
PostgreSQL: Requires a running server to manage databases. The data is stored in a more complex file structure managed by the server itself. Needs a server either local (you can install it) or with a remote provider like AWS, Heroku, ...
3 replies
DTDrizzle Team
•Created by pato on 6/4/2024 in #help
Queries require "await"?
Database actions are asynchronous processes. If you need to use the results of these actions, you must use await to ensure the promises are resolved. If you don't need the results, ensure that all promises are resolved before the execution completes to avoid potential issues, like not executing the update. The most efficient way to do this is by using Promise.all, which waits for all promises to be resolved without blocking the event loop.
3 replies
DTDrizzle Team
•Created by JJZFIVE on 5/26/2024 in #help
How to put Drizzle schemas in shared folder (monorepo) and have api's drizzle.config recognize them
I have a similar monorepo structure, with each database definition in different services.
My config looks like this:
import { defineConfig } from "drizzle-kit";
export default defineConfig({
driver: "aws-data-api",
dialect: "postgresql",
dbCredentials: {
database: Something,
secretArn: Something,
resourceArn: Something,
},
// Pick up all our schema files
schema: ["./packages/**/*.sql.ts"],
out: "./packages/core/migrations",
});
And is working like a charm.5 replies
DTDrizzle Team
•Created by PGeyer on 5/27/2024 in #help
Casting column to enum type
If anyone has been able to solve that, can just post how?
7 replies
DTDrizzle Team
•Created by PGeyer on 5/27/2024 in #help
Casting column to enum type
Not sure if it is related,
But it could be:
https://discord.com/channels/1043890932593987624/1120919676457848946/1120919676457848946
For myself i stop using pgEnum with AWS Data API, and use just text strings and control the enums in my code validation.
7 replies