Skip to content

Commit

Permalink
feat: ToC entries for new import options
Browse files Browse the repository at this point in the history
  • Loading branch information
codingconcepts committed May 15, 2024
1 parent 542381d commit b2515fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ A fast data generator that produces CSV files from generated relational data.
## Table of Contents
1. [Installation](#installation)
1. [Usage](#usage)
* Import via [HTTP](#import-via-http)
* Import via [psql](#import-via-psql)
* Import via [nodelocal](#import-via-nodelocal)
1. [Tables](#tables)
* [gen](#gen)
* [set](#set)
Expand Down Expand Up @@ -144,6 +147,8 @@ your_output_dir
└── person_type.csv
```

##### [Import via HTTP]

Then import the files as you would any other; here's an example insert into CockroachDB:

``` sql
Expand Down Expand Up @@ -172,13 +177,17 @@ CSV DATA (
WITH skip='1', nullif = '', allow_quoted_null;
```

##### [Import via psql]

If you're working with a remote database and have access to the `psql` binary, try importing the CSV file as follows:

``` sh
psql "postgres://root@localhost:26257/defaultdb?sslmode=disable" \
-c "\COPY public.person (id, full_name, date_of_birth, user_type, favourite_animal) FROM './csvs/person/person.csv' WITH DELIMITER ',' CSV HEADER NULL E''"
```

##### [Import via nodelocal]

If you're working with a remote database and have access to the `cockroach` binary, try importing the CSV file as follows:

``` sh
Expand Down

0 comments on commit b2515fe

Please sign in to comment.