-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathscalarfunc.sql.go
More file actions
572 lines (468 loc) · 13.3 KB
/
scalarfunc.sql.go
File metadata and controls
572 lines (468 loc) · 13.3 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
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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.14.0
// source: scalarfunc.sql
package querytest
import (
"context"
"database/sql"
)
const getAbs = `-- name: GetAbs :one
SELECT abs(int_val) FROM test
`
func (q *Queries) GetAbs(ctx context.Context) (float64, error) {
row := q.db.QueryRowContext(ctx, getAbs)
var abs float64
err := row.Scan(&abs)
return abs, err
}
const getChanges = `-- name: GetChanges :one
SELECT changes()
`
func (q *Queries) GetChanges(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getChanges)
var changes int64
err := row.Scan(&changes)
return changes, err
}
const getChar1 = `-- name: GetChar1 :one
SELECT char(65)
`
func (q *Queries) GetChar1(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getChar1)
var char string
err := row.Scan(&char)
return char, err
}
const getChar3 = `-- name: GetChar3 :one
SELECT char(65, 66, 67)
`
func (q *Queries) GetChar3(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getChar3)
var char string
err := row.Scan(&char)
return char, err
}
const getCoalesce = `-- name: GetCoalesce :one
SELECT coalesce(NULL, 1, 'test')
`
func (q *Queries) GetCoalesce(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getCoalesce)
var coalesce interface{}
err := row.Scan(&coalesce)
return coalesce, err
}
const getFormat = `-- name: GetFormat :one
SELECT format('Hello %s', 'world')
`
func (q *Queries) GetFormat(ctx context.Context) (sql.NullString, error) {
row := q.db.QueryRowContext(ctx, getFormat)
var format sql.NullString
err := row.Scan(&format)
return format, err
}
const getGlob = `-- name: GetGlob :one
SELECT glob('a*c', 'abc')
`
func (q *Queries) GetGlob(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getGlob)
var glob int64
err := row.Scan(&glob)
return glob, err
}
const getHex = `-- name: GetHex :one
SELECT hex(123456)
`
func (q *Queries) GetHex(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getHex)
var hex string
err := row.Scan(&hex)
return hex, err
}
const getIfnull = `-- name: GetIfnull :one
SELECT ifnull(1, 2)
`
func (q *Queries) GetIfnull(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getIfnull)
var ifnull interface{}
err := row.Scan(&ifnull)
return ifnull, err
}
const getIif = `-- name: GetIif :one
SELECT iif(1, 2, 3)
`
func (q *Queries) GetIif(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getIif)
var iif interface{}
err := row.Scan(&iif)
return iif, err
}
const getInstr = `-- name: GetInstr :one
SELECT instr('hello', 'l')
`
func (q *Queries) GetInstr(ctx context.Context) (sql.NullInt64, error) {
row := q.db.QueryRowContext(ctx, getInstr)
var instr sql.NullInt64
err := row.Scan(&instr)
return instr, err
}
const getLastInsertRowID = `-- name: GetLastInsertRowID :one
SELECT last_insert_rowid()
`
func (q *Queries) GetLastInsertRowID(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getLastInsertRowID)
var last_insert_rowid int64
err := row.Scan(&last_insert_rowid)
return last_insert_rowid, err
}
const getLength = `-- name: GetLength :one
SELECT length('12345')
`
func (q *Queries) GetLength(ctx context.Context) (sql.NullInt64, error) {
row := q.db.QueryRowContext(ctx, getLength)
var length sql.NullInt64
err := row.Scan(&length)
return length, err
}
const getLike2 = `-- name: GetLike2 :one
SELECT like('%bc%', 'abcd')
`
func (q *Queries) GetLike2(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getLike2)
var like int64
err := row.Scan(&like)
return like, err
}
const getLike3 = `-- name: GetLike3 :one
SELECT like('$%1%', '%100', '$')
`
func (q *Queries) GetLike3(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getLike3)
var like int64
err := row.Scan(&like)
return like, err
}
const getLikelihood = `-- name: GetLikelihood :one
SELECT likelihood('12345', 0.5)
`
func (q *Queries) GetLikelihood(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getLikelihood)
var likelihood interface{}
err := row.Scan(&likelihood)
return likelihood, err
}
const getLikely = `-- name: GetLikely :one
SELECT likely('12345')
`
func (q *Queries) GetLikely(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getLikely)
var likely interface{}
err := row.Scan(&likely)
return likely, err
}
const getLower = `-- name: GetLower :one
SELECT lower('ABCDE')
`
func (q *Queries) GetLower(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getLower)
var lower string
err := row.Scan(&lower)
return lower, err
}
const getLtrim = `-- name: GetLtrim :one
SELECT ltrim(' ABCDE')
`
func (q *Queries) GetLtrim(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getLtrim)
var ltrim string
err := row.Scan(<rim)
return ltrim, err
}
const getLtrim2 = `-- name: GetLtrim2 :one
SELECT ltrim(':ABCDE', ':')
`
func (q *Queries) GetLtrim2(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getLtrim2)
var ltrim string
err := row.Scan(<rim)
return ltrim, err
}
const getMax3 = `-- name: GetMax3 :one
SELECT max(1, 3, 2)
`
func (q *Queries) GetMax3(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getMax3)
var max interface{}
err := row.Scan(&max)
return max, err
}
const getMin3 = `-- name: GetMin3 :one
SELECT min(1, 3, 2)
`
func (q *Queries) GetMin3(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getMin3)
var min interface{}
err := row.Scan(&min)
return min, err
}
const getNullif = `-- name: GetNullif :one
SELECT nullif(1, 2)
`
func (q *Queries) GetNullif(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getNullif)
var nullif interface{}
err := row.Scan(&nullif)
return nullif, err
}
const getPrintf = `-- name: GetPrintf :one
SELECT printf('Hello %s', 'world')
`
func (q *Queries) GetPrintf(ctx context.Context) (sql.NullString, error) {
row := q.db.QueryRowContext(ctx, getPrintf)
var printf sql.NullString
err := row.Scan(&printf)
return printf, err
}
const getQuote = `-- name: GetQuote :one
SELECT quote(1)
`
func (q *Queries) GetQuote(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getQuote)
var quote string
err := row.Scan("e)
return quote, err
}
const getRandom = `-- name: GetRandom :one
SELECT random()
`
func (q *Queries) GetRandom(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getRandom)
var random interface{}
err := row.Scan(&random)
return random, err
}
const getRandomBlob = `-- name: GetRandomBlob :one
SELECT randomblob(16)
`
func (q *Queries) GetRandomBlob(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getRandomBlob)
var randomblob interface{}
err := row.Scan(&randomblob)
return randomblob, err
}
const getReplace = `-- name: GetReplace :one
SELECT replace('abc', 'bc', 'df')
`
func (q *Queries) GetReplace(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getReplace)
var replace string
err := row.Scan(&replace)
return replace, err
}
const getRound = `-- name: GetRound :one
SELECT round(1.1)
`
func (q *Queries) GetRound(ctx context.Context) (float64, error) {
row := q.db.QueryRowContext(ctx, getRound)
var round float64
err := row.Scan(&round)
return round, err
}
const getRound2 = `-- name: GetRound2 :one
SELECT round(1.1, 2)
`
func (q *Queries) GetRound2(ctx context.Context) (float64, error) {
row := q.db.QueryRowContext(ctx, getRound2)
var round float64
err := row.Scan(&round)
return round, err
}
const getRtrim = `-- name: GetRtrim :one
SELECT rtrim('ABCDE ')
`
func (q *Queries) GetRtrim(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getRtrim)
var rtrim string
err := row.Scan(&rtrim)
return rtrim, err
}
const getRtrim2 = `-- name: GetRtrim2 :one
SELECT rtrim('ABCDE:', ':')
`
func (q *Queries) GetRtrim2(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getRtrim2)
var rtrim string
err := row.Scan(&rtrim)
return rtrim, err
}
const getSQLiteCompileOptionGet = `-- name: GetSQLiteCompileOptionGet :one
SELECT sqlite_compileoption_get(1)
`
func (q *Queries) GetSQLiteCompileOptionGet(ctx context.Context) (sql.NullString, error) {
row := q.db.QueryRowContext(ctx, getSQLiteCompileOptionGet)
var sqlite_compileoption_get sql.NullString
err := row.Scan(&sqlite_compileoption_get)
return sqlite_compileoption_get, err
}
const getSQLiteCompileOptionUsed = `-- name: GetSQLiteCompileOptionUsed :one
SELECT sqlite_compileoption_used(1)
`
func (q *Queries) GetSQLiteCompileOptionUsed(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getSQLiteCompileOptionUsed)
var sqlite_compileoption_used int64
err := row.Scan(&sqlite_compileoption_used)
return sqlite_compileoption_used, err
}
const getSQLiteOffset = `-- name: GetSQLiteOffset :one
SELECT sqlite_offset(1)
`
func (q *Queries) GetSQLiteOffset(ctx context.Context) (sql.NullInt64, error) {
row := q.db.QueryRowContext(ctx, getSQLiteOffset)
var sqlite_offset sql.NullInt64
err := row.Scan(&sqlite_offset)
return sqlite_offset, err
}
const getSQLiteSourceID = `-- name: GetSQLiteSourceID :one
SELECT sqlite_source_id()
`
func (q *Queries) GetSQLiteSourceID(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSQLiteSourceID)
var sqlite_source_id string
err := row.Scan(&sqlite_source_id)
return sqlite_source_id, err
}
const getSQLiteVersion = `-- name: GetSQLiteVersion :one
SELECT sqlite_version()
`
func (q *Queries) GetSQLiteVersion(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSQLiteVersion)
var sqlite_version string
err := row.Scan(&sqlite_version)
return sqlite_version, err
}
const getSign = `-- name: GetSign :one
SELECT sign(1)
`
func (q *Queries) GetSign(ctx context.Context) (sql.NullInt64, error) {
row := q.db.QueryRowContext(ctx, getSign)
var sign sql.NullInt64
err := row.Scan(&sign)
return sign, err
}
const getSoundex = `-- name: GetSoundex :one
SELECT soundex('abc')
`
func (q *Queries) GetSoundex(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSoundex)
var soundex string
err := row.Scan(&soundex)
return soundex, err
}
const getSubstr2 = `-- name: GetSubstr2 :one
SELECT substr('abcdef', 2)
`
func (q *Queries) GetSubstr2(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSubstr2)
var substr string
err := row.Scan(&substr)
return substr, err
}
const getSubstr3 = `-- name: GetSubstr3 :one
SELECT substr('abcdef', 1, 2)
`
func (q *Queries) GetSubstr3(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSubstr3)
var substr string
err := row.Scan(&substr)
return substr, err
}
const getSubstring2 = `-- name: GetSubstring2 :one
SELECT substring('abcdef', 1)
`
func (q *Queries) GetSubstring2(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSubstring2)
var substring string
err := row.Scan(&substring)
return substring, err
}
const getSusbstring3 = `-- name: GetSusbstring3 :one
SELECT substring('abcdef', 1, 2)
`
func (q *Queries) GetSusbstring3(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getSusbstring3)
var substring string
err := row.Scan(&substring)
return substring, err
}
const getTotalChanges = `-- name: GetTotalChanges :one
SELECT total_changes()
`
func (q *Queries) GetTotalChanges(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getTotalChanges)
var total_changes int64
err := row.Scan(&total_changes)
return total_changes, err
}
const getTrim = `-- name: GetTrim :one
SELECT trim(' ABCDE ')
`
func (q *Queries) GetTrim(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getTrim)
var trim string
err := row.Scan(&trim)
return trim, err
}
const getTrim2 = `-- name: GetTrim2 :one
SELECT trim(':ABCDE:', ':')
`
func (q *Queries) GetTrim2(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getTrim2)
var trim string
err := row.Scan(&trim)
return trim, err
}
const getTypeof = `-- name: GetTypeof :one
SELECT typeof('ABCDE')
`
func (q *Queries) GetTypeof(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getTypeof)
var typeof string
err := row.Scan(&typeof)
return typeof, err
}
const getUnicode = `-- name: GetUnicode :one
SELECT unicode('A')
`
func (q *Queries) GetUnicode(ctx context.Context) (int64, error) {
row := q.db.QueryRowContext(ctx, getUnicode)
var unicode int64
err := row.Scan(&unicode)
return unicode, err
}
const getUnlikely = `-- name: GetUnlikely :one
SELECT unlikely('12345')
`
func (q *Queries) GetUnlikely(ctx context.Context) (interface{}, error) {
row := q.db.QueryRowContext(ctx, getUnlikely)
var unlikely interface{}
err := row.Scan(&unlikely)
return unlikely, err
}
const getUpper = `-- name: GetUpper :one
SELECT upper('abcde')
`
func (q *Queries) GetUpper(ctx context.Context) (string, error) {
row := q.db.QueryRowContext(ctx, getUpper)
var upper string
err := row.Scan(&upper)
return upper, err
}
const getZeroblob = `-- name: GetZeroblob :one
SELECT zeroblob(16)
`
func (q *Queries) GetZeroblob(ctx context.Context) ([]byte, error) {
row := q.db.QueryRowContext(ctx, getZeroblob)
var zeroblob []byte
err := row.Scan(&zeroblob)
return zeroblob, err
}