postgresql.go 382 B

1234567891011121314
  1. package postgres
  2. import (
  3. // imports the driver, don't remove this comment, golint requires.
  4. _ "github.com/jackc/pgx/v5"
  5. "github.com/zeromicro/go-zero/core/stores/sqlx"
  6. )
  7. const postgresDriverName = "pgx"
  8. // New returns a postgres connection.
  9. func New(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn {
  10. return sqlx.NewSqlConn(postgresDriverName, datasource, opts...)
  11. }