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:
datetime
anddate
are stored as ISO strings;decimal
is stored as a text representation of a decimal number;binary
storage depends on the format accepted by the destination;json
storage 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, Synapse, MSSQL, Motherduck
It is also supported by: Filesystem if you'd like to store INSERT VALUES statements for some reason
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_format
argument toinsert_values
in the run command:
info = pipeline.run(some_source(), loader_file_format="insert_values")
- You can set the
loader_file_format
inconfig.toml
orsecrets.toml
:
[normalize]
loader_file_format="insert_values"
- You can set the
loader_file_format
via environment 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