# Function db

- db<TSchema extends Record<string, unknown> = Record<string, never>>(
  config?: DatabaseFactoryConfig<TSchema>,
  ): DatabaseProvider<BetterSQLite3Database<TSchema> & RawAccess>

  #### Type Parameters

  - TSchema extends Record<string, unknown> = Record<string, never>

  #### Parameters

  - `Optional` config: DatabaseFactoryConfig<TSchema>

  #### Returns DatabaseProvider<BetterSQLite3Database<TSchema> & RawAccess>

  - Defined in rivetkit-typescript/packages/db/src/drizzle/mod.ts:37