embulk-input-mysql 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f6b0c72a7b98f597545f65b4881e9e4715c5e74
4
- data.tar.gz: b5fb544d36f962e01afbf6bd64c8e0f2f80c8834
3
+ metadata.gz: e6aaa4f79e7be806a6183476cfc4d2b583f67eea
4
+ data.tar.gz: 047dd494f0347cef54dc8e094eed573f097dbed8
5
5
  SHA512:
6
- metadata.gz: 1d91da9ffbb27b8233a017e7ecae285c009a53a8d25048e825fda05e37dcee785547d09c504a47a08fc141ed3accf260e1abd814662b8edab5b98bb5676dc8c0
7
- data.tar.gz: 4597a996b6e5fd07349d75c81b49a98d96ed9994bc5eb699445056bbd7e53c60122b2d6d2e6e67ab18e33abe68473dbbe84170772c35b84754a18d70f33fd4c1
6
+ metadata.gz: 597fde820844a9fd20de5a31f506a2cafa5a573e0cd62e15a2c0739d0ab0109bae64ebcbfa5dc9bd243ffe909067268940385cd6149d472c495d9b193efcf8cd
7
+ data.tar.gz: 34171b7c365b584e87f2e39a8b2c6f73089ffdac0cd201da412ecfe05ff2995abb079e060ed504d26536f32ca0eb836d6b8a10d71393865fe202e7fbc78f2bb2
data/README.md CHANGED
@@ -36,13 +36,14 @@ MySQL input plugins for Embulk loads records from MySQL.
36
36
  - **default_timezone**: If the sql type of a column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted int this default_timezone. You can overwrite timezone for each columns using column_options option. (string, default: `UTC`)
37
37
  - **column_options**: advanced: a key-value pairs where key is a column name and value is options for the column.
38
38
  - **value_type**: embulk get values from database as this value_type. Typically, the value_type determines `getXXX` method of `java.sql.PreparedStatement`.
39
- (string, default: depends on the sql type of the column. Available values options are: `long`, `double`, `float`, `decimal`, `boolean`, `string`, `date`, `time`, `timestamp`)
39
+ (string, default: depends on the sql type of the column. Available values options are: `long`, `double`, `float`, `decimal`, `boolean`, `string`, `json`, `date`, `time`, `timestamp`)
40
40
  - **type**: Column values are converted to this embulk type.
41
- Available values options are: `boolean`, `long`, `double`, `string`, `timestamp`).
41
+ Available values options are: `boolean`, `long`, `double`, `string`, `json`, `timestamp`).
42
42
  By default, the embulk type is determined according to the sql type of the column (or value_type if specified).
43
43
  - **timestamp_format**: If the sql type of the column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted by this timestamp_format. And if the embulk type is `timestamp`, this timestamp_format may be used in the output plugin. For example, stdout plugin use the timestamp_format, but *csv formatter plugin doesn't use*. (string, default : `%Y-%m-%d` for `date`, `%H:%M:%S` for `time`, `%Y-%m-%d %H:%M:%S` for `timestamp`)
44
44
  - **timezone**: If the sql type of the column is `date`/`time`/`datetime` and the embulk type is `string`, column values are formatted in this timezone.
45
45
  (string, value of default_timezone option is used by default)
46
+ - **after_select**: if set, this SQL will be executed after the SELECT query in the same transaction.
46
47
 
47
48
  ## Example
48
49
 
@@ -89,6 +90,7 @@ in:
89
90
  column_options:
90
91
  col1: {type: long}
91
92
  col3: {type: string, timestamp_format: "%Y/%m/%d", timezone: "+0900"}
93
+ after_select: "update my_table set col5 = '1' where col4 != 'a'"
92
94
 
93
95
  ```
94
96
 
data/build.gradle CHANGED
@@ -3,6 +3,6 @@ dependencies {
3
3
 
4
4
  compile 'mysql:mysql-connector-java:5.1.34'
5
5
 
6
- testCompile 'org.embulk:embulk-standards:0.8.0'
6
+ testCompile 'org.embulk:embulk-standards:0.8.8'
7
7
  testCompile project(':embulk-input-jdbc').sourceSets.test.output
8
8
  }
@@ -14,6 +14,7 @@ import java.sql.Statement;
14
14
  import java.util.Arrays;
15
15
  import java.util.List;
16
16
 
17
+ import org.embulk.input.EmbulkPluginTester;
17
18
  import org.embulk.input.MySQLInputPlugin;
18
19
  import org.embulk.spi.InputPlugin;
19
20
  import org.junit.AfterClass;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-15 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Selects records from a table.
14
14
  email:
@@ -22,7 +22,6 @@ files:
22
22
  - lib/embulk/input/mysql.rb
23
23
  - src/main/java/org/embulk/input/MySQLInputPlugin.java
24
24
  - src/main/java/org/embulk/input/mysql/MySQLInputConnection.java
25
- - src/test/java/org/embulk/input/mysql/EmbulkPluginTester.java
26
25
  - src/test/java/org/embulk/input/mysql/MySQLInputPluginTest.java
27
26
  - src/test/resources/yml/input-boolean.yml
28
27
  - src/test/resources/yml/input-double.yml
@@ -34,8 +33,8 @@ files:
34
33
  - src/test/resources/yml/input-valuetype-decimal.yml
35
34
  - src/test/resources/yml/input-valuetype-string.yml
36
35
  - src/test/resources/yml/input.yml
37
- - classpath/embulk-input-jdbc-0.6.4.jar
38
- - classpath/embulk-input-mysql-0.6.4.jar
36
+ - classpath/embulk-input-jdbc-0.7.0.jar
37
+ - classpath/embulk-input-mysql-0.7.0.jar
39
38
  - classpath/mysql-connector-java-5.1.34.jar
40
39
  homepage: https://github.com/embulk/embulk-input-jdbc
41
40
  licenses:
@@ -1,79 +0,0 @@
1
- package org.embulk.input.mysql;
2
-
3
- import java.io.File;
4
- import java.util.ArrayList;
5
- import java.util.List;
6
-
7
- import org.embulk.EmbulkEmbed;
8
- import org.embulk.EmbulkEmbed.Bootstrap;
9
- import org.embulk.config.ConfigSource;
10
- import org.embulk.plugin.InjectedPluginSource;
11
-
12
- import com.google.inject.Binder;
13
- import com.google.inject.Module;
14
-
15
- public class EmbulkPluginTester
16
- {
17
- private static class PluginDefinition
18
- {
19
- public final Class<?> iface;
20
- public final String name;
21
- public final Class<?> impl;
22
-
23
-
24
- public PluginDefinition(Class<?> iface, String name, Class<?> impl)
25
- {
26
- this.iface = iface;
27
- this.name = name;
28
- this.impl = impl;
29
- }
30
-
31
- }
32
-
33
- private final List<PluginDefinition> plugins = new ArrayList<PluginDefinition>();
34
-
35
- private EmbulkEmbed embulk;
36
-
37
- public EmbulkPluginTester()
38
- {
39
- }
40
-
41
- public EmbulkPluginTester(Class<?> iface, String name, Class<?> impl)
42
- {
43
- addPlugin(iface, name, impl);
44
- }
45
-
46
- public void addPlugin(Class<?> iface, String name, Class<?> impl)
47
- {
48
- plugins.add(new PluginDefinition(iface, name, impl));
49
- }
50
-
51
- public void run(String ymlPath) throws Exception
52
- {
53
- if (embulk == null) {
54
- Bootstrap bootstrap = new EmbulkEmbed.Bootstrap();
55
- bootstrap.addModules(new Module()
56
- {
57
- @Override
58
- public void configure(Binder binder)
59
- {
60
- for (PluginDefinition plugin : plugins) {
61
- InjectedPluginSource.registerPluginTo(binder, plugin.iface, plugin.name, plugin.impl);
62
- }
63
- }
64
- });
65
- embulk = bootstrap.initializeCloseable();
66
- }
67
-
68
- ConfigSource config = embulk.newConfigLoader().fromYamlFile(new File(ymlPath));
69
- embulk.run(config);
70
- }
71
-
72
- public void destroy() {
73
- if (embulk != null) {
74
- embulk.destroy();
75
- embulk = null;
76
- }
77
- }
78
-
79
- }