-
We are migrating from knex to drizzle and we are facing the error in title. We deploying the application in Digital Ocean and database is also if a postgres from Digital Ocean. Following is the config we have been using for a year. import { Knex } from 'knex'
import { env } from './src/utils/envalid'
import knexStringcase from 'knex-stringcase'
export default knexStringcase({
client: env.APP_DB_CLIENT,
connection: {
host: env.APP_DB_HOST,
database: env.APP_DB_NAME,
user: env.APP_DB_USER,
password: env.APP_DB_PASSWORD,
port: env.APP_DB_PORT,
ssl:
env.NODE_ENV === 'production'
? { rejectUnauthorized: false, sslmode: 'require' }
: false,
},
pool: {
min: 2,
max: 10,
},
migrations: {
tableName: 'knex_migrations',
directory: './db/migrations',
},
seeds: {
directory: ['./db/seeds'].concat(
env.NODE_ENV === 'development' ? ['./db/seeds/dev/'] : []
),
},
} as Knex.Config) Following is the drizzle config we are using. Note that we are using knex and drizzle at the same time right now until we complete the migration. import { defineConfig } from 'drizzle-kit'
import { env } from './src/utils/envalid'
export default defineConfig({
out: './src/drizzle',
dialect: 'postgresql',
schema: './src/drizzle/schema.ts',
dbCredentials: {
host: env.APP_DB_HOST,
database: env.APP_DB_NAME,
user: env.APP_DB_USER,
password: env.APP_DB_PASSWORD,
port: env.APP_DB_PORT,
ssl: env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false,
},
verbose: env.NODE_ENV === 'development',
}) However, this will result in following error,
What would be the equivalent in drizzle?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Bruh. I've been debugging this for hours. |
Beta Was this translation helpful? Give feedback.
Bruh. I've been debugging this for hours.
drizzle.config.ts
is for drizzle-kit and the there is the config passed todrizzle()
function to create the db for the application andssl: { rejectUnauthorized: false }
worked