henrik
henrik
Explore posts from servers
DTDrizzle Team
Created by henrik on 3/6/2024 in #help
`with` with insert
No description
5 replies
RRailway
Created by henrik on 12/1/2023 in #✋|help
Increase build timeout
Hi, I am trying to deploy a nextjs turborepo on Railway. The builds fail most of the time due to timeout (around 11 mins). Any ideas?
2 replies
DTDrizzle Team
Created by henrik on 11/24/2023 in #help
Drizzle Studio: Failed to fetch tables from database
Hello! I am struggling to connect to Drizzle Studio with my local postgres database: Failed to fetch tables from database TypeError: Cannot convert undefined or null to object
// drizzle.config.ts

import type { Config } from 'drizzle-kit'

if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL env var is not set')
}

export default {
schema: './src/lib/db/schema/index',
out: './drizzle',
driver: 'pg',
dbCredentials: {
connectionString: process.env.DATABASE_URL,
},
} satisfies Config
// drizzle.config.ts

import type { Config } from 'drizzle-kit'

if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL env var is not set')
}

export default {
schema: './src/lib/db/schema/index',
out: './drizzle',
driver: 'pg',
dbCredentials: {
connectionString: process.env.DATABASE_URL,
},
} satisfies Config
// src/lib/db/schema/index.ts

export * from './users'
export * from './products'
export * from './parameters'
export * from './relations'
// src/lib/db/schema/index.ts

export * from './users'
export * from './products'
export * from './parameters'
export * from './relations'
// src/lib/db/index.ts

import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'
import * as schema from './schema'

if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL env var is not set')
}

const queryClient = postgres(process.env.DATABASE_URL)
export const db = drizzle(queryClient, {
schema,
})
// src/lib/db/index.ts

import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'
import * as schema from './schema'

if (!process.env.DATABASE_URL) {
throw new Error('DATABASE_URL env var is not set')
}

const queryClient = postgres(process.env.DATABASE_URL)
export const db = drizzle(queryClient, {
schema,
})
Connecting via the query client works fine. Any help would be appreciated!
1 replies