embulk-output-postgresql 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/classpath/{embulk-output-jdbc-0.8.0.jar → embulk-output-jdbc-0.8.1.jar} +0 -0
- data/classpath/{embulk-output-postgresql-0.8.0.jar → embulk-output-postgresql-0.8.1.jar} +0 -0
- data/src/main/java/org/embulk/output/postgresql/AbstractPostgreSQLCopyBatchInsert.java +22 -23
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af8261336ec55553b78ff5201a258a2ecd6bdf2
|
4
|
+
data.tar.gz: ec06d9f31dde3f72a25d2c0913cea456cf264ee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 859c352ceaeb357ad27c8b574ae55d067e950fdda7b694b7eb584aa150a5b291a87644b8cd750f6fe677430eea4fe47c371d5772fee1819dc3bf73ba91f3c993
|
7
|
+
data.tar.gz: e44c3cae89f6b0a5a4c4b822fb49b1faaaa6b5e5d59d5e246f0726c80999327dd42570731c2be16ece85180b07029a8e0d39ffb19faf047773f1cf4df1a58f65
|
data/README.md
CHANGED
@@ -19,12 +19,12 @@ PostgreSQL output plugin for Embulk loads records to PostgreSQL.
|
|
19
19
|
- **schema**: destination schema name (string, default: "public")
|
20
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)
|
21
21
|
- **table**: destination table name (string, required)
|
22
|
-
- **create_table_constraint
|
23
|
-
- **create_table_option
|
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>`.
|
24
24
|
- **options**: extra connection properties (hash, default: {})
|
25
|
-
- **retry_limit
|
26
|
-
- **retry_wait
|
27
|
-
- **max_retry_wait
|
25
|
+
- **retry_limit**: max retry count for database operations (integer, default: 12)
|
26
|
+
- **retry_wait**: initial retry wait time in milliseconds (integer, default: 1000 (1 second))
|
27
|
+
- **max_retry_wait**: upper limit of retry wait, which will be doubled at every retry (integer, default: 1800000 (30 minutes))
|
28
28
|
- **mode**: "insert", "insert_direct", "truncate_insert", "replace", "merge" or "merge_direct". See below. (string, required)
|
29
29
|
- **merge_keys**: key column names for merging records in merge mode (string array, required in merge mode if table doesn't have primary key)
|
30
30
|
- **merge_rule**: list of column assignments for updating existing records used in merge mode, for example `foo = foo + S.foo` (`S` means source table). (string array, default: always overwrites with new values)
|
Binary file
|
Binary file
|
@@ -212,31 +212,30 @@ public abstract class AbstractPostgreSQLCopyBatchInsert
|
|
212
212
|
writer.write(f);
|
213
213
|
}
|
214
214
|
|
215
|
+
private void setEscapedString(String v) throws IOException
|
216
|
+
{
|
217
|
+
for (char c : v.toCharArray()) {
|
218
|
+
writer.write(escape(c));
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
215
222
|
// Escape \, \n, \t, \r
|
216
223
|
// Remove \0
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
break;
|
233
|
-
case 0:
|
234
|
-
s = "";
|
235
|
-
break;
|
236
|
-
default:
|
237
|
-
s = String.valueOf(c);
|
238
|
-
}
|
239
|
-
writer.write(s);
|
224
|
+
protected String escape(char c)
|
225
|
+
{
|
226
|
+
switch (c) {
|
227
|
+
case '\\':
|
228
|
+
return "\\\\";
|
229
|
+
case '\n':
|
230
|
+
return "\\n";
|
231
|
+
case '\t':
|
232
|
+
return "\\t";
|
233
|
+
case '\r':
|
234
|
+
return "\\r";
|
235
|
+
case 0:
|
236
|
+
return "";
|
237
|
+
default:
|
238
|
+
return String.valueOf(c);
|
240
239
|
}
|
241
240
|
}
|
242
241
|
}
|
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.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to a table.
|
14
14
|
email:
|
@@ -19,8 +19,8 @@ extra_rdoc_files: []
|
|
19
19
|
files:
|
20
20
|
- README.md
|
21
21
|
- build.gradle
|
22
|
-
- classpath/embulk-output-jdbc-0.8.
|
23
|
-
- classpath/embulk-output-postgresql-0.8.
|
22
|
+
- classpath/embulk-output-jdbc-0.8.1.jar
|
23
|
+
- classpath/embulk-output-postgresql-0.8.1.jar
|
24
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
|