embulk-output-jdbc 0.4.3 → 0.4.4
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: f31cfd6a9ac7188988b1e114f160db42d04e32f8
|
4
|
+
data.tar.gz: 735cb79d17704d1ae1074bf3a6b225a7090844df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb168e80e969473bdde51f392177f2ca1777c47512991bfa3b5cb0a592325af531d37a1290a0d84e08b1f478fccc273050c29543782829cb720ea201a73989c
|
7
|
+
data.tar.gz: 5f568dd31653c80dd2f8c86290dc0a754a571b5fd45f5efcf4436e4aecb3df590e50c5737953273bfecbb28281737c60993f73a2de2aba0106e4d0b63406972c
|
Binary file
|
@@ -717,10 +717,11 @@ public abstract class AbstractJdbcOutputPlugin
|
|
717
717
|
if (rs.wasNull()) {
|
718
718
|
decDigit = -1;
|
719
719
|
}
|
720
|
+
int charOctetLength = rs.getInt("CHAR_OCTET_LENGTH");
|
720
721
|
boolean isNotNull = "NO".equals(rs.getString("IS_NULLABLE"));
|
721
722
|
//rs.getString("COLUMN_DEF") // or null // TODO
|
722
723
|
builder.add(JdbcColumn.newGenericTypeColumn(
|
723
|
-
columnName, sqlType, simpleTypeName, colSize, decDigit, isNotNull, isUniqueKey));
|
724
|
+
columnName, sqlType, simpleTypeName, colSize, decDigit, charOctetLength, isNotNull, isUniqueKey));
|
724
725
|
// We can't get declared column name using JDBC API.
|
725
726
|
// Subclasses need to overwrite it.
|
726
727
|
}
|
@@ -12,6 +12,7 @@ public class JdbcColumn
|
|
12
12
|
private final int sqlType;
|
13
13
|
private final int sizeTypeParameter;
|
14
14
|
private final int scaleTypeParameter;
|
15
|
+
private final int dataLength;
|
15
16
|
private final Optional<String> declaredType;
|
16
17
|
private final boolean isNotNull;
|
17
18
|
private final boolean isUniqueKey;
|
@@ -23,6 +24,7 @@ public class JdbcColumn
|
|
23
24
|
@JsonProperty("simpleTypeName") String simpleTypeName,
|
24
25
|
@JsonProperty("sizeTypeParameter") int sizeTypeParameter,
|
25
26
|
@JsonProperty("scaleTypeParameter") int scaleTypeParameter,
|
27
|
+
@JsonProperty("dataLength") int dataLength,
|
26
28
|
@JsonProperty("declaredType") Optional<String> declaredType,
|
27
29
|
@JsonProperty("notNull") boolean isNotNull,
|
28
30
|
@JsonProperty("uniqueKey") boolean isUniqueKey)
|
@@ -32,32 +34,42 @@ public class JdbcColumn
|
|
32
34
|
this.sqlType = sqlType;
|
33
35
|
this.sizeTypeParameter = sizeTypeParameter;
|
34
36
|
this.scaleTypeParameter = scaleTypeParameter;
|
37
|
+
this.dataLength = dataLength;
|
35
38
|
this.declaredType = declaredType;
|
36
39
|
this.isNotNull = isNotNull;
|
37
40
|
this.isUniqueKey = isUniqueKey;
|
38
41
|
}
|
39
42
|
|
43
|
+
public static JdbcColumn newGenericTypeColumn(String name, int sqlType,
|
44
|
+
String simpleTypeName, int sizeTypeParameter, int scaleTypeParameter, int dataLength,
|
45
|
+
boolean isNotNull, boolean isUniqueKey)
|
46
|
+
{
|
47
|
+
return new JdbcColumn(name, sqlType,
|
48
|
+
simpleTypeName, sizeTypeParameter, scaleTypeParameter, dataLength,
|
49
|
+
Optional.<String>absent(), isNotNull, isUniqueKey);
|
50
|
+
}
|
51
|
+
|
40
52
|
public static JdbcColumn newGenericTypeColumn(String name, int sqlType,
|
41
53
|
String simpleTypeName, int sizeTypeParameter, int scaleTypeParameter,
|
42
54
|
boolean isNotNull, boolean isUniqueKey)
|
43
55
|
{
|
44
56
|
return new JdbcColumn(name, sqlType,
|
45
|
-
simpleTypeName, sizeTypeParameter, scaleTypeParameter,
|
46
|
-
isNotNull, isUniqueKey);
|
57
|
+
simpleTypeName, sizeTypeParameter, scaleTypeParameter, sizeTypeParameter,
|
58
|
+
Optional.<String>absent(), isNotNull, isUniqueKey);
|
47
59
|
}
|
48
60
|
|
49
61
|
public static JdbcColumn newTypeDeclaredColumn(String name, int sqlType,
|
50
62
|
String declaredType, boolean isNotNull, boolean isUniqueKey)
|
51
63
|
{
|
52
64
|
return new JdbcColumn(name, sqlType,
|
53
|
-
declaredType, 0, 0,
|
54
|
-
isNotNull, isUniqueKey);
|
65
|
+
declaredType, 0, 0, 0,
|
66
|
+
Optional.of(declaredType), isNotNull, isUniqueKey);
|
55
67
|
}
|
56
68
|
|
57
69
|
@JsonIgnore
|
58
70
|
public static JdbcColumn skipColumn()
|
59
71
|
{
|
60
|
-
return new JdbcColumn(null, 0, null, 0, 0, Optional.<String>absent(), false, false);
|
72
|
+
return new JdbcColumn(null, 0, null, 0, 0, 0, Optional.<String>absent(), false, false);
|
61
73
|
}
|
62
74
|
|
63
75
|
@JsonIgnore
|
@@ -96,6 +108,12 @@ public class JdbcColumn
|
|
96
108
|
return scaleTypeParameter;
|
97
109
|
}
|
98
110
|
|
111
|
+
@JsonProperty("dataLength")
|
112
|
+
public int getDataLength()
|
113
|
+
{
|
114
|
+
return dataLength;
|
115
|
+
}
|
116
|
+
|
99
117
|
@JsonProperty("declaredType")
|
100
118
|
public Optional<String> getDeclaredType()
|
101
119
|
{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-jdbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
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: 2016-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Inserts or updates records to a table.
|
14
14
|
email:
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- src/main/java/org/embulk/output/jdbc/setter/SqlTimestampColumnSetter.java
|
54
54
|
- src/main/java/org/embulk/output/jdbc/setter/StringColumnSetter.java
|
55
55
|
- src/test/java/org/embulk/output/TestJdbcOutputPlugin.java
|
56
|
-
- classpath/embulk-output-jdbc-0.4.
|
56
|
+
- classpath/embulk-output-jdbc-0.4.4.jar
|
57
57
|
homepage: https://github.com/embulk/embulk-output-jdbc
|
58
58
|
licenses:
|
59
59
|
- Apache 2.0
|