/** * load.ts * * The "last stage" for converting from an SQL ast to what the actual typescript types are. * Converting the plan generated from [query-interface.ts](./query-interface.ts) into actual types. * Loads the needed data from the database. */ import { QueryInterface, Source } from './query-interface.types'; import { Data, LoadedData, DataTable, LoadedQueryInterface, LoadedContext, LoadContext, LoadedContextWithUnknown } from './load.types'; export declare const loadAllData: (ctx: LoadContext, currentData: LoadedData[]) => Promise; /** * Convert {@link Data} object into their {@link LoadedData} counterparts. * If any of them already exist in the `currentData` array, skip. */ export declare const loadData: (ctx: LoadContext, currentData: LoadedData[], newData: Data[]) => Promise; /** * Get all {@link DataTable} to be loaded for the given {@link Source} array */ export declare const extractDataSources: (sources: Source[]) => DataTable[]; export declare const toLoadedContext: ({ data, sources, }: { data: LoadedData[]; sources: Source[]; }) => LoadedContextWithUnknown; export declare const filterUnknownLoadedContext: (context: LoadedContextWithUnknown) => LoadedContext; export declare const throwOnUnknownLoadedContext: (context: LoadedContextWithUnknown) => LoadedContext; /** * Extract the data needed to generate the types for all the queryInterfaces, and load them. * * If the data is already present in data, it will not be loaded again. * This way the function can safely be called on a persistent data store that is can be kept between executions. */ export declare const loadQueryInterfacesData: (ctx: LoadContext, queryInterfaces: QueryInterface[], data: LoadedData[]) => Promise; export declare const toLoadedQueryInterface: (data: LoadedData[]) => ({ sources, params, results }: QueryInterface) => LoadedQueryInterface;