idata 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ieval +3 -3
- data/bin/iexport +3 -3
- data/bin/iload +4 -4
- data/bin/ipatch +3 -3
- data/bin/ivalidate +11 -11
- data/lib/idata/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: 25140998b6255c27f9d303f589a4a4a6bb985243
|
4
|
+
data.tar.gz: dd065941104de3ebc029951bf8e5268dfcadf2b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3675be44947c520d37acddca6dd46d7afb3b8fca7a70eced8476ac87da661899ded7ff218cf7aa4494071b0b3a994bc668aa035c4383265b45e76678337e3da0
|
7
|
+
data.tar.gz: 4a59e5866b3a7aeb3e81af5108c7b60a68775ec5152ac14e5ec691ff988ca9a92ada609a66cfbb0ab03e1c824d8ca1573938a0b247da2724c96cf91ac64f4344
|
data/bin/ieval
CHANGED
@@ -66,9 +66,9 @@ EXAMPLES
|
|
66
66
|
-------------------------------------------------------
|
67
67
|
Run a custom Ruby command on the every record represented by the `item` variable
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
ieval --host=localhost --username=postgres --password=postgres \\
|
70
|
+
--table=vendors --database=db \\
|
71
|
+
--eval="item.last_name = item.full_name.split(/\\s+/).last"
|
72
72
|
|
73
73
|
eos
|
74
74
|
end
|
data/bin/iexport
CHANGED
@@ -100,9 +100,9 @@ def help
|
|
100
100
|
EXAMPLES
|
101
101
|
-------------------------------------------------------
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
iexport --host=localhost --username=postgres --database=db --table=items \\
|
104
|
+
--output=/tmp/data.csv --format=csv --delim="\\t" --linebreak=$'\\r\\n' \\
|
105
|
+
--select="id, name AS vendor_name, age" --where="active = 1"
|
106
106
|
|
107
107
|
eos
|
108
108
|
end
|
data/bin/iload
CHANGED
@@ -84,10 +84,10 @@ EXAMPLES
|
|
84
84
|
-------------------------------------------------------
|
85
85
|
Load data from text file and store to a table name "vendors"
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
87
|
+
iload --host=localhost --username=postgres --password=postgres \\
|
88
|
+
--database=db --table=vendors \\
|
89
|
+
--input=/home/administrator/VendorMaster.txt \\
|
90
|
+
--format=CSV --delim=$'\\t'
|
91
91
|
|
92
92
|
|
93
93
|
eos
|
data/bin/ipatch
CHANGED
@@ -55,8 +55,8 @@ EXAMPLES
|
|
55
55
|
-------------------------------------------------------
|
56
56
|
Send custom SQL to a data table
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
ipatch --host=localhost --username=postgres --password=postgres --database=db \\
|
59
|
+
--query="ALTER TABLE vendors ADD COLUMN tmp text; UPDATE vendors SET tmp = vendor_number"
|
60
60
|
|
61
61
|
eos
|
62
62
|
end
|
@@ -104,4 +104,4 @@ ActiveRecord::Base.establish_connection(
|
|
104
104
|
# Execute the query, use it at your own risk!!!
|
105
105
|
ActiveRecord::Base.connection.execute($options[:query])
|
106
106
|
|
107
|
-
puts "\nDone!\n\n"
|
107
|
+
puts "\nDone!\n\n"
|
data/bin/ivalidate
CHANGED
@@ -93,17 +93,17 @@ EXAMPLES
|
|
93
93
|
-------------------------------------------------------
|
94
94
|
Validate `mfrs` table against several rules and write error logs to errors field:
|
95
95
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
96
|
+
ivalidate -h localhost -u postgres -p postgres -d db \\
|
97
|
+
--table=mfrs \\
|
98
|
+
--log-to=errors \\
|
99
|
+
--unique="mfr_lic" \\
|
100
|
+
--unique="mfr_number" \\
|
101
|
+
--not-null="mfr_number" \\
|
102
|
+
--not-null="mfr_lic" \\
|
103
|
+
--match="mfr_number/^2.*" \\
|
104
|
+
--match="mfr_name/^[a-zA-Z]+/" \\
|
105
|
+
--not-match="status/(failed|inactive|wrong)/" \\
|
106
|
+
--query="start_date <= end_date"
|
107
107
|
|
108
108
|
eos
|
109
109
|
end
|
data/lib/idata/version.rb
CHANGED