feat(db): support postgresql database (#3643)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
import type { InferSelectModel } from "drizzle-orm";
|
||||
|
||||
import { env } from "../env";
|
||||
import * as mysqlSchema from "./mysql";
|
||||
import * as pgSchema from "./postgresql";
|
||||
import * as sqliteSchema from "./sqlite";
|
||||
|
||||
export type PostgreSqlSchema = typeof pgSchema;
|
||||
export type MySqlSchema = typeof mysqlSchema;
|
||||
type Schema = typeof sqliteSchema;
|
||||
|
||||
const schema = process.env.DB_DRIVER === "mysql2" ? (mysqlSchema as unknown as Schema) : sqliteSchema;
|
||||
const schema =
|
||||
env.DB_DRIVER === "mysql2"
|
||||
? (mysqlSchema as unknown as Schema)
|
||||
: env.DB_DRIVER === "node-postgres"
|
||||
? (pgSchema as unknown as Schema)
|
||||
: sqliteSchema;
|
||||
|
||||
// Sadly we can't use export * from here as we have multiple possible exports
|
||||
export const {
|
||||
|
||||
Reference in New Issue
Block a user