embulk-output-sqlserver 0.6.5 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/build.gradle +1 -1
- data/classpath/{embulk-output-jdbc-0.6.5.jar → embulk-output-jdbc-0.7.0.jar} +0 -0
- data/classpath/{embulk-output-sqlserver-0.6.5.jar → embulk-output-sqlserver-0.7.0.jar} +0 -0
- data/src/test/java/org/embulk/output/sqlserver/SQLServerOutputPluginTest.java +15 -12
- data/src/test/resources/sqlserver/yml/test-insert-direct.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-insert.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-jtds.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-native-date.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-native-decimal.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-native-integer.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-native-string.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-native.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-replace-long-name.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-replace.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-string-timestamp.yml +4 -4
- data/src/test/resources/sqlserver/yml/test-truncate-insert.yml +4 -4
- 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: dad9cc8adb34ede9de7d4928636e1c79f465f4d3
|
4
|
+
data.tar.gz: 21b9f512ffa74a2ce15a426f9202037a47357276
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a125d3123a15b602a18b9c3a3feaa26c1d901a9d4e93a083e5bb3bc4897bfb815ffc27c5399a209a5af870481af922bc8782e8a1756a3c05fe52ab48c0018d92
|
7
|
+
data.tar.gz: d82c71b0a77c92fcd9d7ccf0f6e8e6805ef8618c5956f216cab06b4352b48396cd8da3f96a59d7ec296a7c94bdf05396d39ce681a38eb35164e4efbb053a8357
|
data/README.md
CHANGED
data/build.gradle
CHANGED
@@ -3,6 +3,6 @@ dependencies {
|
|
3
3
|
compile 'net.sourceforge.jtds:jtds:1.3.1'
|
4
4
|
|
5
5
|
testCompile 'org.embulk:embulk-standards:0.8.8'
|
6
|
-
testCompile
|
6
|
+
testCompile project(':embulk-output-jdbc').sourceSets.test.output
|
7
7
|
testCompile files('driver/sqljdbc41.jar')
|
8
8
|
}
|
Binary file
|
Binary file
|
@@ -3,7 +3,6 @@ package org.embulk.output.sqlserver;
|
|
3
3
|
import org.embulk.output.AbstractJdbcOutputPluginTest;
|
4
4
|
import org.embulk.output.SQLServerOutputPlugin;
|
5
5
|
import org.embulk.spi.OutputPlugin;
|
6
|
-
import org.junit.BeforeClass;
|
7
6
|
import org.junit.Test;
|
8
7
|
|
9
8
|
import java.math.BigDecimal;
|
@@ -19,19 +18,19 @@ import java.util.Date;
|
|
19
18
|
import java.util.Iterator;
|
20
19
|
import java.util.List;
|
21
20
|
|
21
|
+
import static java.util.Locale.ENGLISH;
|
22
22
|
import static org.junit.Assert.assertEquals;
|
23
23
|
|
24
24
|
|
25
25
|
public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
|
26
26
|
{
|
27
|
-
private
|
28
|
-
|
27
|
+
private boolean useJtdsDriver = false;
|
28
|
+
|
29
|
+
|
30
|
+
@Override
|
31
|
+
protected void prepare() throws SQLException {
|
29
32
|
tester.addPlugin(OutputPlugin.class, "sqlserver", SQLServerOutputPlugin.class);
|
30
|
-
}
|
31
33
|
|
32
|
-
@BeforeClass
|
33
|
-
public static void beforeClass()
|
34
|
-
{
|
35
34
|
try {
|
36
35
|
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
|
37
36
|
} catch (ClassNotFoundException e) {
|
@@ -40,13 +39,14 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
|
|
40
39
|
}
|
41
40
|
|
42
41
|
try {
|
43
|
-
|
42
|
+
connect();
|
44
43
|
enabled = true;
|
45
44
|
} catch (Throwable t) {
|
46
45
|
System.out.println(t);
|
47
46
|
} finally {
|
48
47
|
if (!enabled) {
|
49
|
-
System.out.println("Warning: you should prepare database in order to test (server =
|
48
|
+
System.out.println(String.format(ENGLISH, "Warning: you should prepare database in order to test (server = %s, port = %d, database = %s, user = %s, password = %s).",
|
49
|
+
getHost(), getPort(), getDatabase(), getUser(), getPassword()));
|
50
50
|
}
|
51
51
|
}
|
52
52
|
}
|
@@ -341,7 +341,8 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
|
|
341
341
|
} catch (Throwable t) {
|
342
342
|
System.out.println(t);
|
343
343
|
System.out.println("Warning: jTDS driver can't connect to database.");
|
344
|
-
System.out.println("(server =
|
344
|
+
System.out.println(String.format(ENGLISH, "(server = %s, port = %d, database = %s, user = %s, password = %s)",
|
345
|
+
getHost(), getPort(), getDatabase(), getUser(), getPassword()));
|
345
346
|
return;
|
346
347
|
}
|
347
348
|
|
@@ -771,11 +772,13 @@ public class SQLServerOutputPluginTest extends AbstractJdbcOutputPluginTest
|
|
771
772
|
@Override
|
772
773
|
protected Connection connect() throws SQLException
|
773
774
|
{
|
775
|
+
String url;
|
774
776
|
if(useJtdsDriver) {
|
775
|
-
|
777
|
+
url = "jdbc:jtds:sqlserver://%s:%d/%s;useLOBs=false";
|
776
778
|
} else {
|
777
|
-
|
779
|
+
url = "jdbc:sqlserver://%s:%d;databasename=%s";
|
778
780
|
}
|
781
|
+
return DriverManager.getConnection(String.format(ENGLISH, url, getHost(), getPort(), getDatabase()), getUser(), getPassword());
|
779
782
|
}
|
780
783
|
|
781
784
|
}
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: insert_direct
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: insert
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: insert_direct
|
@@ -17,10 +17,10 @@ in:
|
|
17
17
|
- {name: ITEM7, type: timestamp, format: '%H:%M:%S.%N'}
|
18
18
|
out:
|
19
19
|
type: sqlserver
|
20
|
-
host:
|
21
|
-
database:
|
22
|
-
user:
|
23
|
-
password:
|
20
|
+
host: #host#
|
21
|
+
database: #database#
|
22
|
+
user: #user#
|
23
|
+
password: #password#
|
24
24
|
table: TEST5
|
25
25
|
mode: insert_direct
|
26
26
|
insert_method: native
|
@@ -16,10 +16,10 @@ in:
|
|
16
16
|
- {name: ITEM6, type: double}
|
17
17
|
out:
|
18
18
|
type: sqlserver
|
19
|
-
host:
|
20
|
-
database:
|
21
|
-
user:
|
22
|
-
password:
|
19
|
+
host: #host#
|
20
|
+
database: #database#
|
21
|
+
user: #user#
|
22
|
+
password: #password#
|
23
23
|
table: TEST4
|
24
24
|
mode: insert_direct
|
25
25
|
insert_method: native
|
@@ -15,10 +15,10 @@ in:
|
|
15
15
|
- {name: ITEM5, type: long}
|
16
16
|
out:
|
17
17
|
type: sqlserver
|
18
|
-
host:
|
19
|
-
database:
|
20
|
-
user:
|
21
|
-
password:
|
18
|
+
host: #host#
|
19
|
+
database: #database#
|
20
|
+
user: #user#
|
21
|
+
password: #password#
|
22
22
|
table: TEST3
|
23
23
|
mode: insert_direct
|
24
24
|
insert_method: native
|
@@ -16,10 +16,10 @@ in:
|
|
16
16
|
- {name: ITEM6, type: string}
|
17
17
|
out:
|
18
18
|
type: sqlserver
|
19
|
-
host:
|
20
|
-
database:
|
21
|
-
user:
|
22
|
-
password:
|
19
|
+
host: #host#
|
20
|
+
database: #database#
|
21
|
+
user: #user#
|
22
|
+
password: #password#
|
23
23
|
table: TEST2
|
24
24
|
mode: insert_direct
|
25
25
|
insert_method: native
|
@@ -35,10 +35,10 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: insert_direct
|
44
44
|
insert_method: native
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST___A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789
|
43
43
|
mode: replace
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: replace
|
@@ -35,10 +35,10 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: insert_direct
|
44
44
|
column_options:
|
@@ -35,9 +35,9 @@ in:
|
|
35
35
|
- {name: TIME_2_ITEM, type: timestamp, format: '%H:%M:%S.%N'}
|
36
36
|
out:
|
37
37
|
type: sqlserver
|
38
|
-
host:
|
39
|
-
database:
|
40
|
-
user:
|
41
|
-
password:
|
38
|
+
host: #host#
|
39
|
+
database: #database#
|
40
|
+
user: #user#
|
41
|
+
password: #password#
|
42
42
|
table: TEST1
|
43
43
|
mode: truncate_insert
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-sqlserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-26 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.
|
23
|
-
- classpath/embulk-output-sqlserver-0.
|
22
|
+
- classpath/embulk-output-jdbc-0.7.0.jar
|
23
|
+
- classpath/embulk-output-sqlserver-0.7.0.jar
|
24
24
|
- classpath/jtds-1.3.1.jar
|
25
25
|
- lib/embulk/output/sqlserver.rb
|
26
26
|
- src/main/java/org/embulk/output/SQLServerOutputPlugin.java
|