Skip to content

@sqlrooms/duckdb / sqlFrom

Function: sqlFrom()

sqlFrom(data, options?): string

Create a SQL query that embeds the given data for loading.

Parameters

ParameterTypeDescription
dataRecord<string, unknown>[]The dataset as an array of objects.
options?{ columns?: string[] | Record<string, string>; }Loading options.
options.columns?string[] | Record<string, string>The columns to include. If not specified, the keys of the first data object are used.

Returns

string

SQL query string to load data.