项目作者: Bennyelg

项目描述 :
query CSVs in memory. with ansi sql
高级语言: Nim
项目地址: git://github.com/Bennyelg/csvql.git
创建时间: 2017-09-05T12:47:29Z
项目社区:https://github.com/Bennyelg/csvql

开源协议:

下载


CSVql - Nim

Query You’r CSVs data like a boss.

  1. Options(opt-arg sep :|=|spc):
  2. -h, --help write this help to stdout
  3. -q=, --query= string REQUIRED Placing the query as an ANSI-SQL the table name should be replaced with the path
  4. to the csv instead
  5. i.e:
  6. 1) SELECT name, day, hour FROM '/path/to/csv/test.csv' as
  7. t1 LIMIT 10
  8. 2) SELECT name, lastname, birthday FROM '/path/to/csv/test.csv' as
  9. t1 LEFT JOIN '/path/to/csv/test2.csv' as t2 ON t1.name = t2.name
  • Delimiter are gussed so no need to specified.

Query over CSV with simple AnsiSQL.



Limitations:

1. Header must be present.

If you’r header is with spaces / special chars they will be replaced.


Space will replace to (dash _) and special chars will be removed.


# char will be written as no (# of drivers -> no_of_drivers)

2. Delimiter is guessed in app so the delimiters are limited to the following:

  1. const possibleDelimiters = @[";", ",", ":", "~", "*", "$", "#", "@", "/", "%", "^", "\t"]

Please make sure its one of the following delimiters.

3. Fit to memory.

As you may already know - sqlite is used to store your data in-memory. so the CSV/s should be fit.

4. SQLite should be installed.

TODOs:

  1. Tests.