postgresql.go 336 B

1234567891011121314
  1. package postgres
  2. import (
  3. // imports the driver.
  4. _ "github.com/lib/pq"
  5. "github.com/tal-tech/go-zero/core/stores/sqlx"
  6. )
  7. const postgresDriverName = "postgres"
  8. // New returns a postgres connection.
  9. func New(datasource string, opts ...sqlx.SqlOption) sqlx.SqlConn {
  10. return sqlx.NewSqlConn(postgresDriverName, datasource, opts...)
  11. }