graphstore

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64decode

func Base64decode(body string) ([]byte, error)

Base64decode convenience function

func Base64encode

func Base64encode(body []byte) string

Base64encode convenience function

func NewSQLGraphStore

func NewSQLGraphStore(rwdb, rodb *sqlx.DB, statements *Statements) (store.GraphStoreServer, error)

NewSQLGraphStore constructs a new GraphStore with a sql driven backend. Current queries support sqlite3 but should be able to work on mysql as well.

func ResolveDriverName

func ResolveDriverName(dbmsName string) (string, error)

ResolveDriverName resolves the sql driver to use for the given dbms system

func Retryable

func Retryable(delegate store.GraphStoreClient, maxAttempts int) store.GraphStoreClient

Retryable wraps calls to the graphStore with an exponential backoff

Types

type Statements

type Statements struct {
	CreateGraphDataTable                  string `json:"createGraphDataTable"`
	InsertGraphData                       string `json:"insertGraphData"`
	DeleteGraphData                       string `json:"deleteGraphData"`
	ListGraphData                         string `json:"listGraphData"`
	SelectGraphDataUpstreamDependencies   string `json:"selectGraphDataUpstreamDependencies"`
	SelectGraphDataDownstreamDependencies string `json:"selectGraphDataDownstreamDependencies"`
}

Statements defines the SQL statements that are used by the GraphStore. Each statement should use named parameters.

func DefaultStatementsFor

func DefaultStatementsFor(driver string) (*Statements, error)

DefaultStatementsFor the given database driver

func LoadStatements

func LoadStatements(contents []byte) (*Statements, error)

LoadStatements parses contents into their corresponding statements

func LoadStatementsFile

func LoadStatementsFile(yamlFile string) (*Statements, error)

LoadStatementsFile loads an external yaml file containing SQL statements

Jump to

Keyboard shortcuts

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