Documentation
¶
Overview ¶
pgdoc wraps a postgresql database into a simple document database using the json column
Index ¶
- Variables
- type Database
- func (d *Database) Close() error
- func (d *Database) CreateIndex(tableOrLink string, idxName string, propPath ...string) error
- func (d *Database) DropIndex(tableOrLink string, idxName string) error
- func (d *Database) Link(name string) (*Link, error)
- func (d *Database) Table(name string) (*Table, error)
- func (d *Database) Truncate(tblOrLink string) error
- func (d *Database) Unique(tableOrLink string, idxName string, propPath ...string) error
- type Iterator
- type Link
- func (l *Link) Connect(val interface{}) (string, error)
- func (l *Link) From(from string) Iterator
- func (l *Link) Label(label string) Iterator
- func (l *Link) Load(out interface{}, id string) error
- func (l *Link) LoadMany(from, to, label string) Iterator
- func (l *Link) Name() string
- func (l *Link) To(to string) Iterator
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrIndexAlreadyExists = errors.New("index already exists on database")
)
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func OpenDatabase ¶
func (*Database) CreateIndex ¶
type Iterator ¶
type Iterator interface { // Move the iterator to the next value. // // IMPORTANT! The iterator starts behind the first value, ie, // before reading the first value you MUST CALL Next. // // When Next returns false this could mean that no more data // is available or an error happend. Call Err() to distinguish // between the cases. // // When Next returns false, Close is called so, iterating using // for it.Next() { /* ... */ } will close this iterator, as long // the for body don't panic. // // You can call Close multiple times without any problem. Next() bool // Scan the next value into out Scan(out interface{}) error // Return the last error found when calling Scan or ErrClosed, // if we don't have more data Err() error // Close this iterator and return any error, errors that happend // while calling Scan aren't returned here. // // Calls to Close are idempotent Close() error }
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.