Skip to content

Commit

Permalink
fix: generate correct table defintion for turso in lucia demo (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel3108 authored Feb 7, 2025
1 parent b7ce7aa commit 440e476
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-panthers-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'sv': patch
---

fix: generate correct table defintion for `turso` in `lucia` demo
7 changes: 4 additions & 3 deletions packages/addons/lucia/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import { addToDemoPage } from '../common.ts';
const TABLE_TYPE = {
mysql: 'mysqlTable',
postgresql: 'pgTable',
sqlite: 'sqliteTable'
sqlite: 'sqliteTable',
turso: 'sqliteTable'
};

type Dialect = 'mysql' | 'postgresql' | 'sqlite';
type Dialect = 'mysql' | 'postgresql' | 'sqlite' | 'turso';

let drizzleDialect: Dialect;
let schemaPath: string;
Expand Down Expand Up @@ -111,7 +112,7 @@ export default defineAddon({
throw new Error('unexpected shape of `user` or `session` table definition');
}

if (drizzleDialect === 'sqlite') {
if (drizzleDialect === 'sqlite' || drizzleDialect === 'turso') {
js.imports.addNamed(ast, 'drizzle-orm/sqlite-core', {
sqliteTable: 'sqliteTable',
text: 'text',
Expand Down

0 comments on commit 440e476

Please sign in to comment.