UNPKG

bs3m

Version:

TS/JS migrations framework for sqlite3 databases

41 lines 1.33 kB
/** Core type definitions. */ import type { Migration } from './migration.js'; /** Migration bitwise flags enum. */ export declare enum MigrationFlag { NONE = 0, /** * Signifies that migration is using attached mode. Must be a flag to allow * inferring the mode from the migration string id, since attached and * non-attached migrations can not be run in the same transaction. */ ATTACHED = 1 } /** Full migration string ID (filename less extension). */ export type MigrationStringId = string & { __brand: 'MigrationStringId'; }; /** Migration numeric ID, `yymmddhhmm` parsed as number. */ export type MigrationId = number & { __brand: 'MigrationId'; }; /** Migration bitwise flags. */ export type MigrationFlags = number & { __brand: 'MigrationFlags'; }; /** Migration ID components parsed from string ID. */ export interface MigrationIdParts { stringId: MigrationStringId; id: MigrationId; flags: MigrationFlags; name: string; } /** Migration information parsed from the filename. */ export interface MigrationFile extends MigrationIdParts { path: string; } /** Loaded migration with its file information and migration object. */ export interface MigrationInfo { file: MigrationFile; migration: Migration<string[]>; } //# sourceMappingURL=types.d.ts.map