Skip to content

Commit c67763e

Browse files
committed
Added description of -A filename option.
1 parent e78453d commit c67763e

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

README.md

+27-14
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ $ trdsql [options] SQL
5454

5555
* `-a` **filename**
5656
Analyze file and suggest SQL.
57+
* `-A` **filename**
58+
Analyze but only suggest SQL.
5759
* `-config` **filename**
5860
Configuration file location.
5961
* `-db` **db name**
@@ -613,31 +615,29 @@ $ trdsql -a testdata/test.ltsv
613615
```
614616

615617
```console
616-
The table name is testdata/test.ltsv.
617-
The file type is LTSV.
618+
The table name is testdata/header.csv.
619+
The file type is CSV.
618620

619621
Data types:
620622
+-------------+------+
621623
| column name | type |
622624
+-------------+------+
623625
| id | text |
624-
| name | text |
625-
| price | text |
626+
| \`name\` | text |
626627
+-------------+------+
627628

628629
Data samples:
629-
+----+--------+-------+
630-
| id | name | price |
631-
+----+--------+-------+
632-
| 1 | Orange | 50 |
633-
| 2 | Melon | 500 |
634-
+----+--------+-------+
630+
+----+----------+
631+
| id | \`name\` |
632+
+----+----------+
633+
| 1 | Orange |
634+
+----+----------+
635635

636636
Examples:
637-
trdsql "SELECT id, name, price FROM testdata/test.ltsv"
638-
trdsql "SELECT id, name, price FROM testdata/test.ltsv WHERE id = '2'"
639-
trdsql "SELECT id,count(id) FROM testdata/test.ltsv GROUP BY id"
640-
trdsql "SELECT id, name, price FROM testdata/test.ltsv ORDER BY id LIMIT 10"
637+
trdsql -db sdb -ih "SELECT id, \`name\` FROM testdata/header.csv"
638+
trdsql -db sdb -ih "SELECT id, \`name\` FROM testdata/header.csv WHERE id = '1'"
639+
trdsql -db sdb -ih "SELECT id, count(id) FROM testdata/header.csv GROUP BY id"
640+
trdsql -db sdb -ih "SELECT id, \`name\` FROM testdata/header.csv ORDER BY id LIMIT 10"
641641
```
642642

643643
Other options(-id,-ih,-ir,-is,icsv,iltsv,-ijson,-itbln...) are available.
@@ -646,6 +646,19 @@ Other options(-id,-ih,-ir,-is,icsv,iltsv,-ijson,-itbln...) are available.
646646
$ trdsql -ih -a testdata/header.csv
647647
```
648648

649+
Similarly, with ***-A filename*** option, only Examples (SQL) is output.
650+
651+
```console
652+
$ trdsql -ih -A testdata/header.csv
653+
```
654+
655+
```console
656+
trdsql -ih "SELECT id, \`name\` FROM testdata/header.csv"
657+
trdsql -ih "SELECT id, \`name\` FROM testdata/header.csv WHERE id = '1'"
658+
trdsql -ih "SELECT id, count(id) FROM testdata/header.csv GROUP BY id"
659+
trdsql -ih "SELECT id, \`name\` FROM testdata/header.csv ORDER BY id LIMIT 10"
660+
```
661+
649662
### configuration
650663

651664
You can specify driver and dsn in the configuration file.

0 commit comments

Comments
 (0)