csvql 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/lib/csvql/version.rb +1 -1
- data/lib/csvql.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7afe86bb0afc9dfd6ec5d6c256b7a62eda1a7b92
|
4
|
+
data.tar.gz: 71530ea2eea2fe66ff7078b93b77afb60c14051d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3d40944768905d36db6ce94c70f9c1e9f0cf85c6c281ea87a687d59397c7ac8d5a0c45e7db3f0d7c12dce5b7b09dadbcef32861aa9c6393e80a9e38528d8c77
|
7
|
+
data.tar.gz: 563cfe718be42fb93f46b3e00207274d47665e04ab47549ceb1c6770ae840f4cfaf70c033b3b2e4cfbdc86f09b4d1cc1c24df784fce9979b1e751f7d859e49a0
|
data/README.md
CHANGED
@@ -88,18 +88,33 @@ Only where clause:
|
|
88
88
|
1|Anne|33
|
89
89
|
3|Charry|48
|
90
90
|
|
91
|
+
Strip spaces around columns:
|
92
|
+
|
93
|
+
$ cat sample2.csv
|
94
|
+
name,email,tel
|
95
|
+
Graham , grhm@example.com , 555-1234
|
96
|
+
|
97
|
+
$ csvql sample2.csv --header --select "*"
|
98
|
+
Graham | grhm@example.com | 555-1234
|
99
|
+
|
100
|
+
$ csvql sample2.csv --header --select "*" --strip
|
101
|
+
Graham|grhm@example.com|555-1234
|
102
|
+
|
91
103
|
Options:
|
92
104
|
|
93
|
-
$
|
105
|
+
$ csvql --help
|
94
106
|
Usage: csvql [csvfile] [options]
|
95
107
|
--console After all commands are run, open sqlite3 console with this data
|
96
|
-
--header
|
108
|
+
--[no-]header Treat file as having the first row as a header row
|
97
109
|
--output-dlm="|" Output delimiter (|)
|
98
110
|
--save-to=FILE If set, sqlite3 db is left on disk at this path
|
111
|
+
--append Append mode (not dropping any tables)
|
99
112
|
--skip-comment Skip comment lines start with '#'
|
100
113
|
--source=FILE Source file to load, or defaults to stdin
|
101
114
|
--sql=SQL SQL Command(s) to run on the data
|
102
115
|
--select=COLUMN Select column (*)
|
116
|
+
--schema=FILE or STRING Specify a table schema
|
117
|
+
--strip Strip spaces around column
|
103
118
|
--where=COND Where clause
|
104
119
|
--table-name=NAME Override the default table name (tbl)
|
105
120
|
--verbose Enable verbose logging
|
data/lib/csvql/version.rb
CHANGED
data/lib/csvql.rb
CHANGED
@@ -14,7 +14,7 @@ module Csvql
|
|
14
14
|
option = {}
|
15
15
|
|
16
16
|
# default
|
17
|
-
option[:header] = true
|
17
|
+
# option[:header] = true
|
18
18
|
|
19
19
|
opt.on("--console", "After all commands are run, open sqlite3 console with this data") {|v| option[:console] = v }
|
20
20
|
opt.on("--[no-]header", "Treat file as having the first row as a header row") {|v| option[:header] = v }
|
@@ -26,7 +26,7 @@ module Csvql
|
|
26
26
|
opt.on("--sql=SQL", "SQL Command(s) to run on the data") {|v| option[:sql] = v }
|
27
27
|
opt.on("--select=COLUMN", "Select column (*)") {|v| option[:select] = v }
|
28
28
|
opt.on("--schema=FILE or STRING", "Specify a table schema") {|v| option[:schema] = v }
|
29
|
-
opt.on("--strip", "
|
29
|
+
opt.on("--strip", "Strip spaces around columns") {|v| option[:strip] = v }
|
30
30
|
opt.on("--where=COND", "Where clause") {|v| option[:where] = v }
|
31
31
|
opt.on("--table-name=NAME", "Override the default table name (tbl)") {|v| option[:table_name] = v }
|
32
32
|
opt.on("--verbose", "Enable verbose logging") {|v| option[:verbose] = v }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csvql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YANO Satoru
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sqlite3
|