Documentation ¶
Index ¶
- Variables
- type Database
- func (d *Database) Close() error
- func (d *Database) CreateBook(b *note.Book) error
- func (d *Database) CreateNote(n *note.Note) error
- func (d *Database) CreateTag(t *note.Tag) error
- func (d *Database) DeleteBook(bk *note.Book) error
- func (d *Database) DeleteNote(n *note.Note) error
- func (d *Database) EditBook(b *note.Book) error
- func (d *Database) EditNote(n *note.Note) error
- func (d *Database) EditNoteByIDBook(ids []int64, bk *note.Book) error
- func (d *Database) GetAllBookNotes(book *note.Book, sortBy, order string) (note.Notes, error)
- func (d *Database) GetAllBookTags(bk *note.Book) (note.Tags, error)
- func (d *Database) GetAllBooks() (note.Books, error)
- func (d *Database) GetAllNotes(sortBy, order string) (note.Notes, error)
- func (d *Database) GetAllNotesByIDs(ids []int64) (note.Notes, error)
- func (d *Database) GetAllTags() (note.Tags, error)
- func (d *Database) GetBookByName(name string) (*note.Book, error)
- func (d *Database) GetNoteByID(id int64) (*note.Note, error)
- func (d *Database) GetNoteByNote(n *note.Note) error
- func (d *Database) GetOrCreateBookByName(name string) (*note.Book, error)
- func (d *Database) GetOrCreateTagByName(name string) (*note.Tag, error)
- func (d *Database) GetTableNames() ([]string, error)
- func (d *Database) GetTagByName(name string) (*note.Tag, error)
- func (d *Database) LoadBook(b *note.Book) error
- func (d *Database) LoadNoteTags(n *note.Note) error
- func (d *Database) MergeBooks(b1 *note.Book, b2 *note.Book) error
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidArguments = errors.New("Invalid arguments given to SQLite database")
ErrInvalidArguments invalid arguments were given
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { DBPath string // contains filtered or unexported fields }
Database provides an interface to SQLite
func NewDatabase ¶
NewDatabase returns a data Database
func (*Database) CreateBook ¶
CreateBook saves the Book to the database
func (*Database) CreateNote ¶
CreateNote saves the note to the database
func (*Database) DeleteBook ¶
DeleteBook deletes the Book from the database
func (*Database) DeleteNote ¶
DeleteNote delete note from database
func (*Database) EditNoteByIDBook ¶
EditNoteByIDBook updates all notes for the given IDs with the Book bk's ID
func (*Database) GetAllBookNotes ¶
GetAllBookNotes returns all notes for the given Notebook
func (*Database) GetAllBookTags ¶
GetAllBookTags returns all tags for the given Book
func (*Database) GetAllBooks ¶
GetAllBooks returns all Books
func (*Database) GetAllNotes ¶
GetAllNotes returns all notes
func (*Database) GetAllNotesByIDs ¶
GetAllNotesByIDs returns all notes for the given Notebook
func (*Database) GetAllTags ¶
GetAllTags returns all tags
func (*Database) GetBookByName ¶
GetBookByName returns the Book for the given name
func (*Database) GetNoteByID ¶
GetNoteByID returns the note for the given ID
func (*Database) GetNoteByNote ¶ added in v0.5.0
GetNoteByNote Loads the note's ID, Created, and Modified fields
func (*Database) GetOrCreateBookByName ¶
GetOrCreateBookByName gets the Book by name creating it if it does not exists
func (*Database) GetOrCreateTagByName ¶
GetOrCreateTagByName returns a tag, creating it if it does not exists
func (*Database) GetTableNames ¶ added in v0.5.0
GetTableNames returns a list of all table names
func (*Database) GetTagByName ¶
GetTagByName returns the tag with the given name
func (*Database) LoadNoteTags ¶
LoadNoteTags loads all the tags for the given Note