rdf

package
v0.0.0-...-82c1157 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2014 License: BSD-3-Clause, BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

pgdoc wraps a postgresql database into a simple document database using the json column

Index

Constants

View Source
const (
	Invalid = ValueType(0)
	// RDF node holds a string
	String = ValueType(1)
	// RDF node holds a Integer
	Int = ValueType(2)
	// RDF node holds a Double
	Double = ValueType(4)
	// RDF node holds a JSON Document
	Doc = ValueType(8)
	// RDF node holds a ref to another Resource
	Ref = ValueType(16)
)
View Source
const (
	Equals        = Op("=")
	Greater       = Op(">")
	Less          = Op("<")
	GreaterEquals = Greater + Equals
	LessEquals    = Less + Equals
	NotEqual      = Op("!=")
)

Variables

View Source
var (
	ErrIndexAlreadyExists = errors.New("index already exists on database")
)

Functions

func IsNoData

func IsNoData(e error) bool

Types

type Changeset

type Changeset struct {
	// contains filtered or unexported fields
}

func (*Changeset) Abort

func (c *Changeset) Abort() error

func (*Changeset) Done

func (c *Changeset) Done() error

func (*Changeset) Err

func (c *Changeset) Err() error

func (*Changeset) NewQuery

func (c *Changeset) NewQuery() Query

Return a Query object that will consider the data updated by this changeset.

func (*Changeset) Purge

func (c *Changeset) Purge(url string) error

func (*Changeset) Save

func (c *Changeset) Save(node *Node) (Node, error)

type Database

type Database struct {
	// contains filtered or unexported fields
}

func OpenDatabase

func OpenDatabase(user, password, database, host string) (*Database, error)

func (*Database) Begin

func (d *Database) Begin() (*Changeset, error)

func (*Database) Close

func (d *Database) Close() error

func (*Database) CreateIndex

func (d *Database) CreateIndex(tableOrLink string, idxName string, propPath ...string) error

func (*Database) DropIndex

func (d *Database) DropIndex(tableOrLink string, idxName string) error

func (*Database) NewQuery

func (d *Database) NewQuery() Query

func (*Database) TruncateDatabase

func (d *Database) TruncateDatabase() (err error)

func (*Database) Unique

func (d *Database) Unique(tableOrLink string, idxName string, propPath ...string) error

type Filter

type Filter struct {
	Subject string
	Op      Op
	Type    ValueType
	Value   interface{}
}

type Node

type Node struct {
	Res     string
	Subject string
	Type    ValueType
	When    time.Time
	Value   interface{}
}

func (*Node) ScanDocument

func (r *Node) ScanDocument(out interface{}) error

type Op

type Op string

type Query

type Query struct {
	// contains filtered or unexported fields
}

func (*Query) AddFilter

func (q *Query) AddFilter(f Filter) *Query

func (*Query) CopyFilterFrom

func (q *Query) CopyFilterFrom(other *Query) *Query

func (*Query) Done

func (q *Query) Done() error

func (*Query) Exec

func (q *Query) Exec() error

Return the list of resources that have all filters as true

func (*Query) FetchResource

func (q *Query) FetchResource(url string) error

func (*Query) Result

func (q *Query) Result() []Node

type ValueType

type ValueType uint8

func (ValueType) String

func (vt ValueType) String() string

func (ValueType) Valid

func (vt ValueType) Valid() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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