Exporting data from a database

You can export the most recently generated 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.

Selecting the output format

On the Export Database panel, from the Export As 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.

  • 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 - 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 a database connection

When you push the exported data to database, you are prompted for the target database. The database must already exist.

Also note that for Fabricate to connect to your database, you must allowlist access from the following IP addresses:

  • 34.224.174.7

If you previously created a target databases for export, then from the Target Database dropdown list, select the database to use.

To create a new target:

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

  2. On the New Target Database Connection panel, provide the connection information.

  3. To test the connection, click Test Connection.

  4. To save the target database, click Create Target.

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

Connection information for databases other than Databricks

On the New Target Database Connection panel, for database types other than Databricks:

  1. In the Name field, provide the name of the database.

  2. In the Host field, provide the host where the database is located.

  3. In the Port field, specify the host to use to connect to the database.

  4. In the Username field, provide the username to use to connect to the database.

  5. In the Password field, provide the password to use for authentication.

  6. In the Database field, set the Fabricate database that can populate the target database.

    The field is pre-populated with the current database.

Connection information for Databricks

On the New Target Database Connection panel, for a Databricks database:

  1. In the Name field, provide the name of the database.

  2. In the Host field, provide the host where the database is located.

  3. From the Credential Type dropdown list, select the type of authentication to use. The options are:

    • Service Principal

    • Personal Access Token

  4. For Service Principal authentication:

    1. In the Client ID field, provide the client identifier.

    2. In the Secret field, provide the secret that is associated with the client identifier. For a new target, you must always provide the secret. For an existing target, if the secret did not change, then you can leave the Secret field empty.

  5. For Personal Access Token authentication, in the Access Token field, provide the access token to authenticate to the database.

  6. In the Warehouse ID field, provide the data warehouse for the data.

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

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

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