refactor: move postgres to pg package (#1781)
This commit is contained in:
14
core/stores/pg/postgresql.go
Normal file
14
core/stores/pg/postgresql.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package pg
|
||||
|
||||
import (
|
||||
// imports the driver, don't remove this comment, golint requires.
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||
)
|
||||
|
||||
const postgresDriverName = "postgres"
|
||||
|
||||
// New returns a postgres connection.
|
||||
func New(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn {
|
||||
return sqlx.NewSqlConn(postgresDriverName, datasource, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user