LogoLogo
Release notesDocs homeFabricateTonic.ai
  • Tonic Fabricate User Guide
  • Fabricate workflow
  • Tutorial videos
  • Fabricate account
    • Getting started with Fabricate
    • Fabricate license plans
    • Managing your Fabricate account and profile
    • Managing users in your account
  • Databases
    • Supported database types
    • Creating and managing databases
  • Backing up and restoring the database definition
  • Configuring database variables
  • Exporting data from a database
  • Tables and columns
    • Managing database tables
      • Configuring table settings
      • Adding a table to a database
      • Removing a table from a database
      • Attaching static data to a table
      • Regenerating table data
  • Managing table columns
    • Adding and removing columns
    • Configuring a column
    • Generator reference
      • Calculated or related values
      • Data type and specific values
      • Names and other identifying information
      • Telephone numbers and email addresses
      • Geographic locations
      • Air travel
      • Natural science
      • Networks and files
      • Banking and finance
      • Dates and times
      • Vehicles
      • Companies and products
      • Healthcare and health insurance
      • Languages
      • Movies
      • Education
  • Views
    • Creating and managing views
    • Views reference
  • Workspaces
    • About workspaces
  • Creating and managing workspaces
  • Database mock API
    • About mock APIs
    • Defining a mock API
    • Creating and querying database snapshots
  • Mock API reference
  • Fabricate API and CLI
    • About the Fabricate API and CLI
    • Managing Fabricate API keys
    • Daily limits on generated data
    • Using the Fabricate API
      • Authentication for the API
      • Data model
      • Managing databases from the API
      • Generating data from the API
    • Using the Fabricate CLI
      • Setting up CLI access
      • Using the CLI to load data
Powered by GitBook
On this page
  • Parameters
  • How the data is loaded into PostgreSQL
Export as PDF
  1. Fabricate API and CLI
  2. Using the Fabricate CLI

Using the CLI to load data

To generate data and load it into a PostgreSQL database, use the load command:

fabricate load \
  --source <fabricate_database_name> \
  --target <target_database_name> \
  --type <database_type> \
  --create \
  --user <username> \
  --host <host> \
  --port <port>

Parameters

The load command accepts the following parameters:

  • source - The name of the Fabricate database to use.

  • target - The name of the database to populate.

  • create - When included, indicates to create the database if it does not already exist. If not included, then the database must already exist.

  • refresh - If included, Fabricate regenerates the data from scratch. If not included, then the previously generated data is used.

  • type - The type of the target database platform. Currently only postgres is supported.

  • user - The database user to connect with.

  • host - The hostname of the target database.

  • port - The port on which to connect.

How the data is loaded into PostgreSQL

To load data into PostgreSQL, the CLI uses the psql command.

Make sure that the psql command is available in your PATH.

Set the PGPASSWORD environment variable to the password for the user specified in the --user parameter.

Last updated 8 days ago