Skip to main content
Version: 5.2

Configuration <D>

Index

Constructors

constructor

Properties

staticreadonlyDEFAULTS

DEFAULTS: { allowGlobalContext: boolean; autoJoinOneToOneOwner: boolean; baseDir: string; batchSize: number; cache: { adapter: typeof FileCacheAdapter; options: { cacheDir: string }; pretty: boolean }; connect: boolean; context: (name: string) => undefined | EntityManager<IDatabaseDriver<Connection>>; contextName: string; debug: boolean; discovery: { alwaysAnalyseProperties: boolean; disableDynamicFileAccess: boolean; requireEntitiesArray: boolean; warnWhenNoEntities: boolean }; driverOptions: {}; ensureIndexes: boolean; entities: never[]; entitiesTs: never[]; entityGenerator: { bidirectionalRelations: boolean; identifiedReferences: boolean }; filters: {}; findExactlyOneOrFailHandler: (entityName: string, where: Dictionary<any> | IPrimaryKeyValue) => NotFoundError<AnyEntity<any>>; findOneOrFailHandler: (entityName: string, where: Dictionary<any> | IPrimaryKeyValue) => NotFoundError<AnyEntity<any>>; flushMode: FlushMode; forceEntityConstructor: boolean; forceUndefined: boolean; forceUtcTimezone: boolean; highlighter: NullHighlighter; hydrator: typeof ObjectHydrator; loadStrategy: LoadStrategy; logger: (message?: any, ...optionalParams: any[]) => void; metadataProvider: typeof ReflectMetadataProvider; migrations: { allOrNothing: boolean; disableForeignKeys: boolean; dropTables: boolean; emit: string; fileName: (timestamp: string) => string; glob: string; path: string; safe: boolean; snapshot: boolean; tableName: string; transactional: boolean }; persistOnCreate: boolean; pool: {}; populateAfterFlush: boolean; populateWhere: PopulateHint; preferReadReplicas: boolean; propagateToOneOwner: boolean; resultCache: { adapter: typeof MemoryCacheAdapter; expiration: number; options: {} }; schemaGenerator: { createForeignKeyConstraints: boolean; disableForeignKeys: boolean; ignoreSchema: never[] }; seeder: { defaultSeeder: string; emit: string; fileName: (className: string) => string; glob: string; path: string }; strict: boolean; subscribers: never[]; validate: boolean; validateRequired: boolean; verbose: boolean } = ...

Type declaration

  • allowGlobalContext: boolean
  • autoJoinOneToOneOwner: boolean
  • baseDir: string
  • batchSize: number
  • cache: { adapter: typeof FileCacheAdapter; options: { cacheDir: string }; pretty: boolean }
    • adapter: typeof FileCacheAdapter
    • options: { cacheDir: string }
      • cacheDir: string
    • pretty: boolean
  • connect: boolean
  • context: (name: string) => undefined | EntityManager<IDatabaseDriver<Connection>>
  • contextName: string
  • debug: boolean
  • discovery: { alwaysAnalyseProperties: boolean; disableDynamicFileAccess: boolean; requireEntitiesArray: boolean; warnWhenNoEntities: boolean }
    • alwaysAnalyseProperties: boolean
    • disableDynamicFileAccess: boolean
    • requireEntitiesArray: boolean
    • warnWhenNoEntities: boolean
  • driverOptions: {}
    • ensureIndexes: boolean
    • entities: never[]
    • entitiesTs: never[]
    • entityGenerator: { bidirectionalRelations: boolean; identifiedReferences: boolean }
      • bidirectionalRelations: boolean
      • identifiedReferences: boolean
    • filters: {}
      • findExactlyOneOrFailHandler: (entityName: string, where: Dictionary<any> | IPrimaryKeyValue) => NotFoundError<AnyEntity<any>>
      • findOneOrFailHandler: (entityName: string, where: Dictionary<any> | IPrimaryKeyValue) => NotFoundError<AnyEntity<any>>
      • flushMode: FlushMode
      • forceEntityConstructor: boolean
      • forceUndefined: boolean
      • forceUtcTimezone: boolean
      • highlighter: NullHighlighter
      • hydrator: typeof ObjectHydrator
      • loadStrategy: LoadStrategy
      • logger: (message?: any, ...optionalParams: any[]) => void
          • (message?: any, ...optionalParams: any[]): void
          • Prints to stdout with newline. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values similar to printf(3) (the arguments are all passed to util.format()).

            const count = 5;
            console.log('count: %d', count);
            // Prints: count: 5, to stdout
            console.log('count:', count);
            // Prints: count: 5, to stdout

            See util.format() for more information.

            @since

            v0.1.100


            Parameters

            • optionalmessage: any
            • rest...optionalParams: any[]

            Returns void

      • metadataProvider: typeof ReflectMetadataProvider
      • migrations: { allOrNothing: boolean; disableForeignKeys: boolean; dropTables: boolean; emit: string; fileName: (timestamp: string) => string; glob: string; path: string; safe: boolean; snapshot: boolean; tableName: string; transactional: boolean }
        • allOrNothing: boolean
        • disableForeignKeys: boolean
        • dropTables: boolean
        • emit: string
        • fileName: (timestamp: string) => string
            • (timestamp: string): string
            • Parameters

              • timestamp: string

              Returns string

        • glob: string
        • path: string
        • safe: boolean
        • snapshot: boolean
        • tableName: string
        • transactional: boolean
      • persistOnCreate: boolean
      • pool: {}
        • populateAfterFlush: boolean
        • populateWhere: PopulateHint
        • preferReadReplicas: boolean
        • propagateToOneOwner: boolean
        • resultCache: { adapter: typeof MemoryCacheAdapter; expiration: number; options: {} }
        • schemaGenerator: { createForeignKeyConstraints: boolean; disableForeignKeys: boolean; ignoreSchema: never[] }
          • createForeignKeyConstraints: boolean
          • disableForeignKeys: boolean
          • ignoreSchema: never[]
        • seeder: { defaultSeeder: string; emit: string; fileName: (className: string) => string; glob: string; path: string }
          • defaultSeeder: string
          • emit: string
          • fileName: (className: string) => string
              • (className: string): string
              • Parameters

                • className: string

                Returns string

          • glob: string
          • path: string
        • strict: boolean
        • subscribers: never[]
        • validate: boolean
        • validateRequired: boolean
        • verbose: boolean

        staticreadonlyPLATFORMS

        PLATFORMS: { better-sqlite: { className: string; module: () => any }; mariadb: { className: string; module: () => any }; mongo: { className: string; module: () => any }; mysql: { className: string; module: () => any }; postgresql: { className: string; module: () => any }; sqlite: { className: string; module: () => any } } = ...

        Type declaration

        • better-sqlite: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        • mariadb: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        • mongo: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        • mysql: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        • postgresql: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        • sqlite: { className: string; module: () => any }
          • className: string
          • module: () => any
              • (): any
              • Returns any

        Methods

        get

        • get<T, U>(key: T, defaultValue?: U): U

        getAll

        getCacheAdapter

        getCachedService

        • getCachedService<T>(cls: T, ...args: ConstructorParameters<T>): InstanceType<T>
        • Creates instance of given service and caches it.


          Type parameters

          • T: new (...args: any[]) => InstanceType<T>

          Parameters

          • cls: T
          • rest...args: ConstructorParameters<T>

          Returns InstanceType<T>

        getClientUrl

        • getClientUrl(hidePassword?: boolean): string
        • Gets current client URL (connection string).


          Parameters

          • hidePassword: boolean = false

          Returns string

        getComparator

        getDriver

        • getDriver(): D
        • Gets current database driver instance.


          Returns D

        getHydrator

        • Gets instance of Hydrator. (cached)


          Parameters

          Returns IHydrator

        getLogger

        • Gets Logger instance.


          Returns Logger

        getMetadataProvider

        getNamingStrategy

        getRepositoryClass

        getResultCacheAdapter

        • Gets instance of CacheAdapter for result cache. (cached)


          Returns CacheAdapter

        reset

        • reset<T, U>(key: T): void

        resetServiceCache

        • resetServiceCache(): void
        • Returns void

        set

        • set<T, U>(key: T, value: U): void