// If maxIdleCons <= 0, no idle connections are retained
// If connMaxLifetime <= 0, connections are reused forever.
If maxIdleCons <= 0, no idle connections are retained
If connMaxLifetime <= 0, connections are reused forever.
// If maxIdleCons < = 0 no idle connections are retained // If connMaxLifetime < = 0 connections are reused forever .
func NewDB(maxIdleCons int, connMaxLifetime time.Duration, logger hclog.Logger) (DB, error) {
	db, err := sql.Open("sqlite3", "file::memory:?cache=shared")
	if err != nil {
		return nil, err
	}
	db.SetMaxIdleConns(maxIdleCons)
	db.SetConnMaxLifetime(connMaxLifetime)
	return &DbSqlite{db: db, logger: logger}, nil
}
func NewDB ( maxIdleCons int , connMaxLifetime time . Duration , logger hclog . Logger ) ( DB , error ) { db , err := sql . Open ( " " , " " ) if err != nil { return nil , err } db . SetMaxIdleConns ( maxIdleCons ) db . SetConnMaxLifetime ( connMaxLifetime ) return & DbSqlite { db : db , logger : logger } , nil }
If maxIdleCons <= 0, no idle connections are retained
If connMaxLifetime <= 0, connections are reused forever.
If maxIdleCons < = 0 no idle connections are retained If connMaxLifetime < = 0 connections are reused forever .