-
Notifications
You must be signed in to change notification settings - Fork 0
/
db-impl.go
46 lines (38 loc) · 944 Bytes
/
db-impl.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
/*
* Copyright (c) 2024.
* Created by Andy Pangaribuan <https://github.com/apangaribuan>.
*
* This product is protected by copyright and distributed under
* licenses restricting copying, distribution and decompilation.
* All Rights Reserved.
*/
package db
import (
"github.com/andypangaribuan/gmod/ice"
"github.com/andypangaribuan/gmod/mol"
)
func (*stuDb) Postgres(conf mol.DbConnection) ice.DbPostgresInstance {
setPgConfDVal(&conf)
instance := &pgInstance{
rw: &stuConnection{
conf: &conf,
driverName: "postgres",
},
}
return instance
}
func (*stuDb) PostgresRW(readConf mol.DbConnection, writeConf mol.DbConnection) ice.DbPostgresInstance {
setPgConfDVal(&readConf)
setPgConfDVal(&writeConf)
instance := &pgInstance{
ro: &stuConnection{
conf: &readConf,
driverName: "postgres",
},
rw: &stuConnection{
conf: &writeConf,
driverName: "postgres",
},
}
return instance
}