embulk-output-db2 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2daccdfc3ab77cd5d9352b92d21d25d96712e5ff
4
- data.tar.gz: c85dd6c407c332362ade9994f97fa49f75c445d0
3
+ metadata.gz: 2563fe3ca749d0c43f6c408aabf14917dabff24f
4
+ data.tar.gz: cf936a45ad4e340ce069be3d8678a2ff085ddfb2
5
5
  SHA512:
6
- metadata.gz: 1ba0dc4322b47e23deecc49df2dd7cc9b5ad9f7ec0d6f35eb433279cdc39407d1ec7af1c5fe2609fddfecef795dda34793a8571904571e5561cb979fb05a74c5
7
- data.tar.gz: 7acc23c7ddc54e57412e877824967e123e6f4135fb12de3198b2645ee4debc635927096e146d483f51fafe3288e35e8b66fe0eeee9cc57979a28935a1d4f064e
6
+ metadata.gz: fbc00ce94026b8262d012f32d4d9e64f041a1a860c5b1fe86d3b6368b65335b1406505f7ce259d2853ff9a858ceff7145cf48088a4668644b174444f5a9da610
7
+ data.tar.gz: 2171a5110cce5e2cf0c488a58de31e90ecdb7af7efc49c82e25725b8d05a659f047f1594fd284884a2e43eeab38f6746aa278c8d812c0e437b566e2bac67b96a
@@ -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(String fromTable, String toTable)
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(quoteIdentifierString(fromTable));
29
+ sb.append(quoteTableIdentifier(fromTable));
29
30
  sb.append(" TO ");
30
- sb.append(quoteIdentifierString(toTable));
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(String tableName) throws SQLException
42
+ public void dropTableIfExists(TableIdentifier table) throws SQLException
42
43
  {
43
- if (tableExists(tableName)) {
44
- dropTable(tableName);
44
+ if (tableExists(table)) {
45
+ dropTable(table);
45
46
  }
46
47
  }
47
48
 
48
49
  @Override
49
- protected void dropTableIfExists(Statement stmt, String tableName) throws SQLException
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(String tableName, JdbcSchema schema) throws SQLException
58
+ public void createTableIfNotExists(TableIdentifier table, JdbcSchema schema) throws SQLException
58
59
  {
59
- if (!tableExists(tableName)) {
60
- createTable(tableName, schema);
60
+ if (!tableExists(table)) {
61
+ createTable(table, schema);
61
62
  }
62
63
  }
63
64
 
64
- public void createTable(String tableName, JdbcSchema schema) throws SQLException
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(tableName, schema);
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
- protected String buildCreateTableSql(String name, JdbcSchema schema)
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
- quoteIdentifierString(sb, name);
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.8
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-05-10 00:00:00.000000000 Z
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.8.jar
23
- - classpath/embulk-output-jdbc-0.7.8.jar
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