fix: version bumping and Docker registry authentication #17

Merged
david merged 17 commits from fix/workflow-tag-exists into main 2026-04-01 05:03:16 +00:00
Showing only changes of commit 9980021037 - Show all commits
+16 -5
View File
@@ -1,6 +1,4 @@
import { PrismaClient } from '@prisma/client' import { PrismaClient } from '@prisma/client'
import { PrismaPg } from '@prisma/adapter-pg'
import pg from 'pg'
import dotenv from 'dotenv' import dotenv from 'dotenv'
// Load .env file if it exists // Load .env file if it exists
@@ -10,11 +8,24 @@ const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined prisma: PrismaClient | undefined
} }
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }) // Detect database provider from environment (default to sqlite for local development)
const databaseProvider = process.env.DATABASE_PROVIDER || 'sqlite'
// Create PrismaClient with adapter // Create PrismaClient with appropriate adapter
const createPrismaClient = () => { const createPrismaClient = () => {
const client = new PrismaClient({ adapter }) let client: PrismaClient
if (databaseProvider === 'postgresql') {
// Use PrismaPg adapter for PostgreSQL
const { PrismaPg } = require('@prisma/adapter-pg')
const pg = require('pg')
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
client = new PrismaClient({ adapter })
} else {
// No adapter needed for SQLite
client = new PrismaClient()
}
return client return client
} }