mapserver/mapobjectdb/postgres/new.go
Buckaroo Banzai ddb5267a3b
Go releaser (#238)
* 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>
2022-02-01 14:59:29 +01:00

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
}