mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-02-13 15:15:45 +01:00
fix: resolve Prettier markdown code block parsing errors
- Fix syntax errors in skills markdown files (.github/skills, .opencode/skills) - Change typescript to tsx for code blocks with JSX - Replace ellipsis (...) in array examples with valid syntax - Separate CSS from TypeScript into distinct code blocks - Convert JavaScript object examples to valid JSON in docs - Fix enum definitions with proper comma separation
This commit is contained in:
@@ -6,21 +6,8 @@ declare const global: {
|
||||
prisma: PrismaClient | undefined;
|
||||
};
|
||||
|
||||
// Lazy-load createEnhancedPrismaClient to avoid build-time URL parsing
|
||||
const createPrismaClient = () => {
|
||||
// Use enhanced pooling in production or when explicitly enabled
|
||||
const useEnhancedPooling =
|
||||
process.env.NODE_ENV === "production" ||
|
||||
process.env.USE_ENHANCED_POOLING === "true";
|
||||
|
||||
if (useEnhancedPooling) {
|
||||
console.log("Using enhanced database connection pooling with PG adapter");
|
||||
// Dynamic import to defer URL parsing until runtime
|
||||
const { createEnhancedPrismaClient } = require("./database-pool");
|
||||
return createEnhancedPrismaClient();
|
||||
}
|
||||
|
||||
// Default Prisma client with basic configuration
|
||||
// Create standard Prisma client (no enhanced pooling at build time)
|
||||
const createPrismaClient = (): PrismaClient => {
|
||||
return new PrismaClient({
|
||||
log:
|
||||
process.env.NODE_ENV === "development"
|
||||
@@ -29,6 +16,13 @@ const createPrismaClient = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// Async factory for enhanced pooling (only call at runtime, not build time)
|
||||
export const createEnhancedClient = async (): Promise<PrismaClient> => {
|
||||
const { createEnhancedPrismaClient } = await import("./database-pool");
|
||||
console.log("Using enhanced database connection pooling with PG adapter");
|
||||
return createEnhancedPrismaClient();
|
||||
};
|
||||
|
||||
// Lazy initialization - only create when first accessed
|
||||
let _prisma: PrismaClient | undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user