embulk-input-mysql 0.3.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1563f9a4c9fdb1322b933d81c68b64a886e804db
4
- data.tar.gz: 38eb126ea3df749ac37661d04d19c510842b7d4f
3
+ metadata.gz: 894630bc9b082bbce1757def7940a7b46a915643
4
+ data.tar.gz: 2584c68fd8b44cbe5b9724e2b0f79c1755d61fee
5
5
  SHA512:
6
- metadata.gz: 9e077bc4ffb80e9a6179def26c1ae3d5ac796707548e6868bfae34677889c4a6229a518a46f024c49ed90a2b20e330c9ce7c432e19421e434ad7c7bcd962e643
7
- data.tar.gz: 38e6f22cf05ad7ee8d6eb753304241c0fbd733afacc55d867563e8b0866573773adf5c6ccb2822c3e46a86ca35fb6553d7c1df7ee71394990a440c62da45e48b
6
+ metadata.gz: 2f98d8679f3c6f42e4d5dadaa303a3ff2622d5980c1d0aa30ebd542331d006bcc62c13b874550699efe3dc5cf925d52a29907a040ac6727e91e943563062b7ac
7
+ data.tar.gz: 2133d6baa284f7c923e91b8309f86699805ac542a53a43b58473179733194a5d81ab87e74ae8597a5d89e4c9b3f66d0bb0f145e61ba880be1aa3cf8ebd66a59b
data/README.md CHANGED
@@ -14,9 +14,12 @@ MySQL input plugins for Embulk loads records from MySQL.
14
14
  - **user**: database login user name (string, required)
15
15
  - **password**: database login password (string, default: "")
16
16
  - **database**: destination database name (string, required)
17
- - **table**: destination table name (string, required)
18
- - **select**: comma-separated list of columns to select (string, default: "*")
19
- - **where**: WHERE condition to filter the rows (string, default: no-condition)
17
+ - If you write SQL directly,
18
+ - **query**: SQL to run (string)
19
+ - If **query** is not set,
20
+ - **table**: destination table name (string, required)
21
+ - **select**: comma-separated list of columns to select (string, default: "*")
22
+ - **where**: WHERE condition to filter the rows (string, default: no-condition)
20
23
  - **fetch_rows**: number of rows to fetch one time (integer, default: 10000)
21
24
  - If this value is set to > 1:
22
25
  - It uses a server-side prepared statement and fetches rows by chunks.
@@ -43,6 +46,22 @@ in:
43
46
  where: "col4 != 'a'"
44
47
  ```
45
48
 
49
+ If you need a complex SQL,
50
+
51
+ ```yaml
52
+ in:
53
+ type: mysql
54
+ host: localhost
55
+ user: myuser
56
+ password: ""
57
+ database: my_database
58
+ query: |
59
+ SELECT t1.id, t1.name, t2.id AS t2_id, t2.name AS t2_name
60
+ FROM table1 AS t1
61
+ LEFT JOIN table2 AS t2
62
+ ON t1.id = t2.t1_id
63
+ ```
64
+
46
65
  ## Build
47
66
 
48
67
  ```
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.3.0
4
+ version: 0.4.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: 2015-02-28 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Selects records from a table.
14
14
  email:
@@ -22,8 +22,8 @@ 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
- - classpath/embulk-input-jdbc-0.3.0.jar
26
- - classpath/embulk-input-mysql-0.3.0.jar
25
+ - classpath/embulk-input-jdbc-0.4.0.jar
26
+ - classpath/embulk-input-mysql-0.4.0.jar
27
27
  - classpath/mysql-connector-java-5.1.34.jar
28
28
  homepage: https://github.com/embulk/embulk-input-jdbc
29
29
  licenses: