csv_query 0.0.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/csv_query/command_line.rb +1 -1
- data/lib/csv_query/query.rb +1 -1
- data/lib/csv_query/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -30,7 +30,7 @@ module CsvQuery
|
|
30
30
|
opts.on(
|
31
31
|
"-q",
|
32
32
|
"--query SQL",
|
33
|
-
"The SQL query to run on the dataset. If specified --select and --where will be ignored."
|
33
|
+
"The SQL query to run on the dataset. The table name to select data from is named \"csv\", ie \"--query 'SELECT * FROM csv'\" recreates default behavior. If specified --select and --where will be ignored."
|
34
34
|
) do |q|
|
35
35
|
options[:sql_query] = q
|
36
36
|
end
|
data/lib/csv_query/query.rb
CHANGED
@@ -38,7 +38,7 @@ module CsvQuery
|
|
38
38
|
def create_database_and_table(csv)
|
39
39
|
database = SQLite3::Database.new(':memory:')
|
40
40
|
|
41
|
-
column_definitions = csv.headers.collect { |name| "#{name} VARCHAR(255)" }
|
41
|
+
column_definitions = csv.headers.collect { |name| "\"#{name}\" VARCHAR(255)" }
|
42
42
|
database.execute "CREATE TABLE csv (#{column_definitions.join(", ")})"
|
43
43
|
|
44
44
|
database
|
data/lib/csv_query/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|