MotherDuck
Connect & Ingest data from / to a MotherDuck database
Setup
The following credentials keys are accepted:
database(required) -> The motherduck database namemotherduck_token(required) -> The service token. See here for instructions on getting it.schema(optional) -> The default schema to use.duckdb_version(optional) -> The CLI version of DuckDB to use. You can also specify the env. variableDUCKDB_VERSION.read_only(optional) -> Whether to open the connection inreadonlymode. Acceptstrueorfalse. Default isfalse.interactive(optional) -> Whether to communicate to the DuckDB CLI via interactive mode instead of reopening the connection each time. Acceptstrueorfalse. Default istrue.motherduck_attach_mode(optional v1.4.24+) -> Whether to set MotherDuck Attach Mode. Acceptsworkspaceorsingle.copy_format(optional v1.6.4+) -> the data format that Sling uses to move data between Sling and DuckDB, for reads and writes. Acceptable values:arrow,csv. Default isarrow. Arrow needs the DuckDBarrowcommunity extension. If DuckDB cannot load this extension (for example, with no internet access), Sling usescsv. If you have issues with arrow, setcsv.copy_method(deprecated) -> usecopy_format.arrow_httpbecomesarrow. All other values becomecsv.max_buffer_size(optional v1.5) -> the max buffer size to use when piping data from DuckDB CLI. Specify this if you have extremely large one-line text values in your dataset. Default is10485760(10MB).max_line_size(optional v1.5.25+) -> the max line size (in bytes) to use when piping CSV data into DuckDB. Sling raises this to268435456(256MB) when the data has string, text, json or binary columns, and uses2000000(2MB) otherwise. Specify this only if a single row is larger than 256MB.
Using sling conns
Here are examples of setting a connection named MOTHERDUCK. We must provide the type=motherduck property:
$ sling conns set MOTHERDUCK type=motherduck database=my_db motherduck_token=xxxxxxxxxxxx
# Or use url
$ sling conns set MOTHERDUCK url="motherduck://my_db?motherduck_token=xxxxxxxxxxxx"Environment Variable
See here to learn more about the .env.sling file.
Sling Env File YAML
See here to learn more about the sling env.yaml file.
Specifying a DuckDB version
If you would like to use a specific DuckDB version, you can specify this way:
If you are facing issues connecting, give sling assist a try, or reach out to us at support@slingdata.io, on discord or open a Github Issue here.
Potential Issue
If you have a .duckdbrc file, which runs commands whenever the DuckDB CLI is invoked, this may interfere with normal Sling operation. If you are facing weird issues and have this file, try again after deleting it.
Last updated
Was this helpful?