Libraries v5.2.0
    Preparing search index...

    Type Alias DbContext<TMap>

    DbContext: { readonly [K in keyof TMap]: DbSet<TMap[K]> } & {
        knex: Knex;
        transaction<T>(
            callback: (db: DbContext<TMap>) => Promise<T>,
            options?: TransactionOptions,
        ): Promise<T>;
        withTransaction(trx: Transaction): DbContext<TMap>;
    }

    The shape of the context object returned by createDb: every registered entity becomes a typed DbSet property.

    Type Parameters

    Type Declaration

    • Readonlyknex: Knex

      The underlying Knex instance the context was constructed with.

    • transaction: function
    • withTransaction: function