graphdb

package
v0.0.1-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDBForTesting

func ClearDBForTesting(client Client) error

ClearDBForTesting clears the entire database.

It is very slow on large amounts of data!

func ReadQuery

func ReadQuery(client Client, query string, args map[string]interface{}) ([]interface{}, error)

func ReadQueryForTesting

func ReadQueryForTesting(client Client, query string, args map[string]interface{}) ([][]interface{}, error)

ReadQueryForTesting runs a simple read query against the graph database.

Returns the result as an interface to be handled by the caller (as records), but this is not optimal to use in production!

func WriteQueryForTesting

func WriteQueryForTesting(client Client, query string, args map[string]interface{}) error

WriteQueryForTesting runs a simple write query against the graph database.

Types

type AuthToken

type AuthToken = neo4j.AuthToken

AuthToken is the authentication token needed for connecting to the graph database. Use the `CreateAuthToken...` functions to create a token.

func CreateAuthTokenForTesting

func CreateAuthTokenForTesting() AuthToken

CreateAuthTokenForTesting creates an empty authentication token to be used in testing!

func CreateAuthTokenWithUsernameAndPassword

func CreateAuthTokenWithUsernameAndPassword(username string, password string, realm string) AuthToken

CreateAuthTokenWithUsernameAndPassword creates a simple authentication token with username, password and authentication realm. This is the method to call in most scenarios when you need an `AuthToken`.

type Client

type Client = neo4j.Driver

Client represents a client to the graph database. TODO(mihaimaruseac): Switch to v5 and `...WithContext` API when v5 is released.

func EmptyClientForTesting

func EmptyClientForTesting(dbUri string) (Client, error)

EmptyClientForTesting returns a client to an empty database.

Should only be used for testing.

func NewGraphClient

func NewGraphClient(uri string, authToken AuthToken) (Client, error)

NewGraphClient creates a new connection to the graph database given by `uri`, performing authentication via `authToken`.

type Transaction

type Transaction = neo4j.Transaction

Transaction is a transaction in the database

type TransactionWork

type TransactionWork = neo4j.TransactionWork

TransactionWork represents work done inside a `Transaction`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL