Skip to main content

DuckDB_Connection.write_database

write_databasepathschema_onlyon_existing_file

Documentation

Writes the current database to a new database file to the specified path and then returns a new connection to the written database.

Arguments

  • path: The path to write the database to.
  • schema_only: If set to True, only the schema will be written, without any data. Defaults to False.
  • on_existing_file: The behavior to use if the file already exists. Defaults to Backup, which will create a backup of the existing file.

Returns

A new DuckDB_Connection connected to the written database.