SQL INSERT File Format
This file format contains an INSERT...VALUES statement to be executed on the destination during the load stage.
Additional data types are stored as follows:
datetimeanddateare stored as ISO strings;decimalis stored as a text representation of a decimal number;binarystorage depends on the format accepted by the destination;complexstorage also depends on the format accepted by the destination.
This file format is compressed by default.
Supported Destinations​
This format is used by default by: DuckDB, Postgres, Redshift.
It is also supported by: Filesystem.
How to configure​
There are several ways of configuring dlt to useinsert_values file format for normalization step and to store your data at the destination:- You can set the
loader_file_formatargument toinsert_valuesin the run command:
info = pipeline.run(some_source(), loader_file_format="insert_values")
- You can set the
loader_file_formatinconfig.tomlorsecrets.toml:
[normalize]
loader_file_format="insert_values"
- You can set the
loader_file_formatvia ENV variable:
export NORMALIZE__LOADER_FILE_FORMAT="insert_values"
- You can set the file type directly in the resource decorator.
@dlt.resource(file_format="insert_values")
def generate_rows(nr):
    pass