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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 878ed2bcc132c4a7d1eef108770fdf7eaf32a0a0
4
- data.tar.gz: 6623dae499cbb326d08d74906722dd37507ac3ce
3
+ metadata.gz: 7afe86bb0afc9dfd6ec5d6c256b7a62eda1a7b92
4
+ data.tar.gz: 71530ea2eea2fe66ff7078b93b77afb60c14051d
5
5
  SHA512:
6
- metadata.gz: 2bd0cfbe691654236fe9c4c7c29fe258ceddf9909dac8ab94f54a72ff584dafd95da440d0d3e0291d508233869c7a57b3b2f667b1aa1a14c1a30e684bf85fe6b
7
- data.tar.gz: 82de714a1dcad79f54c41aeaacb0f19a0980054d875f63688a31c658662a21d68bff7942926fcf46fc08f91964563fc6c72c15ab45f5cb00d79bbe3deb49b5da
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
- $ svql --help
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 Treat file as having the first row as a header row
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
@@ -1,3 +1,3 @@
1
1
  module Csvql
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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", "strip every column data") {|v| option[:strip] = v }
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.1
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-29 00:00:00.000000000 Z
11
+ date: 2014-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3