sql

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2015 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package sql implements a graphstore.Service using a SQL database backend. A specialized implementation for an xrefs.Service is also available.

Index

Constants

View Source
const SQLite3 = "sqlite3"

SQLite3 is the standard database/sql driver name for sqlite3.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}

DB is a wrapper around a sql.DB that implements graphstore.Service

func Open

func Open(driverName, dataSourceName string) (*DB, error)

Open returns an opened SQL database at the given path that can be used as a GraphStore and xrefs.Service.

func (*DB) Close

func (db *DB) Close(ctx context.Context) error

Close implements part of the graphstore.Service interface.

func (*DB) Decorations

func (db *DB) Decorations(req *xpb.DecorationsRequest) (*xpb.DecorationsReply, error)

Decorations implements part of the xrefs.Service interface.

func (*DB) Edges

func (db *DB) Edges(req *xpb.EdgesRequest) (*xpb.EdgesReply, error)

Edges implements part of the xrefs.Service interface.

func (*DB) Nodes

func (db *DB) Nodes(req *xpb.NodesRequest) (*xpb.NodesReply, error)

Nodes implements part of the xrefs.Service interface.

func (*DB) Read

func (db *DB) Read(ctx context.Context, req *spb.ReadRequest, f graphstore.EntryFunc) (err error)

Read implements part of the graphstore.Service interface.

func (*DB) Scan

func (db *DB) Scan(ctx context.Context, req *spb.ScanRequest, f graphstore.EntryFunc) (err error)

Scan implements part of the graphstore.Service interface.

TODO(fromberger): Maybe use prepared statements here.

func (*DB) Write

func (db *DB) Write(ctx context.Context, req *spb.WriteRequest) error

Write implements part of the graphstore.Service interface.

Jump to

Keyboard shortcuts

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