I am currently using ULIDs for pretty much every table identifier in my database. My project uses Drizzle ORM and PostgreSQL. When adding a default value to column id in sessions table, the following typescript error is generated:
The sessions table has the following structure:
To solve the error, it should be sufficient to just insert hasDefault: boolean; instead of hasDefault: false; in property id of type PostgreSQLSessionTable.
Note: the affected package is @lucia-auth/adapter-drizzle
This is intended. Lucia does not support database generated values since it needs to know the created session ID and not all databases (e.g MySQL) return the generated ID when inserting.
Package
lucia
Describe the bug
I am currently using ULIDs for pretty much every table identifier in my database. My project uses Drizzle ORM and PostgreSQL. When adding a default value to column id in sessions table, the following typescript error is generated:![image](https://github.com/lucia-auth/lucia/assets/5411351/68ac4eed-ae11-4395-af9c-05bab83845df)
The sessions table has the following structure:![image](https://github.com/lucia-auth/lucia/assets/5411351/dddd525b-e01e-452c-a784-adfae39911a2)
To solve the error, it should be sufficient to just insert
hasDefault: boolean;
instead ofhasDefault: false;
in propertyid
of typePostgreSQLSessionTable
.Note: the affected package is @lucia-auth/adapter-drizzle