/
types.go
349 lines (263 loc) · 7.8 KB
/
types.go
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
// Contains an array.
//
// The following types satisfy this interface:
// ArrayValueMemberArrayValues
// ArrayValueMemberBooleanValues
// ArrayValueMemberDoubleValues
// ArrayValueMemberLongValues
// ArrayValueMemberStringValues
type ArrayValue interface {
isArrayValue()
}
// An array of arrays.
type ArrayValueMemberArrayValues struct {
Value []ArrayValue
}
func (*ArrayValueMemberArrayValues) isArrayValue() {}
// An array of Boolean values.
type ArrayValueMemberBooleanValues struct {
Value []bool
}
func (*ArrayValueMemberBooleanValues) isArrayValue() {}
// An array of integers.
type ArrayValueMemberDoubleValues struct {
Value []float64
}
func (*ArrayValueMemberDoubleValues) isArrayValue() {}
// An array of floating point numbers.
type ArrayValueMemberLongValues struct {
Value []int64
}
func (*ArrayValueMemberLongValues) isArrayValue() {}
// An array of strings.
type ArrayValueMemberStringValues struct {
Value []string
}
func (*ArrayValueMemberStringValues) isArrayValue() {}
// Contains the metadata for a column.
type ColumnMetadata struct {
// The type of the column.
ArrayBaseColumnType int32
// A value that indicates whether the column increments automatically.
IsAutoIncrement bool
// A value that indicates whether the column is case-sensitive.
IsCaseSensitive bool
// A value that indicates whether the column contains currency values.
IsCurrency bool
// A value that indicates whether an integer column is signed.
IsSigned bool
// The label for the column.
Label *string
// The name of the column.
Name *string
// A value that indicates whether the column is nullable.
Nullable int32
// The precision value of a decimal number column.
Precision int32
// The scale value of a decimal number column.
Scale int32
// The name of the schema that owns the table that includes the column.
SchemaName *string
// The name of the table that includes the column.
TableName *string
// The type of the column.
Type int32
// The database-specific data type of the column.
TypeName *string
}
// Contains a value.
//
// The following types satisfy this interface:
// FieldMemberArrayValue
// FieldMemberBlobValue
// FieldMemberBooleanValue
// FieldMemberDoubleValue
// FieldMemberIsNull
// FieldMemberLongValue
// FieldMemberStringValue
type Field interface {
isField()
}
// An array of values.
type FieldMemberArrayValue struct {
Value ArrayValue
}
func (*FieldMemberArrayValue) isField() {}
// A value of BLOB data type.
type FieldMemberBlobValue struct {
Value []byte
}
func (*FieldMemberBlobValue) isField() {}
// A value of Boolean data type.
type FieldMemberBooleanValue struct {
Value bool
}
func (*FieldMemberBooleanValue) isField() {}
// A value of double data type.
type FieldMemberDoubleValue struct {
Value float64
}
func (*FieldMemberDoubleValue) isField() {}
// A NULL value.
type FieldMemberIsNull struct {
Value bool
}
func (*FieldMemberIsNull) isField() {}
// A value of long data type.
type FieldMemberLongValue struct {
Value int64
}
func (*FieldMemberLongValue) isField() {}
// A value of string data type.
type FieldMemberStringValue struct {
Value string
}
func (*FieldMemberStringValue) isField() {}
// A record returned by a call.
type Record struct {
// The values returned in the record.
Values []Value
}
// The result set returned by a SQL statement.
type ResultFrame struct {
// The records in the result set.
Records []Record
// The result-set metadata in the result set.
ResultSetMetadata *ResultSetMetadata
}
// The metadata of the result set returned by a SQL statement.
type ResultSetMetadata struct {
// The number of columns in the result set.
ColumnCount int64
// The metadata of the columns in the result set.
ColumnMetadata []ColumnMetadata
}
// Options that control how the result set is returned.
type ResultSetOptions struct {
// A value that indicates how a field of DECIMAL type is represented in the
// response. The value of STRING, the default, specifies that it is converted to a
// String value. The value of DOUBLE_OR_LONG specifies that it is converted to a
// Long value if its scale is 0, or to a Double value otherwise. Conversion to
// Double or Long can result in roundoff errors due to precision loss. We recommend
// converting to String, especially when working with currency values.
DecimalReturnType DecimalReturnType
}
// A parameter used in a SQL statement.
type SqlParameter struct {
// The name of the parameter.
Name *string
// A hint that specifies the correct object type for data type mapping. Values:
//
// *
// DECIMAL - The corresponding String parameter value is sent as an object of
// DECIMAL type to the database.
//
// * TIMESTAMP - The corresponding String parameter
// value is sent as an object of TIMESTAMP type to the database. The accepted
// format is YYYY-MM-DD HH:MM:SS[.FFF].
//
// * TIME - The corresponding String
// parameter value is sent as an object of TIME type to the database. The accepted
// format is HH:MM:SS[.FFF].
//
// * DATE - The corresponding String parameter value is
// sent as an object of DATE type to the database. The accepted format is
// YYYY-MM-DD.
TypeHint TypeHint
// The value of the parameter.
Value Field
}
// The result of a SQL statement. This data type is deprecated.
type SqlStatementResult struct {
// The number of records updated by a SQL statement.
NumberOfRecordsUpdated int64
// The result set of the SQL statement.
ResultFrame *ResultFrame
}
// A structure value returned by a call.
type StructValue struct {
// The attributes returned in the record.
Attributes []Value
}
// The response elements represent the results of an update.
type UpdateResult struct {
// Values for fields generated during the request.
GeneratedFields []Field
}
// Contains the value of a column. This data type is deprecated.
//
// The following types satisfy this interface:
// ValueMemberArrayValues
// ValueMemberBigIntValue
// ValueMemberBitValue
// ValueMemberBlobValue
// ValueMemberDoubleValue
// ValueMemberIntValue
// ValueMemberIsNull
// ValueMemberRealValue
// ValueMemberStringValue
// ValueMemberStructValue
type Value interface {
isValue()
}
// An array of column values.
type ValueMemberArrayValues struct {
Value []Value
}
func (*ValueMemberArrayValues) isValue() {}
// A value for a column of big integer data type.
type ValueMemberBigIntValue struct {
Value int64
}
func (*ValueMemberBigIntValue) isValue() {}
// A value for a column of BIT data type.
type ValueMemberBitValue struct {
Value bool
}
func (*ValueMemberBitValue) isValue() {}
// A value for a column of BLOB data type.
type ValueMemberBlobValue struct {
Value []byte
}
func (*ValueMemberBlobValue) isValue() {}
// A value for a column of double data type.
type ValueMemberDoubleValue struct {
Value float64
}
func (*ValueMemberDoubleValue) isValue() {}
// A value for a column of integer data type.
type ValueMemberIntValue struct {
Value int32
}
func (*ValueMemberIntValue) isValue() {}
// A NULL value.
type ValueMemberIsNull struct {
Value bool
}
func (*ValueMemberIsNull) isValue() {}
// A value for a column of real data type.
type ValueMemberRealValue struct {
Value float32
}
func (*ValueMemberRealValue) isValue() {}
// A value for a column of string data type.
type ValueMemberStringValue struct {
Value string
}
func (*ValueMemberStringValue) isValue() {}
// A value for a column of STRUCT data type.
type ValueMemberStructValue struct {
Value StructValue
}
func (*ValueMemberStructValue) isValue() {}
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
}
func (*UnknownUnionMember) isArrayValue() {}
func (*UnknownUnionMember) isField() {}
func (*UnknownUnionMember) isValue() {}