You can access the database name from `sanitizedConfig.db.name`. But currently, it' not possible to access the db name from the unsanitized config. Plugins only have access to the unsanitized config. This change allows db adapters to return the db name early, which will allow plugins to conditionally initialize db-specific functionality
Payload SQLite Adapter
Official SQLite adapter for Payload.
Installation
npm install @payloadcms/db-sqlite
Usage
import { buildConfig } from 'payload/config'
import { sqliteAdapter } from '@payloadcms/db-sqlite'
export default buildConfig({
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI,
},
}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.