embulk-output-db2 0.7.8 → 0.7.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2563fe3ca749d0c43f6c408aabf14917dabff24f
|
4
|
+
data.tar.gz: cf936a45ad4e340ce069be3d8678a2ff085ddfb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbc00ce94026b8262d012f32d4d9e64f041a1a860c5b1fe86d3b6368b65335b1406505f7ce259d2853ff9a858ceff7145cf48088a4668644b174444f5a9da610
|
7
|
+
data.tar.gz: 2171a5110cce5e2cf0c488a58de31e90ecdb7af7efc49c82e25725b8d05a659f047f1594fd284884a2e43eeab38f6746aa278c8d812c0e437b566e2bac67b96a
|
Binary file
|
Binary file
|
@@ -7,6 +7,7 @@ import java.sql.Statement;
|
|
7
7
|
import org.embulk.output.jdbc.JdbcColumn;
|
8
8
|
import org.embulk.output.jdbc.JdbcOutputConnection;
|
9
9
|
import org.embulk.output.jdbc.JdbcSchema;
|
10
|
+
import org.embulk.output.jdbc.TableIdentifier;
|
10
11
|
|
11
12
|
import static java.util.Locale.ENGLISH;
|
12
13
|
|
@@ -21,13 +22,13 @@ public class DB2OutputConnection
|
|
21
22
|
}
|
22
23
|
|
23
24
|
@Override
|
24
|
-
protected String buildRenameTableSql(
|
25
|
+
protected String buildRenameTableSql(TableIdentifier fromTable, TableIdentifier toTable)
|
25
26
|
{
|
26
27
|
StringBuilder sb = new StringBuilder();
|
27
28
|
sb.append("RENAME TABLE ");
|
28
|
-
sb.append(
|
29
|
+
sb.append(quoteTableIdentifier(fromTable));
|
29
30
|
sb.append(" TO ");
|
30
|
-
sb.append(
|
31
|
+
sb.append(quoteTableIdentifier(toTable));
|
31
32
|
return sb.toString();
|
32
33
|
}
|
33
34
|
|
@@ -38,15 +39,15 @@ public class DB2OutputConnection
|
|
38
39
|
}
|
39
40
|
|
40
41
|
@Override
|
41
|
-
public void dropTableIfExists(
|
42
|
+
public void dropTableIfExists(TableIdentifier table) throws SQLException
|
42
43
|
{
|
43
|
-
if (tableExists(
|
44
|
-
dropTable(
|
44
|
+
if (tableExists(table)) {
|
45
|
+
dropTable(table);
|
45
46
|
}
|
46
47
|
}
|
47
48
|
|
48
49
|
@Override
|
49
|
-
protected void dropTableIfExists(Statement stmt,
|
50
|
+
protected void dropTableIfExists(Statement stmt, TableIdentifier tableName) throws SQLException
|
50
51
|
{
|
51
52
|
if (tableExists(tableName)) {
|
52
53
|
dropTable(stmt, tableName);
|
@@ -54,18 +55,19 @@ public class DB2OutputConnection
|
|
54
55
|
}
|
55
56
|
|
56
57
|
@Override
|
57
|
-
public void createTableIfNotExists(
|
58
|
+
public void createTableIfNotExists(TableIdentifier table, JdbcSchema schema) throws SQLException
|
58
59
|
{
|
59
|
-
if (!tableExists(
|
60
|
-
createTable(
|
60
|
+
if (!tableExists(table)) {
|
61
|
+
createTable(table, schema);
|
61
62
|
}
|
62
63
|
}
|
63
64
|
|
64
|
-
|
65
|
+
@Override
|
66
|
+
public void createTable(TableIdentifier table, JdbcSchema schema) throws SQLException
|
65
67
|
{
|
66
68
|
Statement stmt = connection.createStatement();
|
67
69
|
try {
|
68
|
-
String sql = buildCreateTableSql(
|
70
|
+
String sql = buildCreateTableSql(table, schema);
|
69
71
|
executeUpdate(stmt, sql);
|
70
72
|
commitIfNecessary(connection);
|
71
73
|
} catch (SQLException ex) {
|
@@ -75,12 +77,13 @@ public class DB2OutputConnection
|
|
75
77
|
}
|
76
78
|
}
|
77
79
|
|
78
|
-
|
80
|
+
@Override
|
81
|
+
protected String buildCreateTableSql(TableIdentifier table, JdbcSchema schema)
|
79
82
|
{
|
80
83
|
StringBuilder sb = new StringBuilder();
|
81
84
|
|
82
85
|
sb.append("CREATE TABLE ");
|
83
|
-
|
86
|
+
quoteTableIdentifier(sb, table);
|
84
87
|
sb.append(buildCreateTableSchemaSql(schema));
|
85
88
|
return sb.toString();
|
86
89
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-db2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.9
|
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-06-23 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-db2-0.7.
|
23
|
-
- classpath/embulk-output-jdbc-0.7.
|
22
|
+
- classpath/embulk-output-db2-0.7.9.jar
|
23
|
+
- classpath/embulk-output-jdbc-0.7.9.jar
|
24
24
|
- lib/embulk/output/db2.rb
|
25
25
|
- out/test/db2/data/test-char.csv
|
26
26
|
- out/test/db2/data/test-datetime.csv
|
Binary file
|