Metadata-Version: 2.1
Name: table2sql
Version: 0.1.3
Summary: 
Home-page: https://github.com/piotrgredowski/table2sql
License: MIT
Author: Piotr Gredowski
Author-email: piotrgredowski@gmail.com
Requires-Python: >=3.6,<4
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: click (>=8.0.1,<9.0.0)
Project-URL: Bug Tracker, https://github.com/piotrgredowski/table2sql/issues
Description-Content-Type: text/markdown

# table2sql

[![CI](https://github.com/piotrgredowski/table2sql/actions/workflows/ci.yml/badge.svg)](https://github.com/piotrgredowski/table2sql/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/piotrgredowski/table2sql/branch/main/graph/badge.svg?token=fNkIDyWLq7)](https://codecov.io/gh/piotrgredowski/table2sql)

Python CLI tool which allows you to convert file with table (for now only CSV) to SQL insert statements.


`some.csv`
```csv
a,b,c,d
int,str,float,sql
1,2,3,(SELECT id FROM another.table WHERE name = 'Paul')
5,6,7,(SELECT id FROM another.table WHERE name = 'Paul')
```

Command:
```bash
table2sql some.csv --output-table some.table --has-types-row
```

Result:
```sql
INSERT INTO some.table (a, b, c, d)
VALUES (1, '2', 3.0, (SELECT id FROM another.table WHERE name = 'Paul')), (5, '6', 7.0, (SELECT id FROM another.table WHERE name = 'Paul'));
```

## Install

```bash
pip install table2sql
```

