postgresql.go 312 B

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