Skip to content

Commit

Permalink
Temporary fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciabad committed Oct 25, 2023
1 parent 18a4d5a commit 56aca72
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/server/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import 'server-only'
import { env } from '~/env.mjs'

import { drizzle as drizzleMysql } from 'drizzle-orm/mysql2'
import { drizzle as drizzlePlanetscale } from 'drizzle-orm/planetscale-serverless'
import {
PlanetScaleDatabase,
drizzle as drizzlePlanetscale,
} from 'drizzle-orm/planetscale-serverless'
import { connect } from '@planetscale/database'
import { createConnection } from 'mysql2'
import * as schema from './schema'

export const db =
env.USE_LOCAL_DB === 'true'
? drizzleMysql(
? (drizzleMysql(
createConnection({
host: '127.0.0.1',
user: 'root',
Expand All @@ -20,7 +23,7 @@ export const db =
schema,
mode: 'planetscale',
}
)
) as unknown as PlanetScaleDatabase<typeof schema>)
: drizzlePlanetscale(
connect({
host: env.DATABASE_HOST,
Expand Down

0 comments on commit 56aca72

Please sign in to comment.