-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathadapter.json
More file actions
129 lines (129 loc) · 3.26 KB
/
adapter.json
File metadata and controls
129 lines (129 loc) · 3.26 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**
* Copyright © 2016-2022 by IntegrIT S.A. dba Hackolade. All rights reserved.
*
* The copyright to the computer software herein is the property of IntegrIT S.A.
* The software may be used and/or copied only with the written permission of
* IntegrIT S.A. or in accordance with the terms and conditions stipulated in
* the agreement/contract under which the software has been supplied.
*
* {
* "add": {
* "entity": [<names of new property>],
* "container": [<names of new property>],
* "model": [<names of new property>],
* "view": [<names of new property>],
* "field": {
* "<type>": [<names of new property>]
* }
* },
* "delete": {
* "entity": [<names of new property>],
* "container": [<names of new property>],
* "model": [<names of new property>],
* "view": [<names of new property>],
* "field": {
* "<type>": [<names of new property>]
* }
* },
* "modify": {
* "entity": [
* {
* "from": { <properties that identify record> },
* "to": { <properties that need to be changed> }
* }
* ],
* "container": [],
* "model": [],
* "view": [],
* "field": []
* },
* }
*/
{
"modify": {
"field": [
{
"from": { "childType": "boolean", "default": false },
"to": { "default": 0 }
},
{
"from": { "childType": "boolean", "default": "false" },
"to": { "default": 0 }
},
{
"from": { "childType": "boolean", "default": true },
"to": { "default": 1 }
},
{
"from": { "childType": "boolean", "default": "true" },
"to": { "default": 1 }
},
{
"from": { "childType": "boolean", "sample": false },
"to": { "sample": 0 }
},
{
"from": { "childType": "boolean", "sample": "false" },
"to": { "sample": 0 }
},
{
"from": { "childType": "boolean", "sample": true },
"to": { "sample": 1 }
},
{
"from": { "childType": "boolean", "sample": "true" },
"to": { "sample": 1 }
},
{
"from": { "childType": "boolean" },
"to": {
"type": "number",
"childType": "numeric",
"mode": "bit"
}
},
{
"from": { "childType": "timestamp_tz" },
"to": { "mode": "datetime2", "childType": "datetime" }
},
{
"from": { "childType": "timestamp_ltz" },
"to": { "mode": "datetime2", "childType": "datetime" }
},
{
"from": { "childType": "timestamp_ntz" },
"to": { "mode": "datetime2", "childType": "datetime" }
},
/**
* It is a bit tricky adapter. Here we rely on the type detection priority of application. Keyword "mode" has higher
* priority, so it will be used first and when available (in SQL Server 2025 and higher) it will be used. When not available
* it will try to use "childType" and convert the type to "varchar" which is available in all version of SQL Server.
*/
{
"from": { "type": "json" },
"to": {
"hasMaxLength": true,
"childType": "varchar",
"mode": "json"
}
},
["convertLengthToHasMaxLength", 8001],
[
"renameBlockItemProperties",
{
"autoincrement": {
"self": "identity",
"subProps": {
"start_num": "identitySeed",
"step_num": "identityIncrement"
}
}
}
],
{
"from": { "childType": "uuid" },
"to": { "mode": "uniqueidentifier" }
}
]
}
}