embulk-input-postgresql 0.8.4 → 0.8.5
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 +1 -0
- data/build.gradle +1 -0
- data/classpath/{embulk-input-jdbc-0.8.4.jar → embulk-input-jdbc-0.8.5.jar} +0 -0
- data/classpath/{embulk-input-postgresql-0.8.4.jar → embulk-input-postgresql-0.8.5.jar} +0 -0
- data/{classpath → default_jdbc_driver}/postgresql-9.4-1205-jdbc41.jar +0 -0
- data/src/main/java/org/embulk/input/PostgreSQLInputPlugin.java +10 -6
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c0715712d158b155fdec049b1d902ad2c73286
|
4
|
+
data.tar.gz: 7d9c2e7114cc14883303756a2810111c151237c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d1012d143bf14b25ef74805e7784da11a6dd1b39e6da8fe4c17108aba4c204799d1326716fdfd3a161f6f022db073d71692c174a8f3fbcfa3bd3b8fedacdade
|
7
|
+
data.tar.gz: 02c1db91904b99b8305c9bd9e057cfd6b498daadc652fac00b2edfd343908e2fbc8684bf33b953627f7659c486b52343f8c0d883cb8cc0e721c74051ed299a61
|
data/README.md
CHANGED
@@ -9,6 +9,7 @@ PostgreSQL input plugin for Embulk loads records from PostgreSQL.
|
|
9
9
|
|
10
10
|
## Configuration
|
11
11
|
|
12
|
+
- **driver_path**: path to the jar file of the PostgreSQL JDBC driver. If not set, the bundled JDBC driver (PostgreSQL JDBC Driver 9.4-1205) will be used. (string)
|
12
13
|
- **host**: database host name (string, required)
|
13
14
|
- **port**: database port number (integer, 5432)
|
14
15
|
- **user**: database login user name (string, required)
|
data/build.gradle
CHANGED
Binary file
|
Binary file
|
File without changes
|
@@ -1,29 +1,31 @@
|
|
1
1
|
package org.embulk.input;
|
2
2
|
|
3
|
-
import java.util.Map;
|
4
3
|
import java.util.Properties;
|
5
4
|
import java.sql.Connection;
|
6
|
-
import java.sql.
|
5
|
+
import java.sql.DriverManager;
|
7
6
|
import java.sql.SQLException;
|
8
7
|
|
9
8
|
import org.embulk.config.Config;
|
10
9
|
import org.embulk.config.ConfigDefault;
|
11
10
|
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
|
12
|
-
import org.embulk.input.jdbc.JdbcColumnOption;
|
13
11
|
import org.embulk.input.jdbc.getter.ColumnGetterFactory;
|
14
12
|
import org.embulk.input.postgresql.PostgreSQLInputConnection;
|
15
13
|
import org.embulk.input.postgresql.getter.PostgreSQLColumnGetterFactory;
|
16
14
|
import org.embulk.spi.PageBuilder;
|
17
15
|
import org.joda.time.DateTimeZone;
|
18
16
|
|
17
|
+
import com.google.common.base.Optional;
|
18
|
+
|
19
19
|
public class PostgreSQLInputPlugin
|
20
20
|
extends AbstractJdbcInputPlugin
|
21
21
|
{
|
22
|
-
private static final Driver driver = new org.postgresql.Driver();
|
23
|
-
|
24
22
|
public interface PostgreSQLPluginTask
|
25
23
|
extends PluginTask
|
26
24
|
{
|
25
|
+
@Config("driver_path")
|
26
|
+
@ConfigDefault("null")
|
27
|
+
public Optional<String> getDriverPath();
|
28
|
+
|
27
29
|
@Config("host")
|
28
30
|
public String getHost();
|
29
31
|
|
@@ -65,6 +67,8 @@ public class PostgreSQLInputPlugin
|
|
65
67
|
{
|
66
68
|
PostgreSQLPluginTask t = (PostgreSQLPluginTask) task;
|
67
69
|
|
70
|
+
loadDriver("org.postgresql.Driver", t.getDriverPath());
|
71
|
+
|
68
72
|
String url = String.format("jdbc:postgresql://%s:%d/%s",
|
69
73
|
t.getHost(), t.getPort(), t.getDatabase());
|
70
74
|
|
@@ -90,7 +94,7 @@ public class PostgreSQLInputPlugin
|
|
90
94
|
|
91
95
|
props.putAll(t.getOptions());
|
92
96
|
|
93
|
-
Connection con =
|
97
|
+
Connection con = DriverManager.getConnection(url, props);
|
94
98
|
try {
|
95
99
|
PostgreSQLInputConnection c = new PostgreSQLInputConnection(con, t.getSchema());
|
96
100
|
con = null;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Selects records from a table.
|
14
14
|
email:
|
@@ -19,9 +19,9 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- README.md
|
21
21
|
- build.gradle
|
22
|
-
- classpath/embulk-input-jdbc-0.8.
|
23
|
-
- classpath/embulk-input-postgresql-0.8.
|
24
|
-
-
|
22
|
+
- classpath/embulk-input-jdbc-0.8.5.jar
|
23
|
+
- classpath/embulk-input-postgresql-0.8.5.jar
|
24
|
+
- default_jdbc_driver/postgresql-9.4-1205-jdbc41.jar
|
25
25
|
- lib/embulk/input/postgresql.rb
|
26
26
|
- src/main/java/org/embulk/input/PostgreSQLInputPlugin.java
|
27
27
|
- src/main/java/org/embulk/input/postgresql/PostgreSQLInputConnection.java
|