db

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProviderNotSupported = errors.New("Unsupported database provider")

ErrProviderNotSupported database provider given is not supported

Functions

This section is empty.

Types

type DB

type DB interface {
	GetAllNotes(sortBy, order string) (note.Notes, error)
	GetAllBookNotes(book *note.Book, sortBy, order string) (note.Notes, error)
	GetNoteByID(id int64) (*note.Note, error)
	GetNoteByNote(n *note.Note) error
	GetAllNotesByIDs(ids []int64) (note.Notes, error)
	CreateNote(n *note.Note) error
	EditNote(n *note.Note) error
	DeleteNote(n *note.Note) error

	GetAllBooks() (note.Books, error)
	GetOrCreateBookByName(name string) (*note.Book, error)
	GetBookByName(name string) (*note.Book, error)
	CreateBook(b *note.Book) error
	MergeBooks(b1 *note.Book, b2 *note.Book) error
	EditNoteByIDBook(ids []int64, bk *note.Book) error
	EditBook(b1 *note.Book) error
	LoadBook(b *note.Book) error
	DeleteBook(bk *note.Book) error

	GetAllBookTags(bk *note.Book) (note.Tags, error)
	GetAllTags() (note.Tags, error)
	CreateTag(t *note.Tag) error
	LoadNoteTags(n *note.Note) error
	GetOrCreateTagByName(name string) (*note.Tag, error)
	GetTagByName(name string) (*note.Tag, error)

	Close() error
}

DB interface for the database providers

func NewDatabase

func NewDatabase(provider string, options ...string) (DB, error)

NewDatabase returns a new database for the given provider

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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