forked from aakash-rajur/sqlxgen
/
pg.go
48 lines (45 loc) · 1.21 KB
/
pg.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
package config
import (
"github.com/mvoorberg/sqlxgen/internal/config/types"
"github.com/mvoorberg/sqlxgen/internal/utils"
)
func defaultPgConfig() *Config {
cfg := &Config{
Name: utils.PointerTo("default"),
Engine: utils.PointerTo("postgresql"),
Database: &types.Database{
Host: utils.PointerTo("localhost"),
Port: utils.PointerTo("5432"),
Db: utils.PointerTo("postgres"),
User: utils.PointerTo("postgres"),
Password: utils.PointerTo("postgres"),
SslMode: utils.PointerTo("disable"),
Url: utils.PointerTo("postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable"),
},
Source: &types.Source{
Models: &types.Model{
Schemas: []string{"public"},
Include: []string{"^.+$"},
Exclude: []string{},
},
Queries: &types.Query{
Paths: []string{},
Include: []string{"^.+$"},
Exclude: []string{},
},
},
Options: &types.Option{
PostgresModelBanner: utils.PointerTo("This is a Postgres generated model. DO NOT EDIT."),
PostgresInt64JsonString: utils.PointerTo(false),
},
Gen: &types.Gen{
Store: &types.GenPartial{
Path: "gen/store",
},
Model: &types.GenPartial{
Path: "gen/pg",
},
},
}
return cfg
}