dbx 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -0
- data/dbx_sample.yml +11 -1
- data/exe/dbx +0 -1
- data/lib/dbx/version.rb +1 -1
- data/lib/dbx.rb +2 -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: 3a9156b9797726754b8258e171e2bfd19de4ccd7
|
4
|
+
data.tar.gz: 2886905cce5b47d0b2675cf4249659de21666b22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35784e53ee334916019dfc1df50a95a5f224767242418e8f8ff2247e778699fddf3287416dc467d738325d86aa4e09d662fe8aefd4be91aa6da50d33a09ecc5b
|
7
|
+
data.tar.gz: b396f106e73027fff0a3dd6a314899bb6996bc6ef82a93c127cae5f9af8f8483fa4e7ffa134c112c68b129d13d65ff2b28f90d139711132c1b84c51fecf1a936
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,6 +24,9 @@ Options:
|
|
24
24
|
If the current path contains a `dbx.yml` file, it will be read first. Settings in the config file can still be overridden by command line arguments.
|
25
25
|
|
26
26
|
```yaml
|
27
|
+
# Database receiving the imported and diff data.
|
28
|
+
db: postgres://localhost/scratch
|
29
|
+
|
27
30
|
# Column patterns are used to override column detection based on the a matched pattern in the name.
|
28
31
|
# This is useful for things like phone numbers and zip codes where they look like numbers, but should be strings.
|
29
32
|
column_patterns:
|
data/dbx_sample.yml
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
# Database receiving the imported and diff data.
|
2
|
+
db: postgres://localhost/scratch
|
3
|
+
|
4
|
+
# Column patterns are used to override column detection based on the a matched pattern in the name.
|
5
|
+
# This is useful for things like phone numbers and zip codes where they look like numbers, but should be strings.
|
1
6
|
column_patterns:
|
2
7
|
phone_number: :string
|
3
|
-
|
8
|
+
zipcode: :string
|
9
|
+
zip_code: :string
|
10
|
+
external_ref: :string
|
11
|
+
|
12
|
+
# Number of rows to sample for type detection
|
13
|
+
sample: 100
|
data/exe/dbx
CHANGED
data/lib/dbx/version.rb
CHANGED
data/lib/dbx.rb
CHANGED
@@ -4,6 +4,7 @@ require 'csv'
|
|
4
4
|
require 'pg'
|
5
5
|
require 'active_support/all'
|
6
6
|
require 'active_record'
|
7
|
+
require 'time'
|
7
8
|
require 'pp'
|
8
9
|
|
9
10
|
require 'dbx/model_base'
|
@@ -168,7 +169,7 @@ module DBX
|
|
168
169
|
:uuid
|
169
170
|
elsif value =~ /^\d{4}(\D)\d{2}\1\d{2}$/ && (Date.parse(value) rescue false)
|
170
171
|
:date
|
171
|
-
elsif (Time.
|
172
|
+
elsif (Time.parse(value) rescue false)
|
172
173
|
:datetime
|
173
174
|
else
|
174
175
|
:string
|