(dsn string)
| 17 | } |
| 18 | |
| 19 | func NewPostgresStore(dsn string) *postgresStore { |
| 20 | db := sqlx.MustConnect("postgres", dsn) |
| 21 | db.DB.SetMaxOpenConns(50) |
| 22 | db.DB.SetMaxIdleConns(10) |
| 23 | db.DB.SetConnMaxIdleTime(0) |
| 24 | return &postgresStore{ |
| 25 | DB: db, |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func (d *postgresStore) Close() { |
| 30 | d.DB.Close() |