Using the CLI to load data
To generate data and load it into a PostgreSQL database, use the load
command:
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 onlypostgres
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