0.7.3 • Published 2 years ago

@types/knex-db-manager v0.7.3

Weekly downloads
691
License
MIT
Repository
github
Last release
2 years ago

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

// Type definitions for knex-db-manager 0.6
// Project: https://github.com/Vincit/knex-db-manager#readme
// Definitions by: Dmitrii Solovev <https://github.com/dimonnwc3>
//                 Nicusor Chiciuc <https://github.com/nicu-chiciuc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Seeder, Config } 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 Seeder>[0];
}

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

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

export function databaseManagerFactory(config: DbManagerFactoryConfig): KnexDbManager;

Additional Details

  • Last updated: Tue, 23 Nov 2021 11:01:05 GMT
  • Dependencies: @types/knex
  • Global values: none

Credits

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

0.7.2

2 years ago

0.7.1

2 years ago

0.7.3

2 years ago

0.7.0

3 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago