/
psql.go
775 lines (708 loc) · 22.3 KB
/
psql.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
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
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
// Package driver implements an sqlboiler driver.
// It can be used by either building the main.go in the same project
// and using as a binary or using the side effect import.
package driver
import (
"database/sql"
"encoding/base64"
"fmt"
"os"
"strings"
"github.com/volatiletech/sqlboiler/importers"
"github.com/friendsofgo/errors"
"github.com/volatiletech/sqlboiler/drivers"
"github.com/volatiletech/sqlboiler/strmangle"
// Side-effect import sql driver
_ "github.com/lib/pq"
)
//go:generate go-bindata -nometadata -pkg driver -prefix override override/...
func init() {
drivers.RegisterFromInit("psql", &PostgresDriver{})
}
// Assemble is more useful for calling into the library so you don't
// have to instantiate an empty type.
func Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error) {
driver := PostgresDriver{}
return driver.Assemble(config)
}
// PostgresDriver holds the database connection string and a handle
// to the database connection.
type PostgresDriver struct {
connStr string
conn *sql.DB
}
// Templates that should be added/overridden
func (p PostgresDriver) Templates() (map[string]string, error) {
names := AssetNames()
tpls := make(map[string]string)
for _, n := range names {
b, err := Asset(n)
if err != nil {
return nil, err
}
tpls[n] = base64.StdEncoding.EncodeToString(b)
}
return tpls, nil
}
// Assemble all the information we need to provide back to the driver
func (p *PostgresDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, err error) {
defer func() {
if r := recover(); r != nil && err == nil {
dbinfo = nil
err = r.(error)
}
}()
user := config.MustString(drivers.ConfigUser)
pass, _ := config.String(drivers.ConfigPass)
dbname := config.MustString(drivers.ConfigDBName)
host := config.MustString(drivers.ConfigHost)
port := config.DefaultInt(drivers.ConfigPort, 5432)
sslmode := config.DefaultString(drivers.ConfigSSLMode, "require")
schema := config.DefaultString(drivers.ConfigSchema, "public")
whitelist, _ := config.StringSlice(drivers.ConfigWhitelist)
blacklist, _ := config.StringSlice(drivers.ConfigBlacklist)
useSchema := schema != "public"
p.connStr = PSQLBuildQueryString(user, pass, dbname, host, port, sslmode)
p.conn, err = sql.Open("postgres", p.connStr)
if err != nil {
return nil, errors.Wrap(err, "sqlboiler-psql failed to connect to database")
}
defer func() {
if e := p.conn.Close(); e != nil {
dbinfo = nil
err = e
}
}()
dbinfo = &drivers.DBInfo{
Schema: schema,
Dialect: drivers.Dialect{
LQ: '"',
RQ: '"',
UseIndexPlaceholders: true,
UseSchema: useSchema,
UseDefaultKeyword: true,
},
}
dbinfo.Tables, err = drivers.Tables(p, schema, whitelist, blacklist)
if err != nil {
return nil, err
}
return dbinfo, err
}
// PSQLBuildQueryString builds a query string.
func PSQLBuildQueryString(user, pass, dbname, host string, port int, sslmode string) string {
parts := []string{}
if len(user) != 0 {
parts = append(parts, fmt.Sprintf("user=%s", user))
}
if len(pass) != 0 {
parts = append(parts, fmt.Sprintf("password=%s", pass))
}
if len(dbname) != 0 {
parts = append(parts, fmt.Sprintf("dbname=%s", dbname))
}
if len(host) != 0 {
parts = append(parts, fmt.Sprintf("host=%s", host))
}
if port != 0 {
parts = append(parts, fmt.Sprintf("port=%d", port))
}
if len(sslmode) != 0 {
parts = append(parts, fmt.Sprintf("sslmode=%s", sslmode))
}
return strings.Join(parts, " ")
}
// TableNames connects to the postgres database and
// retrieves all table names from the information_schema where the
// table schema is schema. It uses a whitelist and blacklist.
func (p *PostgresDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error) {
var names []string
query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = $1`)
args := []interface{}{schema}
if len(whitelist) > 0 {
tables := drivers.TablesFromList(whitelist)
if len(tables) > 0 {
query += fmt.Sprintf(" and table_name in (%s)", strmangle.Placeholders(true, len(tables), 2, 1))
for _, w := range tables {
args = append(args, w)
}
}
} else if len(blacklist) > 0 {
tables := drivers.TablesFromList(blacklist)
if len(tables) > 0 {
query += fmt.Sprintf(" and table_name not in (%s)", strmangle.Placeholders(true, len(tables), 2, 1))
for _, b := range tables {
args = append(args, b)
}
}
}
query += ` order by table_name;`
rows, err := p.conn.Query(query, args...)
if err != nil {
return nil, err
}
defer rows.Close()
for rows.Next() {
var name string
if err := rows.Scan(&name); err != nil {
return nil, err
}
names = append(names, name)
}
return names, nil
}
// Columns takes a table name and attempts to retrieve the table information
// from the database information_schema.columns. It retrieves the column names
// and column types and returns those as a []Column after TranslateColumnType()
// converts the SQL types to Go types, for example: "varchar" to "string"
func (p *PostgresDriver) Columns(schema, tableName string, whitelist, blacklist []string) ([]drivers.Column, error) {
var columns []drivers.Column
args := []interface{}{schema, tableName}
query := `
select
c.column_name,
ct.column_type,
(
case when c.character_maximum_length != 0
then
(
ct.column_type || '(' || c.character_maximum_length || ')'
)
else c.udt_name
end
) as column_full_type,
c.udt_name,
e.data_type as array_type,
c.domain_name,
c.column_default,
c.is_nullable = 'YES' as is_nullable,
(case
when (select
case
when column_name = 'is_identity' then (select c.is_identity = 'YES' as is_identity)
else
false
end as is_identity from information_schema.columns
WHERE table_schema='information_schema' and table_name='columns' and column_name='is_identity') IS NULL then 'NO' else is_identity end) = 'YES' as is_identity,
(select exists(
select 1
from information_schema.table_constraints tc
inner join information_schema.constraint_column_usage as ccu on tc.constraint_name = ccu.constraint_name
where tc.table_schema = $1 and tc.constraint_type = 'UNIQUE' and ccu.constraint_schema = $1 and ccu.table_name = c.table_name and ccu.column_name = c.column_name and
(select count(*) from information_schema.constraint_column_usage where constraint_schema = $1 and constraint_name = tc.constraint_name) = 1
)) OR
(select exists(
select 1
from pg_indexes pgix
inner join pg_class pgc on pgix.indexname = pgc.relname and pgc.relkind = 'i' and pgc.relnatts = 1
inner join pg_index pgi on pgi.indexrelid = pgc.oid
inner join pg_attribute pga on pga.attrelid = pgi.indrelid and pga.attnum = ANY(pgi.indkey)
where
pgix.schemaname = $1 and pgix.tablename = c.table_name and pga.attname = c.column_name and pgi.indisunique = true
)) as is_unique
from information_schema.columns as c
inner join pg_namespace as pgn on pgn.nspname = c.udt_schema
left join pg_type pgt on c.data_type = 'USER-DEFINED' and pgn.oid = pgt.typnamespace and c.udt_name = pgt.typname
left join information_schema.element_types e
on ((c.table_catalog, c.table_schema, c.table_name, 'TABLE', c.dtd_identifier)
= (e.object_catalog, e.object_schema, e.object_name, e.object_type, e.collection_type_identifier)),
lateral (select
(
case when pgt.typtype = 'e'
then
(
select 'enum.' || c.udt_name || '(''' || string_agg(labels.label, ''',''') || ''')'
from (
select pg_enum.enumlabel as label
from pg_enum
where pg_enum.enumtypid =
(
select typelem
from pg_type
where pg_type.typtype = 'b' and pg_type.typname = ('_' || c.udt_name)
limit 1
)
order by pg_enum.enumsortorder
) as labels
)
else c.data_type
end
) as column_type
) ct
where c.table_name = $2 and c.table_schema = $1`
if len(whitelist) > 0 {
cols := drivers.ColumnsFromList(whitelist, tableName)
if len(cols) > 0 {
query += fmt.Sprintf(" and c.column_name in (%s)", strmangle.Placeholders(true, len(cols), 3, 1))
for _, w := range cols {
args = append(args, w)
}
}
} else if len(blacklist) > 0 {
cols := drivers.ColumnsFromList(blacklist, tableName)
if len(cols) > 0 {
query += fmt.Sprintf(" and c.column_name not in (%s)", strmangle.Placeholders(true, len(cols), 3, 1))
for _, w := range cols {
args = append(args, w)
}
}
}
query += ` order by c.ordinal_position;`
rows, err := p.conn.Query(query, args...)
if err != nil {
return nil, err
}
defer rows.Close()
for rows.Next() {
var colName, colType, colFullType, udtName string
var defaultValue, arrayType, domainName *string
var nullable, identity, unique bool
if err := rows.Scan(&colName, &colType, &colFullType, &udtName, &arrayType, &domainName, &defaultValue, &nullable, &identity, &unique); err != nil {
return nil, errors.Wrapf(err, "unable to scan for table %s", tableName)
}
column := drivers.Column{
Name: colName,
DBType: colType,
FullDBType: colFullType,
ArrType: arrayType,
DomainName: domainName,
UDTName: udtName,
Nullable: nullable,
Unique: unique,
}
if defaultValue != nil {
column.Default = *defaultValue
}
if identity != false {
column.Default = "IDENTITY"
}
columns = append(columns, column)
}
return columns, nil
}
// PrimaryKeyInfo looks up the primary key for a table.
func (p *PostgresDriver) PrimaryKeyInfo(schema, tableName string) (*drivers.PrimaryKey, error) {
pkey := &drivers.PrimaryKey{}
var err error
query := `
select tc.constraint_name
from information_schema.table_constraints as tc
where tc.table_name = $1 and tc.constraint_type = 'PRIMARY KEY' and tc.table_schema = $2;`
row := p.conn.QueryRow(query, tableName, schema)
if err = row.Scan(&pkey.Name); err != nil {
if err == sql.ErrNoRows {
return nil, nil
}
return nil, err
}
queryColumns := `
select kcu.column_name
from information_schema.key_column_usage as kcu
where constraint_name = $1 and table_name = $2 and table_schema = $3
order by kcu.ordinal_position;`
var rows *sql.Rows
if rows, err = p.conn.Query(queryColumns, pkey.Name, tableName, schema); err != nil {
return nil, err
}
defer rows.Close()
var columns []string
for rows.Next() {
var column string
err = rows.Scan(&column)
if err != nil {
return nil, err
}
columns = append(columns, column)
}
if err = rows.Err(); err != nil {
return nil, err
}
pkey.Columns = columns
return pkey, nil
}
// ForeignKeyInfo retrieves the foreign keys for a given table name.
func (p *PostgresDriver) ForeignKeyInfo(schema, tableName string) ([]drivers.ForeignKey, error) {
var fkeys []drivers.ForeignKey
query := `
select
pgcon.conname,
pgc.relname as source_table,
pgasrc.attname as source_column,
dstlookupname.relname as dest_table,
pgadst.attname as dest_column
from pg_namespace pgn
inner join pg_class pgc on pgn.oid = pgc.relnamespace and pgc.relkind = 'r'
inner join pg_constraint pgcon on pgn.oid = pgcon.connamespace and pgc.oid = pgcon.conrelid
inner join pg_class dstlookupname on pgcon.confrelid = dstlookupname.oid
inner join pg_attribute pgasrc on pgc.oid = pgasrc.attrelid and pgasrc.attnum = ANY(pgcon.conkey)
inner join pg_attribute pgadst on pgcon.confrelid = pgadst.attrelid and pgadst.attnum = ANY(pgcon.confkey)
where pgn.nspname = $2 and pgc.relname = $1 and pgcon.contype = 'f'
order by pgcon.conname, source_table, source_column, dest_table, dest_column`
var rows *sql.Rows
var err error
if rows, err = p.conn.Query(query, tableName, schema); err != nil {
return nil, err
}
for rows.Next() {
var fkey drivers.ForeignKey
var sourceTable string
fkey.Table = tableName
err = rows.Scan(&fkey.Name, &sourceTable, &fkey.Column, &fkey.ForeignTable, &fkey.ForeignColumn)
if err != nil {
return nil, err
}
fkeys = append(fkeys, fkey)
}
if err = rows.Err(); err != nil {
return nil, err
}
return fkeys, nil
}
// TranslateColumnType converts postgres database types to Go types, for example
// "varchar" to "string" and "bigint" to "int64". It returns this parsed data
// as a Column object.
func (p *PostgresDriver) TranslateColumnType(c drivers.Column) drivers.Column {
if c.Nullable {
switch c.DBType {
case "bigint", "bigserial":
c.Type = "null.Int64"
case "integer", "serial":
c.Type = "null.Int"
case "smallint", "smallserial":
c.Type = "null.Int16"
case "decimal", "numeric":
c.Type = "types.NullDecimal"
case "double precision":
c.Type = "null.Float64"
case "real":
c.Type = "null.Float32"
case "bit", "interval", "bit varying", "character", "money", "character varying", "cidr", "inet", "macaddr", "text", "uuid", "xml":
c.Type = "null.String"
case `"char"`:
c.Type = "null.Byte"
case "bytea":
c.Type = "null.Bytes"
case "json", "jsonb":
c.Type = "null.JSON"
case "boolean":
c.Type = "null.Bool"
case "date", "time", "timestamp without time zone", "timestamp with time zone", "time without time zone", "time with time zone":
c.Type = "null.Time"
case "point":
c.Type = "pgeo.NullPoint"
case "line":
c.Type = "pgeo.NullLine"
case "lseg":
c.Type = "pgeo.NullLseg"
case "box":
c.Type = "pgeo.NullBox"
case "path":
c.Type = "pgeo.NullPath"
case "polygon":
c.Type = "pgeo.NullPolygon"
case "circle":
c.Type = "pgeo.NullCircle"
case "ARRAY":
var dbType string
c.Type, dbType = getArrayType(c)
// Make DBType something like ARRAYinteger for parsing with randomize.Struct
c.DBType += dbType
case "USER-DEFINED":
switch c.UDTName {
case "hstore":
c.Type = "types.HStore"
c.DBType = "hstore"
case "citext":
c.Type = "null.String"
default:
c.Type = "string"
fmt.Fprintf(os.Stderr, "warning: incompatible data type detected: %s\n", c.UDTName)
}
default:
c.Type = "null.String"
}
} else {
switch c.DBType {
case "bigint", "bigserial":
c.Type = "int64"
case "integer", "serial":
c.Type = "int"
case "smallint", "smallserial":
c.Type = "int16"
case "decimal", "numeric":
c.Type = "types.Decimal"
case "double precision":
c.Type = "float64"
case "real":
c.Type = "float32"
case "bit", "interval", "uuint", "bit varying", "character", "money", "character varying", "cidr", "inet", "macaddr", "text", "uuid", "xml":
c.Type = "string"
case `"char"`:
c.Type = "types.Byte"
case "json", "jsonb":
c.Type = "types.JSON"
case "bytea":
c.Type = "[]byte"
case "boolean":
c.Type = "bool"
case "date", "time", "timestamp without time zone", "timestamp with time zone", "time without time zone", "time with time zone":
c.Type = "time.Time"
case "point":
c.Type = "pgeo.Point"
case "line":
c.Type = "pgeo.Line"
case "lseg":
c.Type = "pgeo.Lseg"
case "box":
c.Type = "pgeo.Box"
case "path":
c.Type = "pgeo.Path"
case "polygon":
c.Type = "pgeo.Polygon"
case "circle":
c.Type = "pgeo.Circle"
case "ARRAY":
var dbType string
c.Type, dbType = getArrayType(c)
// Make DBType something like ARRAYinteger for parsing with randomize.Struct
c.DBType += dbType
case "USER-DEFINED":
switch c.UDTName {
case "hstore":
c.Type = "types.HStore"
c.DBType = "hstore"
case "citext":
c.Type = "string"
default:
c.Type = "string"
fmt.Fprintf(os.Stderr, "warning: incompatible data type detected: %s\n", c.UDTName)
}
default:
c.Type = "string"
}
}
return c
}
// getArrayType returns the correct boil.Array type for each database type
func getArrayType(c drivers.Column) (string, string) {
// If a domain is created with a statement like this: "CREATE DOMAIN
// text_array AS TEXT[] CHECK ( ... )" then the array type will be null,
// but the udt name will be whatever the underlying type is with a leading
// underscore. Note that this code handles some types, but not nearly all
// the possibities. Notably, an array of a user-defined type ("CREATE
// DOMAIN my_array AS my_type[]") will be treated as an array of strings,
// which is not guaranteed to be correct.
if c.ArrType != nil {
switch *c.ArrType {
case "bigint", "bigserial", "integer", "serial", "smallint", "smallserial":
return "types.Int64Array", *c.ArrType
case "bytea":
return "types.BytesArray", *c.ArrType
case "bit", "interval", "uuint", "bit varying", "character", "money", "character varying", "cidr", "inet", "macaddr", "text", "uuid", "xml":
return "types.StringArray", *c.ArrType
case "boolean":
return "types.BoolArray", *c.ArrType
case "decimal", "numeric":
return "types.DecimalArray", *c.ArrType
case "double precision", "real":
return "types.Float64Array", *c.ArrType
default:
return "types.StringArray", *c.ArrType
}
} else {
switch c.UDTName {
case "_int4", "_int8":
return "types.Int64Array", c.UDTName
case "_bytea":
return "types.BytesArray", c.UDTName
case "_bit", "_interval", "_varbit", "_char", "_money", "_varchar", "_cidr", "_inet", "_macaddr", "_citext", "_text", "_uuid", "_xml":
return "types.StringArray", c.UDTName
case "_bool":
return "types.BoolArray", c.UDTName
case "_numeric":
return "types.DecimalArray", c.UDTName
case "_float4", "_float8":
return "types.Float64Array", c.UDTName
default:
return "types.StringArray", c.UDTName
}
}
}
// Imports for the postgres driver
func (p PostgresDriver) Imports() (importers.Collection, error) {
var col importers.Collection
col.All = importers.Set{
Standard: importers.List{
`"strconv"`,
},
}
col.Singleton = importers.Map{
"psql_upsert": {
Standard: importers.List{
`"fmt"`,
`"strings"`,
},
ThirdParty: importers.List{
`"github.com/volatiletech/sqlboiler/strmangle"`,
`"github.com/volatiletech/sqlboiler/drivers"`,
},
},
}
col.TestSingleton = importers.Map{
"psql_suites_test": {
Standard: importers.List{
`"testing"`,
},
},
"psql_main_test": {
Standard: importers.List{
`"bytes"`,
`"database/sql"`,
`"fmt"`,
`"io"`,
`"io/ioutil"`,
`"os"`,
`"os/exec"`,
`"regexp"`,
`"strings"`,
},
ThirdParty: importers.List{
`"github.com/kat-co/vala"`,
`"github.com/friendsofgo/errors"`,
`"github.com/spf13/viper"`,
`"github.com/volatiletech/sqlboiler/drivers/sqlboiler-psql/driver"`,
`"github.com/volatiletech/sqlboiler/randomize"`,
`_ "github.com/lib/pq"`,
},
},
}
col.BasedOnType = importers.Map{
"null.Float32": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Float64": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Int": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Int8": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Int16": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Int32": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Int64": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Uint": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Uint8": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Uint16": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Uint32": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Uint64": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.String": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Bool": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Time": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.JSON": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"null.Bytes": {
ThirdParty: importers.List{`"github.com/volatiletech/null"`},
},
"time.Time": {
Standard: importers.List{`"time"`},
},
"types.JSON": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.Decimal": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.BytesArray": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.Int64Array": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.Float64Array": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.BoolArray": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.StringArray": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.DecimalArray": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"types.HStore": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"pgeo.Point": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.Line": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.Lseg": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.Box": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.Path": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.Polygon": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"types.NullDecimal": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types"`},
},
"pgeo.Circle": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullPoint": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullLine": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullLseg": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullBox": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullPath": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullPolygon": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
"pgeo.NullCircle": {
ThirdParty: importers.List{`"github.com/volatiletech/sqlboiler/types/pgeo"`},
},
}
return col, nil
}