db

package
v0.0.0-...-1d10eb6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable()

creating a new "notes" table if it doesn't already exist

func DeleteNote

func DeleteNote(id int)

for deleting a note from the "notes" table

func DropTable

func DropTable()

dropping the "notes" table if it exists (for testing or smth idk)

func InsertNote

func InsertNote(name string, content string)

Insert a new note to the "notes" table

func ListNotes

func ListNotes() []string

list all available notes

func Open

func Open() error

func UpdateNote

func UpdateNote(id int, name string, content string)

to update the note that exists, when edit and save the note, this runs (essentially the save button function)

Types

type Note

type Note struct {
	Id          int       `sql:"id"`
	Name        string    `sql:"name"`
	Content     string    `sql:"content"`
	LastUpdated time.Time `sql:"last_updated"`
}

func ReadNote

func ReadNote(id int) Note

get a single note and display its contents (to be available for editing)

Jump to

Keyboard shortcuts

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