PostgreSQL
PostgreSQL is a powerful, open-source relational database management system known for its advanced features, extensibility, and support for complex queries and large datasets. Read more here.
Example Usage
Make sure you have PostgreSQL installed and configured. Then, you can connect it straight into Better Query.
import { betterQuery } from "better-query";
import { Pool } from "pg";
export const query = betterQuery({
database: new Pool({
connectionString: "postgres://user:password@localhost:5432/database",
}),
});For more information, read Kysely's documentation to the PostgresDialect.
Schema generation & migration
The Better Query CLI allows you to generate or migrate your database schema based on your Better Query configuration and plugins.
PostgreSQL Schema Generation | PostgreSQL Schema Migration |
|---|---|
| ✅ Supported | ✅ Supported |
npx @better-query/cli@latest generatenpx @better-query/cli@latest migrateAdditional Information
PostgreSQL is supported under the hood via the Kysely adapter, any database supported by Kysely would also be supported. (Read more here)
If you're looking for performance improvements or tips, take a look at our guide to performance optimizations.