ddb5267a3b
* add goreleaser config * update go.mod / gitignore * dev/cross cleanup * switch to cgo-less sqlite driver * workflows * fix build workflow Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
19 lines
277 B
Go
19 lines
277 B
Go
package postgres
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
_ "modernc.org/sqlite"
|
|
)
|
|
|
|
func New(connStr string) (*PostgresAccessor, error) {
|
|
db, err := sql.Open("postgres", connStr+" sslmode=disable")
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
sq := &PostgresAccessor{db: db}
|
|
return sq, nil
|
|
}
|