Skip to content

Commit 92cbb1c

Browse files
committed
replaced table-driven TestRunSql w/txtar-based TestSql_RunSql
- TestEscapeSqlName → TestSql_escapeSqlName - updated sql subcommand in README
1 parent c97ac60 commit 92cbb1c

File tree

3 files changed

+218
-249
lines changed

3 files changed

+218
-249
lines changed

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,15 @@ Run SQL queries on CSVs.
444444
Usage:
445445
446446
```shell
447-
gocsv sql --query QUERY FILE [FILES]
447+
gocsv sql (--query QUERY | --file SQL_SCRIPT ) FILE [FILES]
448448
```
449449
450450
Arguments:
451451
452452
- `--query` (shorthand `-q`) The SQL query to run.
453+
- `--file` (shorthand `-f`) The path to the SQL script to run.
453454
454-
When passing in files, you may read from standard input by specifying the filename `-`.
455+
When passing in files, you may read one file from standard input by specifying the filename `-`.
455456
456457
Table names are derived from the CSV filenames by taking the base filename without the file extension. For example, `test-files/stats.csv` is referenced as a table with the name `stats`. The table from standard input `-` should be referenced as the table `stdin`.
457458
@@ -647,36 +648,36 @@ cat test-files/left-table.csv \
647648
648649
### Pipelining Support
649650
650-
| Subcommand | Input | Output |
651-
| ------------- | :-----------------: | :------: |
652-
| add | ✔ | ✔ |
653-
| autoincrement | ✔ | ✔ |
654-
| behead | ✔ | ✔ |
655-
| clean | ✔ | ✔ |
656-
| delimiter | ✔ | ✔ |
657-
| describe | ✔ | N/A |
658-
| dimensions | &#x2714; | &#x2714;<sup>*</sup> |
659-
| filter | &#x2714; | &#x2714; |
660-
| head | &#x2714; | &#x2714; |
661-
| headers | &#x2714; | &#x2714;<sup>*</sup> |
662-
| join | &#x2714; | &#x2714; |
663-
| ncol | &#x2714; | N/A |
664-
| nrow | &#x2714; | N/A |
665-
| rename | &#x2714; | &#x2714; |
666-
| replace | &#x2714; | &#x2714; |
667-
| sample | &#x2714; | &#x2714; |
668-
| select | &#x2714; | &#x2714; |
669-
| sort | &#x2714; | &#x2714; |
670-
| split | &#x2714; | N/A |
671-
| sql | &#x2714;<sup>&#x2020;</sup> | &#x2714; |
672-
| stack | &#x2714;<sup>&#x2020;</sup> | &#x2714; |
673-
| stats | &#x2714; | N/A |
674-
| tail | &#x2714; | &#x2714; |
675-
| transpose | &#x2714; | &#x2714; |
676-
| tsv | &#x2714; | &#x2714; |
677-
| unique | &#x2714; | &#x2714; |
678-
| view | &#x2714; | N/A |
679-
| xlsx | N/A | &#x2021; |
651+
| Subcommand | Input | Output |
652+
| ------------- | :-------------------------: | :-------------------: |
653+
| add | &#x2714; | &#x2714; |
654+
| autoincrement | &#x2714; | &#x2714; |
655+
| behead | &#x2714; | &#x2714; |
656+
| clean | &#x2714; | &#x2714; |
657+
| delimiter | &#x2714; | &#x2714; |
658+
| describe | &#x2714; | N/A |
659+
| dimensions | &#x2714; | &#x2714;<sup>\*</sup> |
660+
| filter | &#x2714; | &#x2714; |
661+
| head | &#x2714; | &#x2714; |
662+
| headers | &#x2714; | &#x2714;<sup>\*</sup> |
663+
| join | &#x2714; | &#x2714; |
664+
| ncol | &#x2714; | N/A |
665+
| nrow | &#x2714; | N/A |
666+
| rename | &#x2714; | &#x2714; |
667+
| replace | &#x2714; | &#x2714; |
668+
| sample | &#x2714; | &#x2714; |
669+
| select | &#x2714; | &#x2714; |
670+
| sort | &#x2714; | &#x2714; |
671+
| split | &#x2714; | N/A |
672+
| sql | &#x2714;<sup>&#x2020;</sup> | &#x2714; |
673+
| stack | &#x2714;<sup>&#x2020;</sup> | &#x2714; |
674+
| stats | &#x2714; | N/A |
675+
| tail | &#x2714; | &#x2714; |
676+
| transpose | &#x2714; | &#x2714; |
677+
| tsv | &#x2714; | &#x2714; |
678+
| unique | &#x2714; | &#x2714; |
679+
| view | &#x2714; | N/A |
680+
| xlsx | N/A | &#x2021; |
680681
681682
\* `dimensions` and `headers` write to CSV format when using the `--csv` argument.
682683

0 commit comments

Comments
 (0)