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:
Sasha
2024-12-19 05:44:04 +02:00
committed by GitHub
parent 0e5bda9a74
commit 03ff77544e
10 changed files with 42 additions and 16 deletions

View File

@@ -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'