feat(db-sqlite): add idType: 'uuid' support (#10016)
Adds `idType: 'uuid'` to the SQLite adapter support:
```ts
sqliteAdapter({
idType: 'uuid',
})
```
Achieved through Drizzle's `$defaultFn()`
https://orm.drizzle.team/docs/latest-releases/drizzle-orm-v0283#-added-defaultfn--default-methods-to-column-builders
as SQLite doesn't have native UUID support. Added `sqlite-uuid` to CI.
This commit is contained in:
@@ -53,6 +53,15 @@ export const allDatabaseAdapters = {
|
||||
url: process.env.SQLITE_URL || 'file:./payloadtests.db',
|
||||
},
|
||||
})`,
|
||||
'sqlite-uuid': `
|
||||
import { sqliteAdapter } from '@payloadcms/db-sqlite'
|
||||
|
||||
export const databaseAdapter = sqliteAdapter({
|
||||
idType: 'uuid',
|
||||
client: {
|
||||
url: process.env.SQLITE_URL || 'file:./payloadtests.db',
|
||||
},
|
||||
})`,
|
||||
supabase: `
|
||||
import { postgresAdapter } from '@payloadcms/db-postgres'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user