Interface TypefusionScript<DataElement>

The type of a Typefusion script export (TypefusionScriptExport) when the result of the run function contains both the 'schema' and return data. This will check that your pgType schema matches the data you are returning, but it's more verbose than using TypefusionDbScript.

interface TypefusionScript<DataElement> {
    name: string;
    resultDatabase: TypefusionSupportedDatabases;
    run: (() => PromiseLike<TypefusionScriptResult<DataElement>>);
    runEffect?: (<R>() => Effect<TypefusionScriptResult<unknown>, any, R>);
    schema: {
        [key in string | number | symbol]: DbType<DataElement[key]>
    };
}

Type Parameters

  • DataElement extends Record<string, unknown>

Hierarchy (view full)

Properties

name: string
run: (() => PromiseLike<TypefusionScriptResult<DataElement>>)
runEffect?: (<R>() => Effect<TypefusionScriptResult<unknown>, any, R>)
schema: {
    [key in string | number | symbol]: DbType<DataElement[key]>
}