samidare 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +15 -14
- data/README.md +80 -45
- data/lib/samidare/version.rb +1 -1
- data/samidare.gemspec +1 -1
- metadata +4 -4
- data/.travis.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cebd0e6fe168080a1c3e36dc9299564b0fbeee72
|
4
|
+
data.tar.gz: b2bacde505cd91182e92592d3e8835dea8055fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d2564ddc962b6ce9fcbcbd1a75cb6530eff6f77cca2d3a326ff337680a26be43f55595b10d125e7d88c6aeef8123d1ace470afa3883af98083483732a34c93b
|
7
|
+
data.tar.gz: 1b4174505b57d13c5a484af60015e81d8913edfa700147e9068d8c77aab7e15bd5e2280d5dca6cd0e9e9a34cab20c18bb365e58b2abe7c592e3433a32d7e6cac
|
data/.gitignore
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/Gemfile.lock
|
4
|
-
/_yardoc/
|
5
|
-
/coverage/
|
6
|
-
/doc/
|
7
|
-
/pkg/
|
8
|
-
/spec/reports/
|
9
|
-
/tmp/
|
10
|
-
*.bundle
|
11
|
-
*.so
|
12
|
-
*.o
|
13
|
-
*.a
|
14
|
-
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/spec/reports/
|
9
|
+
/tmp/
|
10
|
+
*.bundle
|
11
|
+
*.so
|
12
|
+
*.o
|
13
|
+
*.a
|
14
|
+
.rspec
|
15
|
+
mkmf.log
|
data/README.md
CHANGED
@@ -1,45 +1,80 @@
|
|
1
|
-
# Samidare
|
2
|
-
|
3
|
-
Generate Embulk config and BigQuery schema from MySQL schema and run Embulk.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'samidare'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install samidare
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
1
|
+
# Samidare
|
2
|
+
|
3
|
+
Generate Embulk config and BigQuery schema from MySQL schema and run Embulk.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'samidare'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install samidare
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
Require `database.yml` and `table.yml`.
|
23
|
+
Below is a sample config file.
|
24
|
+
|
25
|
+
#### database.yml
|
26
|
+
```yml
|
27
|
+
db01:
|
28
|
+
host: localhost
|
29
|
+
username: root
|
30
|
+
password:
|
31
|
+
database: production
|
32
|
+
bq_dataset: mysql_db01
|
33
|
+
|
34
|
+
db02:
|
35
|
+
host: localhost
|
36
|
+
username: root
|
37
|
+
password:
|
38
|
+
database: production
|
39
|
+
bq_dataset: mysql_db02
|
40
|
+
|
41
|
+
```
|
42
|
+
|
43
|
+
#### table.yml
|
44
|
+
```yml
|
45
|
+
db01:
|
46
|
+
tables:
|
47
|
+
- name: users
|
48
|
+
- name: events
|
49
|
+
- name: hobbies
|
50
|
+
|
51
|
+
db02:
|
52
|
+
tables:
|
53
|
+
- name: administrators
|
54
|
+
- name: configs
|
55
|
+
```
|
56
|
+
|
57
|
+
Samidare requires BigQuery parameters.
|
58
|
+
```ruby
|
59
|
+
config = {
|
60
|
+
'project_id' => 'BIGQUERY_PROJECT_ID',
|
61
|
+
'project_name' => 'BIGQUERY_PROJECT_NAME',
|
62
|
+
'service_email' => 'SERVICE_ACCOUNT_EMAIL',
|
63
|
+
'key' => '/etc/embulk/bigquery.p12',
|
64
|
+
'schema_dir' => '/var/tmp/embulk/schema',
|
65
|
+
'config_dir' => '/var/tmp/embulk/config',
|
66
|
+
'auth_method' => 'private_key'
|
67
|
+
}
|
68
|
+
|
69
|
+
client = Samidare::EmbulkClient.new
|
70
|
+
client.generate_config(config)
|
71
|
+
client.run(config)
|
72
|
+
```
|
73
|
+
|
74
|
+
## Contributing
|
75
|
+
|
76
|
+
1. Fork it ( https://github.com/[my-github-username]/samidare/fork )
|
77
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
78
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
79
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
80
|
+
5. Create a new Pull Request
|
data/lib/samidare/version.rb
CHANGED
data/samidare.gemspec
CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
22
22
|
spec.add_development_dependency 'rake', '~> 10.0'
|
23
23
|
spec.add_development_dependency 'rspec'
|
24
|
-
spec.add_development_dependency 'unindent'
|
25
24
|
|
25
|
+
spec.add_dependency 'unindent'
|
26
26
|
spec.add_dependency 'mysql2-cs-bind'
|
27
27
|
spec.add_dependency 'embulk-output-bigquery'
|
28
28
|
spec.add_dependency 'embulk-input-mysql'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samidare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryoji Kobori
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
type: :
|
62
|
+
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
@@ -173,7 +173,6 @@ extra_rdoc_files: []
|
|
173
173
|
files:
|
174
174
|
- ".gitignore"
|
175
175
|
- ".rspec"
|
176
|
-
- ".travis.yml"
|
177
176
|
- Gemfile
|
178
177
|
- LICENSE.txt
|
179
178
|
- README.md
|
@@ -216,3 +215,4 @@ test_files:
|
|
216
215
|
- spec/samidare/embulk_utility_spec.rb
|
217
216
|
- spec/samidare_spec.rb
|
218
217
|
- spec/spec_helper.rb
|
218
|
+
has_rdoc:
|
data/.travis.yml
DELETED