@sideloop/core
    Preparing search index...

    Interface ExecutionContructor<M, TB>

    interface ExecutionContructor<M, TB> {
        new ExecutionContructor(
            attrs: DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: SelectType<TB[K]> },
            >,
        ): ModelShape<TB>;
        all(): Promise<M[]>;
        attributesFromJob(
            job: Job,
        ): { jobId: number; priority: number; queueName: string };
        count(): Promise<number>;
        create(
            attrs: DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: InsertType<TB[K]> } & {
                    [K in string | number | symbol]?: InsertType<TB[K]>
                },
            >,
            options?: {
                ignoreConflict: keyof DrainOuterGeneric<
                    { [K in string
                    | number
                    | symbol]: InsertType<TB[K]> } & {
                        [K in string | number | symbol]?: InsertType<TB[K]>
                    },
                >;
            },
        ): Promise<M>;
        createAll(
            attrs: DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: InsertType<TB[K]> } & {
                    [K in string | number | symbol]?: InsertType<TB[K]>
                },
            >[],
        ): Promise<M[]>;
        createAllFromJobs(jobs: Job[]): Promise<void>;
        createUnique(
            attrs: DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: InsertType<TB[K]> } & {
                    [K in string | number | symbol]?: InsertType<TB[K]>
                },
            >,
            uniqueBy: keyof DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: InsertType<TB[K]> } & {
                    [K in string | number | symbol]?: InsertType<TB[K]>
                },
            >,
        ): Promise<null | M>;
        destroy(cb: (db: Kysely<Database>) => CompiledQuery): Promise<number>;
        discardAllFromJobs(jobs: Job[]): Promise<void>;
        discardAllInBatches(
            opts?: { batchSize?: number; queue?: string },
        ): Promise<void>;
        findAll(cb: (db: Kysely<Database>) => CompiledQuery): Promise<M[]>;
        findById(id: number): Promise<null | M>;
        findByIdOrThrow(id: number): Promise<M>;
        findOne(cb: (db: Kysely<Database>) => CompiledQuery): Promise<null | M>;
        findOneOrThrow(cb: (db: Kysely<Database>) => CompiledQuery): Promise<M>;
        last(): Promise<null | M>;
        last(limit: 1): Promise<null | M>;
        last(limit: number): Promise<M[]>;
        transaction<T>(cb: (tx: Transaction<Database>) => Promise<T>): Promise<T>;
        updateAll(cb: (db: Kysely<Database>) => CompiledQuery): Promise<number>;
    }

    Type Parameters

    • M
    • TB

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Parameters

      • attrs: DrainOuterGeneric<
            { [K in string
            | number
            | symbol]: InsertType<TB[K]> } & {
                [K in string | number | symbol]?: InsertType<TB[K]>
            },
        >
      • Optionaloptions: {
            ignoreConflict: keyof DrainOuterGeneric<
                { [K in string
                | number
                | symbol]: InsertType<TB[K]> } & {
                    [K in string | number | symbol]?: InsertType<TB[K]>
                },
            >;
        }

      Returns Promise<M>

    • Parameters

      • attrs: DrainOuterGeneric<
            { [K in string
            | number
            | symbol]: InsertType<TB[K]> } & {
                [K in string | number | symbol]?: InsertType<TB[K]>
            },
        >[]

      Returns Promise<M[]>

    • Parameters

      • attrs: DrainOuterGeneric<
            { [K in string
            | number
            | symbol]: InsertType<TB[K]> } & {
                [K in string | number | symbol]?: InsertType<TB[K]>
            },
        >
      • uniqueBy: keyof DrainOuterGeneric<
            { [K in string
            | number
            | symbol]: InsertType<TB[K]> } & {
                [K in string | number | symbol]?: InsertType<TB[K]>
            },
        >

      Returns Promise<null | M>

    • Parameters

      • Optionalopts: { batchSize?: number; queue?: string }

      Returns Promise<void>