Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Add Turso to drizzle adapter #1425

Closed
nevthereal opened this issue Feb 12, 2024 · 5 comments
Closed

[Feature Request]: Add Turso to drizzle adapter #1425

nevthereal opened this issue Feb 12, 2024 · 5 comments
Labels
feature request New feature requests

Comments

@nevthereal
Copy link

nevthereal commented Feb 12, 2024

Package

​@lucia-auth/adapter-drizzle

Description

So if I currently try to use libsql (Turso) with the Drizzle Adapter in my SvelteKit app, that doesn't work. Instead I need to use the libsql adapter, which throws a dependency conflict. In the docs the Drizzle Adapter is showcased with bettersqlite-3 but is there a way to implement Turso too, without the libsql adapter?

@nevthereal nevthereal added the feature request New feature requests label Feb 12, 2024
@pilcrowOnPaper
Copy link
Member

Can you share the full error? It should be fully compatible with the SQLite Drizzle

@nevthereal
Copy link
Author

This is the code:

import { DrizzleSQLiteAdapter } from '@lucia-auth/adapter-drizzle';
import { sessionTable, userTable } from '../db/schema';

export const adapter = new DrizzleSQLiteAdapter(client, sessionTable, userTable);

and this is the error:

Argument of type 'LibSQLDatabase<typeof import("/Users/nevillebrem/Developer/Projects/barmates-store/src/lib/server/db/schema")>' is not assignable to parameter of type 'BaseSQLiteDatabase<any, any, Record<string, never>, ExtractTablesWithRelations<Record<string, never>>>'.
  The types of '_.schema' are incompatible between these types.
    Type 'ExtractTablesWithRelations<typeof import("/Users/nevillebrem/Developer/Projects/barmates-store/src/lib/server/db/schema")> | undefined' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>> | undefined'.
      Type 'ExtractTablesWithRelations<typeof import("/Users/nevillebrem/Developer/Projects/barmates-store/src/lib/server/db/schema")>' is not assignable to type 'ExtractTablesWithRelations<Record<string, never>>'.
        Property 'userTable' is incompatible with index signature.
          Type '{ tsName: "userTable"; dbName: "users"; columns: { id: SQLiteColumn<{ name: "id"; tableName: "users"; dataType: "string"; columnType: "SQLiteText"; data: string; driverParam: string; notNull: true; hasDefault: false; enumValues: [...]; baseColumn: never; }, object>; ... 5 more ...; stripeId: SQLiteColumn<...>; }; re...' is not assignable to type '{ tsName: string; dbName: never; columns: never; relations: Record<string, Relation<string>>; primaryKey: AnyColumn[]; }'.
            Types of property 'dbName' are incompatible.
              Type 'string' is not assignable to type 'never'.
Screenshot 2024-02-12 at 16 59 58

@pilcrowOnPaper
Copy link
Member

Ah, thanks - I believe this is just a type issue when you initialize Drizzle ORM with a schema. It should work fine if you ignore the TS error, and if it does, can you open a new bug report for the type issue?

@pilcrowOnPaper
Copy link
Member

Yeah I believe this is related
#1426

@nevthereal
Copy link
Author

Ok, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature requests
Projects
None yet
Development

No branches or pull requests

2 participants