-
Notifications
You must be signed in to change notification settings - Fork 3
/
sample-postgres.xml
66 lines (66 loc) · 2.71 KB
/
sample-postgres.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>
<!-- PostgreSQL to YDB importer job configuration example -->
<ydb-importer>
<workers>
<pool size="4"/>
</workers>
<source type="postgresql">
<jdbc-class>org.postgresql.Driver</jdbc-class>
<jdbc-url>jdbc:postgresql://hostname:5432/dbname</jdbc-url>
<username>username</username>
<password>password</password>
</source>
<target type="ydb">
<script-file>sample-postgres.yql.tmp</script-file>
<connection-string>grpcs://ydb.serverless.yandexcloud.net:2135?database=/ru-central1/b1gfvslmokutuvt2g019/etn63999hrinbapmef6g</connection-string>
<!--
<connection-string>grpcs://hostname.demo.com:2135?database=/local</connection-string>
-->
<!-- Custom TLS certificate file, if needed
<tls-certificate-file>ca.crt</tls-certificate-file>
-->
<!-- ENV, NONE, STATIC, METADATA, SAKEY -->
<auth-mode>ENV</auth-mode>
<!-- auth-mode: STATIC
<static-login>username</static-login>
<static-password>password</static-password>
-->
<!-- auth-mode: SAKEY
<sa-key-file>ydb-sa-keyfile.json</sa-key-file>
-->
<replace-existing>true</replace-existing>
<load-data>true</load-data>
<max-batch-rows>1000</max-batch-rows>
<max-blob-rows>200</max-blob-rows>
</target>
<table-options name="default">
<!-- ASIS, LOWER, UPPER -->
<case-mode>ASIS</case-mode>
<!-- Substitution values: ${schema}, ${table} -->
<table-name-format>pgimp1/${schema}/${table}</table-name-format>
<!-- Substitution values: ${schema}, ${table}, ${field} -->
<blob-name-format>pgimp1/${schema}/${table}_${field}</blob-name-format>
<!-- DATE, INT, STR -->
<conv-date>INT</conv-date>
<conv-timestamp>INT</conv-timestamp>
<skip-unknown-types>true</skip-unknown-types>
</table-options>
<table-map options="default">
<include-schemas regexp="true">.*</include-schemas>
</table-map>
<table-ref options="default">
<schema-name>information_schema</schema-name>
<table-name>columns</table-name>
<query-text>SELECT * FROM information_schema."columns"</query-text>
<key-column>table_schema</key-column>
<key-column>table_name</key-column>
<key-column>column_name</key-column>
</table-ref>
<table-ref options="default">
<schema-name>information_schema</schema-name>
<table-name>tables</table-name>
<query-text>SELECT * FROM information_schema."tables"</query-text>
<key-column>table_schema</key-column>
<key-column>table_name</key-column>
</table-ref>
</ydb-importer>