csv2psql 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/csv2psql/analyzer/types/uuid.rb +2 -0
- data/lib/csv2psql/cli/cmd/analyze_cmd.rb +4 -11
- data/lib/csv2psql/cli/cmd/convert_cmd.rb +20 -34
- data/lib/csv2psql/cli/cmd/schema_cmd.rb +4 -11
- data/lib/csv2psql/cli/cmd/version_cmd.rb +1 -1
- data/lib/csv2psql/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764ba1f133551d811fce81b53bda7b9fa53c3f31
|
4
|
+
data.tar.gz: d5501dd56420a37048ec43c08a61bd6070bc054d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33e26a12dbce605939c42199023a321da5e871ddd7664b6ad221dffacb5ad3cf7b557e12d40ae01647fc551f7a7bff89cdaa53fca29e66abb6f8a6877e4443b8
|
7
|
+
data.tar.gz: 78b0315b8a67a9add8eb58fd4ac62df82f731f37a796fe90cdbf968af1bf22ed3f46a5f41db02542dd0cca1a72e35f1f72e2f4b389704bf90c45404484f002a1
|
@@ -33,20 +33,13 @@ formats = {
|
|
33
33
|
end
|
34
34
|
}
|
35
35
|
|
36
|
-
cmds = {
|
37
|
-
f: {
|
38
|
-
desc: 'Output format',
|
39
|
-
type: String,
|
40
|
-
default_value: formats.keys.first
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
36
|
desc 'Analyze csv file'
|
45
37
|
command :analyze do |c|
|
46
|
-
c.
|
47
|
-
|
38
|
+
c.desc "Output format #{formats.keys.join(', ')}"
|
39
|
+
c.default_value(formats.keys.first)
|
40
|
+
c.flag [:f, :format]
|
48
41
|
c.action do |global_options, options, args|
|
49
|
-
|
42
|
+
help_now!('No file to analyze specified!') if args.empty?
|
50
43
|
|
51
44
|
opts = {}.merge(global_options).merge(options)
|
52
45
|
|
@@ -3,44 +3,30 @@
|
|
3
3
|
require_relative '../../convert/convert'
|
4
4
|
require_relative '../../processor/processor'
|
5
5
|
|
6
|
-
cmds = {
|
7
|
-
t: {
|
8
|
-
desc: 'Table to insert to',
|
9
|
-
type: String,
|
10
|
-
default_value: Csv2Psql::Processor::DEFAULT_OPTIONS[:table]
|
11
|
-
},
|
12
|
-
|
13
|
-
transaction: {
|
14
|
-
desc: 'Import in transaction block',
|
15
|
-
default_value: Csv2Psql::Processor::DEFAULT_OPTIONS[:transaction]
|
16
|
-
},
|
17
|
-
|
18
|
-
'create-table' => {
|
19
|
-
desc: 'Crate SQL Table before inserts',
|
20
|
-
default_value: Csv2Psql::Processor::DEFAULT_OPTIONS['create-table']
|
21
|
-
},
|
22
|
-
|
23
|
-
'drop-table' => {
|
24
|
-
desc: 'Drop SQL Table before inserts',
|
25
|
-
default_value: Csv2Psql::Processor::DEFAULT_OPTIONS['drop-table']
|
26
|
-
},
|
27
|
-
|
28
|
-
'truncate-table' => {
|
29
|
-
desc: 'Truncate SQL Table before inserts',
|
30
|
-
default_value: Csv2Psql::Processor::DEFAULT_OPTIONS['truncate-table']
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
6
|
desc 'Convert csv file'
|
35
7
|
command :convert do |c|
|
36
|
-
c.
|
37
|
-
c.
|
38
|
-
c.
|
39
|
-
|
40
|
-
c.
|
8
|
+
c.desc 'Table to insert to'
|
9
|
+
c.default_value Csv2Psql::Processor::DEFAULT_OPTIONS[:table]
|
10
|
+
c.flag [:t, :table]
|
11
|
+
|
12
|
+
c.desc 'Import in transaction block'
|
13
|
+
c.default_value Csv2Psql::Processor::DEFAULT_OPTIONS[:transaction]
|
14
|
+
c.switch [:transaction]
|
15
|
+
|
16
|
+
c.desc 'Crate SQL Table before inserts'
|
17
|
+
c.default_value Csv2Psql::Processor::DEFAULT_OPTIONS['create-table']
|
18
|
+
c.switch ['create-table']
|
19
|
+
|
20
|
+
c.desc 'Drop SQL Table before inserts'
|
21
|
+
c.default_value Csv2Psql::Processor::DEFAULT_OPTIONS['drop-table']
|
22
|
+
c.switch ['drop-table']
|
23
|
+
|
24
|
+
c.desc 'Truncate SQL Table before inserts'
|
25
|
+
c.default_value Csv2Psql::Processor::DEFAULT_OPTIONS['truncate-table']
|
26
|
+
c.switch ['truncate-table']
|
41
27
|
|
42
28
|
c.action do |global_options, options, args|
|
43
|
-
|
29
|
+
help_now!('No file to convert specified!') if args.empty?
|
44
30
|
|
45
31
|
opts = {}.merge(global_options).merge(options)
|
46
32
|
Csv2Psql::Convert.convert(args, opts)
|
@@ -42,20 +42,13 @@ formats = {
|
|
42
42
|
end
|
43
43
|
}
|
44
44
|
|
45
|
-
cmds = {
|
46
|
-
f: {
|
47
|
-
desc: 'Output format',
|
48
|
-
type: String,
|
49
|
-
default_value: formats.keys.first
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
45
|
desc 'Generate schema for file'
|
54
46
|
command :schema do |c|
|
55
|
-
c.
|
56
|
-
|
47
|
+
c.desc "Output format - #{formats.keys.join(', ')}"
|
48
|
+
c.default_value(formats.keys.first)
|
49
|
+
c.flag [:f, :format]
|
57
50
|
c.action do |global_options, options, args|
|
58
|
-
|
51
|
+
help_now!('No file to analyze specified!') if args.empty?
|
59
52
|
|
60
53
|
opts = {}.merge(global_options).merge(options)
|
61
54
|
|
data/lib/csv2psql/version.rb
CHANGED