csvtopg

command module
v0.0.0-...-6a0ba11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2020 License: MIT Imports: 1 Imported by: 0

README

csvtopg

csvtopg copies a CSV to a PostgreSQL database.

Why not just use psql and \copy?

  • csvtopg has easier syntax than \copy.
  • csvtopg will automatically create a table for the CSV data.
  • csvtopg will automatically detect common data types.

Installation

The Go tool chain must be installed.

$ go get -u github.com/jackc/csvtopg

Configuring Database Connection

csvtopg supports the standard PG* environment variables. In addition, the -d flag can be used to specify a database URL.

Example usage

$ csvtocsv foo.csv

This will create a new table foo_csv and copy foo.csv to it.

See also the sibling project pgtocsv) which simplifies exporting the result of a query as a CSV.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL