idata 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README2.md +30 -0
- data/bin/iload +4 -4
- data/bin/imerge +0 -0
- data/lib/idata/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78854c8366bba688c067558f460eaebbc5e8900
|
4
|
+
data.tar.gz: 20c21a061c5366251c7074ebe9288095e8f660cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b1c1006cd1f1e9adc310e234a664e4fb9c73071f6705a96776af1122b0762e4d844d24d41da25aed47ecc036800c3110a9ae0f422bc0e9e2d69d7c4097a754
|
7
|
+
data.tar.gz: feef658f247d2ef71c34d4876490d4746fa17413a017dea7456896c3135ba27cf161f0e15eebec7ff51a87a18f9d23db84efcbabfbb4696588cb2f0f2e15104f
|
data/README2.md
CHANGED
@@ -33,5 +33,35 @@ Supported rules include:
|
|
33
33
|
| `custom query "query"` | Dùng custom SQL `query` (trong trường hợp business phức tạp không thể biểu diễn bằng các rule khác) | |
|
34
34
|
| `reverse query "query"` | Reverse counterpart của `custom query` | |
|
35
35
|
|
36
|
+
Query the validation log
|
37
|
+
=========
|
38
|
+
Look at the illustration below for the schema of `log` table
|
39
|
+
![log schema](https://s3-ap-southeast-1.amazonaws.com/mycdn1104/log.png)
|
40
|
+
#### Some common queries
|
41
|
+
List of IDL tables
|
42
|
+
```
|
43
|
+
.tables
|
44
|
+
```
|
45
|
+
List of tables and errors found
|
46
|
+
```
|
47
|
+
SELECT distinct table_name, error FROM log;
|
48
|
+
```
|
49
|
+
List of tables, errors and item count for every error
|
50
|
+
```
|
51
|
+
SELECT table_name, error, count(*) FROM log GROUP BY table_name, error;
|
52
|
+
```
|
53
|
+
List of tables and error count
|
54
|
+
```
|
55
|
+
SELECT table_name, count(DISTINCT error) FROM log GROUP BY table_name;
|
56
|
+
```
|
57
|
+
Delete `vendors` with a particular error:
|
58
|
+
```
|
59
|
+
DELETE FROM vendors WHERE rowid IN (SELECT id FROM log WHERE error = 'invalid vendor name' AND table_name = 'vendors');
|
60
|
+
```
|
61
|
+
Delete *all* `vendors` with error:
|
62
|
+
```
|
63
|
+
DELETE FROM vendors WHERE rowid IN (SELECT id FROM log WHERE table_name = 'vendors');
|
64
|
+
```
|
65
|
+
|
36
66
|
## Others
|
37
67
|
TBD
|
data/bin/iload
CHANGED
@@ -52,8 +52,8 @@ parser = OptionParser.new("", 24) do |opts|
|
|
52
52
|
$options[:table] = v
|
53
53
|
end
|
54
54
|
|
55
|
-
opts.on("--
|
56
|
-
$options[:
|
55
|
+
opts.on("--drop", "") do |v|
|
56
|
+
$options[:drop] = v
|
57
57
|
end
|
58
58
|
|
59
59
|
opts.on("-h", "--host HOST", "PostgreSQL host") do |v|
|
@@ -159,7 +159,7 @@ end
|
|
159
159
|
$options[:listen] ||= POSTGRESQL_PORT
|
160
160
|
$options[:delim] ||= CSV_DEFAULT_DELIMITER
|
161
161
|
$options[:quote] ||= CSV_DEFAULT_QUOTE
|
162
|
-
$options[:
|
162
|
+
$options[:drop] ||= false
|
163
163
|
|
164
164
|
$tmpfile = "/tmp/#{Digest::SHA1.hexdigest(rand(100000).to_s)}.csv"
|
165
165
|
|
@@ -285,7 +285,7 @@ class MyParser
|
|
285
285
|
end
|
286
286
|
|
287
287
|
# Create table
|
288
|
-
if
|
288
|
+
if $options[:drop]
|
289
289
|
drop_table_sql = "drop table if exists #{$options[:table]};"
|
290
290
|
else
|
291
291
|
drop_table_sql = ""
|
data/bin/imerge
CHANGED
File without changes
|
data/lib/idata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nghi Pham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.4.6
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Data validation utilities
|