refactor: move postgres to pg package (#1781)

This commit is contained in:
Kevin Wan
2022-04-13 12:46:09 +08:00
committed by GitHub
parent 50de01fb49
commit ba8ac974aa
4 changed files with 31 additions and 13 deletions

View File

@@ -1,14 +1,7 @@
package postgres
import (
// imports the driver, don't remove this comment, golint requires.
_ "github.com/lib/pq"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
import "github.com/zeromicro/go-zero/core/stores/pg"
const postgresDriverName = "postgres"
// New returns a postgres connection.
func New(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn {
return sqlx.NewSqlConn(postgresDriverName, datasource, opts...)
}
// New creates a new postgresql store.
// Deprecated: use pg.New instead.
var New = pg.New