embulk-output-postgresql 0.7.12 → 0.7.13
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 +3 -0
- data/build.gradle +1 -0
- data/classpath/embulk-output-jdbc-0.7.13.jar +0 -0
- data/classpath/{embulk-output-postgresql-0.7.12.jar → embulk-output-postgresql-0.7.13.jar} +0 -0
- data/{classpath → default_jdbc_driver}/postgresql-9.4-1205-jdbc41.jar +0 -0
- data/src/main/java/org/embulk/output/PostgreSQLOutputPlugin.java +7 -1
- data/src/main/java/org/embulk/output/postgresql/PostgreSQLOutputConnector.java +3 -4
- metadata +5 -5
- data/classpath/embulk-output-jdbc-0.7.12.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9db342e9dcc2fd4352de1de73c59036f279f43cd
|
4
|
+
data.tar.gz: 0fa9050578f3cef664a324810b27054aa190e78b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633d0743891e46768b60699e1ea346e4b5de288076c7b2b148b57039c2264edbec27e2e1706a5ed54e5aac78084c525d9c7c142d0159964ae731e940914e1ccb
|
7
|
+
data.tar.gz: 1133ad94178b49258423481ead37404a6f49d8c871aeaca4c9d40d283b143c3c14253ab4620f16e833042f273cc89f53231bd441349b4d9032ebfb4354e8172c
|
data/README.md
CHANGED
@@ -10,6 +10,7 @@ PostgreSQL output plugin for Embulk loads records to PostgreSQL.
|
|
10
10
|
|
11
11
|
## Configuration
|
12
12
|
|
13
|
+
- **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)
|
13
14
|
- **host**: database host name (string, required)
|
14
15
|
- **port**: database port number (integer, default: 5432)
|
15
16
|
- **user**: database login user name (string, required)
|
@@ -18,6 +19,8 @@ PostgreSQL output plugin for Embulk loads records to PostgreSQL.
|
|
18
19
|
- **schema**: destination schema name (string, default: "public")
|
19
20
|
- **temp_schema**: schema name for intermediate tables. by default, intermediate tables will be created in the schema specified by `schema`. replace mode doesn't support temp_schema. (string, optional)
|
20
21
|
- **table**: destination table name (string, required)
|
22
|
+
- **create_table_constraint** table constraint added to `CREATE TABLE` statement, like `CREATE TABLE <table_name> (<column1> <type1>, <column2> <type2>, ..., <create_table_constraint>) <create_table_option>`.
|
23
|
+
- **create_table_option** table option added to `CREATE TABLE` statement, like `CREATE TABLE <table_name> (<column1> <type1>, <column2> <type2>, ..., <create_table_constraint>) <create_table_option>`.
|
21
24
|
- **options**: extra connection properties (hash, default: {})
|
22
25
|
- **retry_limit** max retry count for database operations (integer, default: 12)
|
23
26
|
- **retry_wait** initial retry wait time in milliseconds (integer, default: 1000 (1 second))
|
data/build.gradle
CHANGED
Binary file
|
Binary file
|
File without changes
|
@@ -27,6 +27,10 @@ public class PostgreSQLOutputPlugin
|
|
27
27
|
public interface PostgreSQLPluginTask
|
28
28
|
extends PluginTask
|
29
29
|
{
|
30
|
+
@Config("driver_path")
|
31
|
+
@ConfigDefault("null")
|
32
|
+
public Optional<String> getDriverPath();
|
33
|
+
|
30
34
|
@Config("host")
|
31
35
|
public String getHost();
|
32
36
|
|
@@ -67,7 +71,7 @@ public class PostgreSQLOutputPlugin
|
|
67
71
|
protected Features getFeatures(PluginTask task)
|
68
72
|
{
|
69
73
|
return new Features()
|
70
|
-
.setMaxTableNameLength(
|
74
|
+
.setMaxTableNameLength(63)
|
71
75
|
.setSupportedModes(ImmutableSet.of(Mode.INSERT, Mode.INSERT_DIRECT, Mode.MERGE, Mode.MERGE_DIRECT, Mode.TRUNCATE_INSERT, Mode.REPLACE))
|
72
76
|
.setIgnoreMergeKeys(false);
|
73
77
|
}
|
@@ -77,6 +81,8 @@ public class PostgreSQLOutputPlugin
|
|
77
81
|
{
|
78
82
|
PostgreSQLPluginTask t = (PostgreSQLPluginTask) task;
|
79
83
|
|
84
|
+
loadDriver("org.postgresql.Driver", t.getDriverPath());
|
85
|
+
|
80
86
|
String url = String.format("jdbc:postgresql://%s:%d/%s",
|
81
87
|
t.getHost(), t.getPort(), t.getDatabase());
|
82
88
|
|
@@ -1,16 +1,15 @@
|
|
1
1
|
package org.embulk.output.postgresql;
|
2
2
|
|
3
3
|
import java.util.Properties;
|
4
|
-
import java.sql.Driver;
|
5
4
|
import java.sql.Connection;
|
5
|
+
import java.sql.DriverManager;
|
6
6
|
import java.sql.SQLException;
|
7
|
+
|
7
8
|
import org.embulk.output.jdbc.JdbcOutputConnector;
|
8
9
|
|
9
10
|
public class PostgreSQLOutputConnector
|
10
11
|
implements JdbcOutputConnector
|
11
12
|
{
|
12
|
-
private static final Driver driver = new org.postgresql.Driver();
|
13
|
-
|
14
13
|
private final String url;
|
15
14
|
private final Properties properties;
|
16
15
|
private final String schemaName;
|
@@ -25,7 +24,7 @@ public class PostgreSQLOutputConnector
|
|
25
24
|
@Override
|
26
25
|
public PostgreSQLOutputConnection connect(boolean autoCommit) throws SQLException
|
27
26
|
{
|
28
|
-
Connection c =
|
27
|
+
Connection c = DriverManager.getConnection(url, properties);
|
29
28
|
try {
|
30
29
|
PostgreSQLOutputConnection con = new PostgreSQLOutputConnection(c, schemaName, autoCommit);
|
31
30
|
c = null;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.13
|
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-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to 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-output-jdbc-0.7.
|
23
|
-
- classpath/embulk-output-postgresql-0.7.
|
24
|
-
-
|
22
|
+
- classpath/embulk-output-jdbc-0.7.13.jar
|
23
|
+
- classpath/embulk-output-postgresql-0.7.13.jar
|
24
|
+
- default_jdbc_driver/postgresql-9.4-1205-jdbc41.jar
|
25
25
|
- lib/embulk/output/postgresql.rb
|
26
26
|
- src/main/java/org/embulk/output/PostgreSQLOutputPlugin.java
|
27
27
|
- src/main/java/org/embulk/output/postgresql/AbstractPostgreSQLCopyBatchInsert.java
|
Binary file
|