Copy tabular data between databases, CSV files and cloud storage https://www.dbcrossbar.org/
# Copy from a CSV file to a PostgreSQL table.
dbcrossbar cp \
--if-exists=overwrite \
--schema=postgres-sql:my_table.sql \
csv:my_table.csv \
'postgres://postgres@127.0.0.1:5432/postgres#my_table'
# Upsert from a PostgreSQL table to BigQuery.
dbcrossbar cp \
--if-exists=upsert-on:id \
--temporary=gs://$GS_TEMP_BUCKET \
--temporary=bigquery:$GCLOUD_PROJECT:temp_dataset \
'postgres://postgres@127.0.0.1:5432/postgres#my_table' \
bigquery:$GCLOUD_PROJECT:my_dataset.my_table
# Convert a PostgreSQL `CREATE TABLE` statement to a BigQuery JSON schema.
dbcrossbar conv postgres-sql:my_table.sql bigquery-schema:my_table.json
# Extract a schema from a CSV file and convert to Postgres `CREATE TABLE`.
dbcrossbar conv csv:data.csv postgres-sql:schema.sql