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
- type DB
- func (db *DB) Close(ctx context.Context) error
- func (db *DB) Decorations(req *xpb.DecorationsRequest) (*xpb.DecorationsReply, error)
- func (db *DB) Edges(req *xpb.EdgesRequest) (*xpb.EdgesReply, error)
- func (db *DB) Nodes(req *xpb.NodesRequest) (*xpb.NodesReply, error)
- func (db *DB) Read(ctx context.Context, req *spb.ReadRequest, f graphstore.EntryFunc) (err error)
- func (db *DB) Scan(ctx context.Context, req *spb.ScanRequest, f graphstore.EntryFunc) (err error)
- func (db *DB) Write(ctx context.Context, req *spb.WriteRequest) error
Constants ¶
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 ¶
DB is a wrapper around a sql.DB that implements graphstore.Service
func Open ¶
Open returns an opened SQL database at the given path that can be used as a GraphStore and xrefs.Service.
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.