sql_csv

Crates.iosql_csv
lib.rssql_csv
version0.2.0
sourcesrc
created_at2021-12-15 09:37:53.641567
updated_at2021-12-17 08:47:08.591235
descriptionA tool which query csv files use SQL syntax
homepage
repository
max_upload_size
id498229
size41,744
Jonny Wei (jonnywei)

documentation

README

CSV SQL Query

A friendly query csv file use sql syntax

Installation

$ cargo install sql_csv

Support Commands

load

Load csv file

load /home/path/to/xxx.csv 

store

Store last success SQL query result to csv file

store /path/to/xxx.csv

SQL

All SQL query support.

select * from user;
select count(*) from user;
select city,count(*) from user group by city;

Examples

$sql_csv.exe c:\temp\user.csv  c:\temp\author.csv
read csv file c:\temp\user.csv to table user
read csv file c:\temp\author.csv to table author
>select * from user;
Result:
+----+-----------+------+---------+
| id | name      | size | sport   |
+----+-----------+------+---------+
| 1  | Xiaoputao | 3    | Hiking  |
| 2  | Zgu       | 3    | Running |
| 3  | Xiaopang  | 2    | Walking |
+----+-----------+------+---------+
>
>load c:\temp\abc.csv
load csv file c:\temp\abc.csv to table abc
Load ok.
>select * from abc;
Result:
+----+-----------+------+---------+
| id | name      | size | sport   |
+----+-----------+------+---------+
| 1  | Xiaoputao | 3    | Hiking  |
| 2  | Zgu       | 3    | Running |
| 3  | Xiaopang  | 2    | Walking |
+----+-----------+------+---------+
>store c:\temp\bar.csv
Store ok.
>
Commit count: 0

cargo fmt