This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
e621-sdk-go/neo4j/connection.go
2023-05-22 13:08:08 +02:00

16 lines
378 B
Go

package neo4j
import (
"fmt"
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
)
func NewConnection(uri string, username string, password string) (neo4j.DriverWithContext, error) {
driver, err := neo4j.NewDriverWithContext(uri, neo4j.BasicAuth(username, password, ""))
if err != nil {
return nil, fmt.Errorf("failed to create Neo4j driver: %v", err)
}
return driver, nil
}