@types/knex-db-manager
TypeScript icon, indicating that this package has built-in type declarations

0.7.3 • Public • Published

Installation

npm install --save @types/knex-db-manager

Summary

This package contains type definitions for knex-db-manager (https://github.com/Vincit/knex-db-manager#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/knex-db-manager.

index.d.ts

import { Knex } from "knex";

export interface KnexDbManager {
    createDbOwnerIfNotExist(): Promise<void>;
    updateIdSequences(): Promise<void>;
    createDb(dbName?: string): Promise<void>;
    dropDb(dbName?: string): Promise<void>;
    migrateDb(): Promise<void>;
    close(): Promise<void>;
    closeKnex(): Promise<void>;
    dbVersion(): Promise<string>;
    populateDb(glob?: string): Promise<void>;
    copyDb(fromDbName?: string, toDbName?: string): Promise<void>;
    truncateDb(ignoreTables?: string[]): Promise<void>;

    // Warning: We actually just want the Knex interface, but it's not exported in the current version of `knex`
    // Updating to a newer version of `knex` is also problematic since older version of Typescript throw errors
    // The current solution extracts the Knex interface from the Seeder constructor
    knexInstance(): ConstructorParameters<typeof Knex.Seeder>[0];
}

export interface DbManagerConfig {
    collate?: string[] | undefined;
    superUser?: string | undefined;
    superPassword?: string | undefined;
    populatePathPattern?: string | undefined;
}

export interface DbManagerFactoryConfig {
    knex: Knex.Config | string;
    dbManager: DbManagerConfig;
}

export function databaseManagerFactory(config: DbManagerFactoryConfig): KnexDbManager;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/node, knex

Credits

These definitions were written by Dmitrii Solovev, and Nicusor Chiciuc.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/knex-db-manager

Weekly Downloads

1,477

Version

0.7.3

License

MIT

Unpacked Size

5.57 kB

Total Files

5

Last publish

Collaborators

  • types