Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BetterSqliteConnectionOptions

BetterSqlite-specific connection options.

Hierarchy

  • BaseConnectionOptions
    • BetterSqliteConnectionOptions

Index

Properties

Optional Readonly cache

cache: boolean | { alwaysEnabled?: boolean; duration?: number; options?: any; provider?: (connection: Connection) => QueryResultCache; tableName?: string; type?: "database" | "redis" | "ioredis" | "ioredis/cluster" }

Allows to setup cache options.

Optional Readonly cli

cli: { entitiesDir?: string; migrationsDir?: string; subscribersDir?: string }

CLI settings.

Type declaration

  • Optional Readonly entitiesDir?: string

    Directory where entities should be created by default.

  • Optional Readonly migrationsDir?: string

    Directory where migrations should be created by default.

  • Optional Readonly subscribersDir?: string

    Directory where subscribers should be created by default.

Optional Readonly customOptions

customOptions: BetterSqliteOptions

Log function

Readonly database

database: string

Storage type or path to the storage.

Optional Readonly dropSchema

dropSchema: boolean

Drops the schema each time connection is being established. Be careful with this option and don't use this in production - otherwise you'll lose all production data. This option is useful during debug and development.

Optional Readonly entities

entities: (string | Function | EntitySchema<any>)[]

Entities to be loaded for this connection. Accepts both entity classes and directories where from entities need to be loaded. Directories support glob patterns.

Optional Readonly entityPrefix

entityPrefix: string

Prefix to use on all tables (collections) of this connection in the database.

Optional Readonly extra

extra: any

Extra connection options to be passed to the underlying driver.

todo: deprecate this and move all database-specific types into hts own connection options object.

Optional Readonly logger

logger: "advanced-console" | "simple-console" | "file" | "debug" | Logger

Logger instance used to log queries and events in the ORM.

Optional Readonly logging

logging: LoggerOptions

Logging options.

Optional Readonly maxQueryExecutionTime

maxQueryExecutionTime: number

Maximum number of milliseconds query should be executed before logger log a warning.

Optional Readonly migrations

migrations: (string | Function)[]

Migrations to be loaded for this connection. Accepts both migration classes and directories where from migrations need to be loaded. Directories support glob patterns.

Optional Readonly migrationsRun

migrationsRun: boolean

Indicates if migrations should be auto run on every application launch. Alternative to it, you can use CLI and run migrations:run command.

Optional Readonly migrationsTableName

migrationsTableName: string

Migrations table name, in case of different name from "migrations". Accepts single string name.

Optional Readonly migrationsTransactionMode

migrationsTransactionMode: "all" | "none" | "each"

Transaction mode for migrations to run in

Optional Readonly name

name: string

Connection name. If connection name is not given then it will be called "default". Different connections must have different names.

Optional Readonly namingStrategy

namingStrategy: NamingStrategyInterface

Naming strategy to be used to name tables and columns in the database.

Optional Readonly pragma

pragma: string[]

Pragma directives

Optional Readonly subscribers

subscribers: (string | Function)[]

Subscribers to be loaded for this connection. Accepts both subscriber classes and directories where from subscribers need to be loaded. Directories support glob patterns.

Optional Readonly synchronize

synchronize: boolean

Indicates if database schema should be auto created on every application launch. Be careful with this option and don't use this in production - otherwise you can lose production data. This option is useful during debug and development. Alternative to it, you can use CLI and run schema:sync command.

Note that for MongoDB database it does not create schema, because MongoDB is schemaless. Instead, it syncs just by creating indices.

Readonly type

type: "sqlite"

Database type.