schema_extractor 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -5
- data/lib/schema_extractor/mysql/extractor.rb +6 -6
- data/lib/schema_extractor/version.rb +1 -1
- data/schema_extractor.gemspec +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: 90ee6103676996cfefaffca5e0b3f2644547b3f0
|
4
|
+
data.tar.gz: 0044c7a2680b9d40d4ce281e3b56f74ad9cb73f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fffd16573e54f9967c3d256313763a57efcc16a20f9fd23b6931348f106ec5553b4aa59afe857722a036f07c2da6b857019ff5e6f9cb0c2351be009767c7a6da
|
7
|
+
data.tar.gz: c9354a30e7e479075a03218db93534b11b5ebcf22b60f1c3512389bf2ebdc387ebd34283b3445ad9c4d511d8630d72deb53b7002f54cebc1a2e6cae0c1f916ad
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# SchemaExtractor
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Extract DB schema and output as specific format.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,7 +20,26 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
```bash
|
24
|
+
$ exe/schema_extractor --help
|
25
|
+
usage: schema_extractor [options]
|
26
|
+
-s, --source Source database type. Supported sources: mysql
|
27
|
+
-f, --format Output format. Supported formats: bq, bigquery
|
28
|
+
-o, --output Output directory.
|
29
|
+
-h, --host Host of database.
|
30
|
+
-u, --user User of database.
|
31
|
+
-p, --password Password of database.
|
32
|
+
-P, --port Port of database.
|
33
|
+
-d, --database Database name.
|
34
|
+
-v, --version Show version.
|
35
|
+
--help Show this message.
|
36
|
+
```
|
37
|
+
|
38
|
+
Example:
|
39
|
+
|
40
|
+
```bash
|
41
|
+
$ schema_extractor -s mysql -f bigquery -h 127.0.0.1 -u dbuser -d mydb -p dbpass -o tmp
|
42
|
+
```
|
26
43
|
|
27
44
|
## Development
|
28
45
|
|
@@ -32,7 +49,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
49
|
|
33
50
|
## Contributing
|
34
51
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/nownabe/schema_extractor.
|
36
53
|
|
37
54
|
|
38
55
|
## License
|
@@ -62,17 +62,17 @@ module SchemaExtractor
|
|
62
62
|
|
63
63
|
def detect_type(row)
|
64
64
|
case row["Type"]
|
65
|
-
when /^date
|
65
|
+
when /^date$/
|
66
66
|
:date
|
67
|
-
when /^datetime
|
67
|
+
when /^datetime$/
|
68
68
|
:datetime
|
69
|
-
when /^decimal
|
69
|
+
when /^decimal\(\d+,\d+\)$/
|
70
70
|
:decimal
|
71
|
-
when /^float
|
71
|
+
when /^float$/
|
72
72
|
:float
|
73
|
-
when /^bigint
|
73
|
+
when /^bigint\(\d+\)$/, /^int\(\d+\)$/, /^smallint\(\d+\)$/, /^tinyint\(\d+\)$/
|
74
74
|
:integer
|
75
|
-
when /^longtext
|
75
|
+
when /^longtext$/, /^text$/, /^varchar\(\d+\)$/
|
76
76
|
:string
|
77
77
|
else
|
78
78
|
raise UnknownFieldTypeError, "#{row['Type']} is unknown type."
|
data/schema_extractor.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ["nownabe"]
|
11
11
|
spec.email = ["nownabe@gmail.com"]
|
12
12
|
|
13
|
-
spec.summary = "Extract DB schema."
|
13
|
+
spec.summary = "Extract DB schema as output as specific format."
|
14
14
|
spec.homepage = "https://github.com/nownabe/schema_extractor"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nownabe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,5 +131,5 @@ rubyforge_project:
|
|
131
131
|
rubygems_version: 2.6.11
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
|
-
summary: Extract DB schema.
|
134
|
+
summary: Extract DB schema as output as specific format.
|
135
135
|
test_files: []
|