Luiz Benevenuto
Luiz Benevenuto
DTDrizzle Team
Created by Luiz Benevenuto on 11/4/2023 in #help
Studio when using Turso `Error: Cannot find module 'better-sqlite3'`
Nope, it is not a bun issue. It does not work even with npm or pnpm
7 replies
DTDrizzle Team
Created by Luiz Benevenuto on 11/4/2023 in #help
Studio when using Turso `Error: Cannot find module 'better-sqlite3'`
And this is my setup
import * as schema from '$lib/database/schema';
import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client/web';
import { DATABASE_URL, DATABASE_AUTH_TOKEN, ENABLE_DRIZZLE_LOGGER } from '$env/static/private';
import { dev } from '$app/environment';

export const client = createClient({ url: DATABASE_URL, authToken: DATABASE_AUTH_TOKEN });

export const db = drizzle(client, {
schema,
logger: ENABLE_DRIZZLE_LOGGER ? Boolean(ENABLE_DRIZZLE_LOGGER) : dev
});
import * as schema from '$lib/database/schema';
import { drizzle } from 'drizzle-orm/libsql';
import { createClient } from '@libsql/client/web';
import { DATABASE_URL, DATABASE_AUTH_TOKEN, ENABLE_DRIZZLE_LOGGER } from '$env/static/private';
import { dev } from '$app/environment';

export const client = createClient({ url: DATABASE_URL, authToken: DATABASE_AUTH_TOKEN });

export const db = drizzle(client, {
schema,
logger: ENABLE_DRIZZLE_LOGGER ? Boolean(ENABLE_DRIZZLE_LOGGER) : dev
});
7 replies
DTDrizzle Team
Created by Luiz Benevenuto on 11/4/2023 in #help
Studio when using Turso `Error: Cannot find module 'better-sqlite3'`
This is my config
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

dotenv.config()

export default {
schema: './src/lib/database/schema/*',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.DATABASE_URL ?? '',
authToken: process.env.DATABASE_AUTH_TOKEN ?? ''
},
verbose: true
} satisfies Config
import type { Config } from 'drizzle-kit'
import * as dotenv from 'dotenv'

dotenv.config()

export default {
schema: './src/lib/database/schema/*',
out: './migrations',
driver: 'turso',
dbCredentials: {
url: process.env.DATABASE_URL ?? '',
authToken: process.env.DATABASE_AUTH_TOKEN ?? ''
},
verbose: true
} satisfies Config
7 replies
DTDrizzle Team
Created by Luiz Benevenuto on 9/2/2023 in #help
Turso with Cloudflare Pages
Do we have any news?
2 replies