func ConnectSQL(dsn string) (*DB, error) {
	conn, err := NewDatabase(dsn)
	if err != nil {
		panic(err)
	}
	conn.SetMaxOpenConns(maxOpenDbConn)
	conn.SetMaxIdleConns(maxIdleDbConn)
	conn.SetConnMaxLifetime(maxDbLifetime)
	db.Conn = conn

	if err = conn.Ping(); err != nil {
		return nil, err
	}

	return db, nil
}
// ConnectSQL creates database pool for Postgres
ConnectSQL creates database pool for Postgres
// ConnectSQL creates database pool for Postgres
func ConnectSQL(dsn string) (*DB, error) {
	conn, err := NewDatabase(dsn)
	if err != nil {
		panic(err)
	}
	conn.SetMaxOpenConns(maxOpenDbConn)
	conn.SetMaxIdleConns(maxIdleDbConn)
	conn.SetConnMaxLifetime(maxDbLifetime)
	db.Conn = conn
	if err = conn.Ping(); err != nil {
		return nil, err
	}
	return db, nil
}
func ConnectSQL ( dsn string ) ( * DB , error ) { conn , err := NewDatabase ( dsn ) if err != nil { panic ( err ) } conn . SetMaxOpenConns ( maxOpenDbConn ) conn . SetMaxIdleConns ( maxIdleDbConn ) conn . SetConnMaxLifetime ( maxDbLifetime ) db . Conn = conn if err = conn . Ping ( ) ; err != nil { return nil , err } return db , nil }
ConnectSQL creates database pool for Postgres
ConnectSQL creates database pool for Postgres