Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chop-dbhi/sql-importer
Import CSV files into Postgres with automatic column typing and table creation.
https://github.com/chop-dbhi/sql-importer
csv importer inference postgresql sql
Last synced: about 15 hours ago
JSON representation
Import CSV files into Postgres with automatic column typing and table creation.
- Host: GitHub
- URL: https://github.com/chop-dbhi/sql-importer
- Owner: chop-dbhi
- License: mit
- Created: 2017-07-11T13:28:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T01:02:15.000Z (about 6 years ago)
- Last Synced: 2024-06-20T10:07:11.187Z (5 months ago)
- Topics: csv, importer, inference, postgresql, sql
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 15
- Watchers: 11
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SQL Importer
Import a CSV file into Postgres with automatic column typing and table creation.
Features:
- Type inference for numbers, dates, datetimes, and booleans
- Automatic table creation
- Uniqueness and not null detection
- Automatic decompressing of gzip and bzip2 files
- Support for append instead of replace
- Support for CSV files wider than 1600 columns (the Postgres limit)## Install
[Download a pre-built release](https://github.com/chop-dbhi/sql-importer/releases).
Or install it from source (requires Go).
```
go get github.com/chop-dbhi/sql-importer/cmd/sql-importer
```## Usage
Specify the database URL and a CSV file to import. The table name will be derived from the filename by default.
```
sql-importer -db postgres://127.0.0.1:5432/postgres data.csv
```See other options by running `sql-importer -h`.
## Status
Beta, works as expected. Command line options will likely change.
## License
MIT