Skip to main content
Module

x/typeorm/src/connection/BaseConnectionOptions.ts>BaseConnectionOptions

Forked from https://github.com/typeorm/typeorm
Latest
interface BaseConnectionOptions
import { type BaseConnectionOptions } from "https://deno.land/x/typeorm@v0.2.23-rc10/src/connection/BaseConnectionOptions.ts";

BaseConnectionOptions is set of connection options shared by all database types.

Properties

readonly
type: DatabaseType

Database type. This value is required.

readonly
optional
name: string

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

readonly
optional
entities: ((Function | string | 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.

readonly
optional
subscribers: (Function | string)[]

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

readonly
optional
migrations: (Function | string)[]

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

readonly
optional
migrationsTableName: string

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

readonly
optional
migrationsTransactionMode: "all" | "none" | "each"

Transaction mode for migrations to run in

readonly
optional
namingStrategy: NamingStrategyInterface

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

readonly
optional
logging: LoggerOptions

Logging options.

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

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

readonly
optional
maxQueryExecutionTime: number

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

readonly
optional
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
optional
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.

readonly
optional
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.

readonly
optional
entityPrefix: string

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

readonly
optional
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.

readonly
optional
cache: boolean | { readonly type?:
| "database"
| "redis"
| "ioredis"
| "ioredis/cluster"
; readonly tableName?: string; readonly options?: any; readonly alwaysEnabled?: boolean; readonly duration?: number; }

Allows to setup cache options.

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

CLI settings.