Exporting data from a rules-based database

You can export the most recently generated rule-based database data to files or to a database.

Note that views are exported as tables. They do not create or replace the views in the target database.

Starting the export

To start an export, in the database header, click Export Data.

Fabricate displays the Export Data panel.

Export Data panel to configure the export of a rules-based database

Selecting the output format

On the Export Data panel, from the Format dropdown list, select the format for the exported data:

  • SQL - Exports the data to a .zip file called <database name>.zip. The file contains a SQL file to load the exported data, and a readme file that summarizes the export.

  • CSV - Exports the data to a .zip file called <database name>.zip. The file contains a .csv file for each table and view, and a readme file that summarizes the export.

  • JSONL - Exports the data to a .zip file called <database name>.zip. The file contains a .jsonl file for each table and view, and a readme file that summarizes the export.

  • Parquet - Exports the data to a .zip file called <database name>.zip. The file contains a .parquet file for each table and view, and a readme file that summarizes the export.

  • XML - Exports the data to a .zip file called <database name>.zip. The file contains an XML file for each table and view.

  • Push to Database - Available for databases that are created with a specific database type, such as PostgreSQL. Uses the data to populate a database that you specify.

When you export PostgreSQL or SQL Server databases to SQL or to a database, if you provided a schema name, then Fabricate assigns all of the tables to that schema.

Adding and selecting an export target

When you select Push to Database, you are prompted for an export target. An export target includes:

  • A server connection where the database is located.

  • The database. The database must already exist.

Your external database must allow connections from the following Fabricate IP addresses:

Selecting an existing target

If you previously created an export target, then from the Target Database dropdown list, select the export target to use.

Defining a new export target

To define an export target:

  1. From the Target Database dropdown list, select create new target.

  2. On the New Target Database Connection panel, in the Connection Name field, provide a name to use to identify the export target.

  3. From the Server Connection dropdown list, select the server connection where the export target is located. You can if needed add a new server connection or edit the selected server connection. New server connections are added to the available server connections for the workspace. Note that any edits to the selected server connection apply to all of the locations where the server connection is used.

  4. Specify the database to connect to. For platforms other than Databricks, in the Database Name field, provide the name of the database to export to. For Databricks:

    1. In the Catalog field, provide the data catalog for the data.

    2. In the Schema field, provide the schema for the data.

  5. To test the connection, click Test Connection.

  6. To save the target database, click Create Connection.

The export target is then available to use whenever you export the database.

Note on exports to Databricks

When Fabricate exports data to Databricks, it:

  1. Creates a volume called /Volumes///fabricate.

  2. Creates a directory in that volume that is named with a UUID.

  3. Uploads a CSV file for each table into that directory.

  4. Copies the data from each CSV file into the destination tables in the schema.

The catalog, schema, and tables must already exist. Fabricate creates the volume automatically.

Including the DDL in the export

When you export to SQL or push to a database, you can include the DDL in the export.

To include the DDL, check the Include DDL checkbox.

Remember that Fabricate does not update the DDL to reflect manual changes to the database schema. Make sure that either the DDL matches the current schema, or that you handle the migration in the destination database.

Selecting the scope of the data to export

If you are currently viewing a specific table or a view, then on the Export Database panel:

  • To export the entire database, click All Tables.

  • To only export the current table or view, click Only <table or view name>.

Completing the export and downloading exported files

After you configure the export, to complete the export, click Export Database.

When you export to files, after Fabricate generates the file, it prompts you to download the file.

Download prompt for export to a file

If you do not download the file immediately, it is also available on the downloads list.

To display the list of available downloads, in the Fabricate header, click the download icon.

Download icon to display the list of available files to download

Last updated

Was this helpful?