embulk-input-sqlserver 0.9.2 → 0.9.3
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: c2e2a934b82c9181dc420aa527afa635c7cd4d68
|
4
|
+
data.tar.gz: 45b857b631c057ec18b3b36ba8f74b89dfce40ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c83363c482e039e342d59168433b4c6ea3497deafdcea7f4928fab3ae39efcd45b4eae8f22d8df0008e9c8303a21e8b04bc4bd36476bc22e7afeb886e6a718d
|
7
|
+
data.tar.gz: 7fec31478273565b8cc37cda3c566bf4781a1095c6ac3f454e48d3e01df68c062baaa0701865830e7bbd231e8ab34dfa33f375e172138093f98b4535dad2e598
|
data/README.md
CHANGED
@@ -25,6 +25,7 @@ embulk "-J-Djava.library.path=C:\drivers" run input-sqlserver.yml
|
|
25
25
|
- **url**: URL of the JDBC connection (string, optional)
|
26
26
|
- If you write SQL directly,
|
27
27
|
- **query**: SQL to run (string)
|
28
|
+
- **use_raw_query_with_incremental**: If true, you can write optimized query using prepared statement by yourself. See [Use incremental loading with raw query](#use-incremental-loading-with-raw-query) for more detail (boolean, default: false)
|
28
29
|
- If **query** is not set,
|
29
30
|
- **table**: destination table name (string, required)
|
30
31
|
- **transaction_isolation_level**: transaction isolation level (e.g. `NOLOCK`). The value is used as table hint (e.g. `SELECT * FROM SOME_TABLE with (NOLOCK)`). (string, optional)
|
@@ -87,6 +88,38 @@ CREATE INDEX embulk_incremental_loading_index ON table (updated_at, id);
|
|
87
88
|
|
88
89
|
Recommended usage is to leave `incremental_columns` unset and let this plugin automatically finds an IDENTITY primary key. Currently, only strings and integers are supported as incremental_columns.
|
89
90
|
|
91
|
+
### Use incremental loading with raw query
|
92
|
+
|
93
|
+
**IMPORTANT**: This is an advanced feature and assume you have an enough knowledge about incremental loading using Embulk and this plugin
|
94
|
+
|
95
|
+
Normally, you can't write your own query for incremental loading.
|
96
|
+
`use_raw_query_with_incremental` option allow you to write raw query for incremental loading. It might be well optimized and faster than SQL statement which is automatically generated by plugin.
|
97
|
+
|
98
|
+
Prepared statement starts with `:` is available instead of fixed value.
|
99
|
+
`last_record` value is necessary when you use this option.
|
100
|
+
Please use prepared statement that is well distinguishable in SQL statement. Using too simple prepared statement like `:a` might cause SQL parse failure.
|
101
|
+
|
102
|
+
In the following example, prepared statement `:foo_id` will be replaced with value "1" which is specified in `last_record`.
|
103
|
+
|
104
|
+
```yaml
|
105
|
+
in:
|
106
|
+
type: sqlserver
|
107
|
+
query:
|
108
|
+
SELECT
|
109
|
+
foo.id as foo_id, bar.name
|
110
|
+
FROM
|
111
|
+
foo LEFT JOIN bar ON foo.id = bar.id
|
112
|
+
WHERE
|
113
|
+
foo.hoge IS NOT NULL
|
114
|
+
AND foo.id > :foo_id
|
115
|
+
ORDER BY
|
116
|
+
foo.id ASC
|
117
|
+
use_raw_query_with_incremental: true
|
118
|
+
incremental_columns:
|
119
|
+
- foo_id
|
120
|
+
incremental: true
|
121
|
+
last_record: [1]
|
122
|
+
```
|
90
123
|
|
91
124
|
## Example
|
92
125
|
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-sqlserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadayuki Furuhashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Selects records from 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-input-jdbc-0.9.
|
23
|
-
- classpath/embulk-input-sqlserver-0.9.
|
22
|
+
- classpath/embulk-input-jdbc-0.9.3.jar
|
23
|
+
- classpath/embulk-input-sqlserver-0.9.3.jar
|
24
24
|
- classpath/jtds-1.3.1.jar
|
25
25
|
- lib/embulk/input/sqlserver.rb
|
26
26
|
- src/main/java/org/embulk/input/SQLServerInputPlugin.java
|
Binary file
|