func NewDatabase(dsn string) (*sql.DB, error) {
	conn, err := sql.Open("pgx", dsn)
	if err != nil {
		return nil, err
	}

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

	return conn, nil
}
// NewDatabase creates a new database for the application
NewDatabase creates a new database for the application
// NewDatabase creates a new database for the application
func NewDatabase(dsn string) (*sql.DB, error) {
	conn, err := sql.Open("pgx", dsn)
	if err != nil {
		return nil, err
	}
	if err = conn.Ping(); err != nil {
		return nil, err
	}
	return conn, nil
}
func NewDatabase ( dsn string ) ( * sql . DB , error ) { conn , err := sql . Open ( " " , dsn ) if err != nil { return nil , err } if err = conn . Ping ( ) ; err != nil { return nil , err } return conn , nil }
NewDatabase creates a new database for the application
NewDatabase creates a new database for the application