softgrip
DTDrizzle Team
•Created by softgrip on 9/2/2023 in #help
In memory tests with libsql?
Is it that the connection doesn't stay open? I don't know 😦
4 replies
DTDrizzle Team
•Created by softgrip on 9/2/2023 in #help
In memory tests with libsql?
For reference:
This works
As does this (on turso)
However this does not work
And results in
.env
DATABASE_URL=file:local.db
.env
DATABASE_URL=file:local.db
.env.prod
DATABASE_URL=libsql://blahblahblah.turso.io
DATABASE_AUTH_TOKEN=asdfasdfasd
.env.prod
DATABASE_URL=libsql://blahblahblah.turso.io
DATABASE_AUTH_TOKEN=asdfasdfasd
.env.test
DATABASE_URL=file::memory:
.env.test
DATABASE_URL=file::memory:
FAIL src/lib/server/users/service.test.ts > userService test
LibsqlError: SQLITE_ERROR: no such table: __drizzle_migrations
❯ mapSqliteError node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:296:16
❯ executeStmt node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:213:15
❯ Sqlite3Client.execute node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:61:20
❯ PreparedQuery.values node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/libsql/session.ts:188:57
❯ LibSQLSession.values node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/sqlite-core/session.ts:124:85
❯ SQLiteAsyncDialect.migrate node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/sqlite-core/dialect.ts:674:38
❯ src/lib/server/users/service.test.ts:10:3
8| describe('userService test', () => {
9| beforeAll(async () => {
10| await migrate(db, { migrationsFolder: 'drizzle' });
| ^
11| });
12|
FAIL src/lib/server/users/service.test.ts > userService test
LibsqlError: SQLITE_ERROR: no such table: __drizzle_migrations
❯ mapSqliteError node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:296:16
❯ executeStmt node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:213:15
❯ Sqlite3Client.execute node_modules/.pnpm/@[email protected]/node_modules/@libsql/client/lib-esm/sqlite3.js:61:20
❯ PreparedQuery.values node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/libsql/session.ts:188:57
❯ LibSQLSession.values node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/sqlite-core/session.ts:124:85
❯ SQLiteAsyncDialect.migrate node_modules/.pnpm/[email protected]_@[email protected]/node_modules/src/sqlite-core/dialect.ts:674:38
❯ src/lib/server/users/service.test.ts:10:3
8| describe('userService test', () => {
9| beforeAll(async () => {
10| await migrate(db, { migrationsFolder: 'drizzle' });
| ^
11| });
12|
4 replies