postgresql.go 333 B

1234567891011121314
  1. package postgres
  2. import (
  3. // imports the driver.
  4. "git.i2edu.net/i2/go-zero/core/stores/sqlx"
  5. _ "github.com/lib/pq"
  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. }