notesdb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_SQL = 1
)

Variables

View Source
var (
	//go:embed files/create_notes_tables.sql
	CREATE_NOTES_TABLES_SQL string
)

Functions

func DeleteNote

func DeleteNote(db *sql.DB, id int64) error

func GetNoteContents

func GetNoteContents(db *sql.DB, id int64) ([]byte, error)

func Initialize

func Initialize(path string) (*sql.DB, error)

func SetNoteContents

func SetNoteContents(db *sql.DB, id int64, content []byte) error

func UpdateNote

func UpdateNote(db *sql.DB, id int64, title string) error

Types

type IndexEntry

type IndexEntry struct {
	*notes.Note
	ContentType int `json:"-"`
}

func GetNote

func GetNote(db *sql.DB, id int64) (*IndexEntry, error)

func GetNotes

func GetNotes(db *sql.DB) ([]*IndexEntry, error)

func NewNote

func NewNote(db *sql.DB, title string) (*IndexEntry, error)

type IndexEntryWithPreview

type IndexEntryWithPreview struct {
	*IndexEntry
	ContentPreview string `json:"content_preview"`
}

func GetNotesWithPreview

func GetNotesWithPreview(db *sql.DB, previewLength int) ([]*IndexEntryWithPreview, error)

Jump to

Keyboard shortcuts

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