db

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SchemaSQL string

Functions

This section is empty.

Types

type AddTagNoteParams

type AddTagNoteParams struct {
	NoteID int64
	TagID  int64
}

type CreateNoteParams

type CreateNoteParams struct {
	Title     string
	Content   string
	ImageData string
	CreatedAt string
	UpdatedAt string
}

type CreatePrivateNoteParams

type CreatePrivateNoteParams struct {
	Title           string
	Content         string
	ImageData       string
	CreatedAt       string
	UpdatedAt       string
	EncryptionSalt  []byte
	EncryptionNonce []byte
	IsEncrypted     bool
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetEncryptDataByIDRow

type GetEncryptDataByIDRow struct {
	Content         string
	EncryptionSalt  []byte
	EncryptionNonce []byte
	IsEncrypted     bool
}

type GetNoteByIDRow

type GetNoteByIDRow struct {
	ID          int64
	Title       string
	Content     string
	ImageData   string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   sql.NullString
	IsPinned    bool
	IsEncrypted bool
}

type GetPrivateNoteByIDRow

type GetPrivateNoteByIDRow struct {
	ID              int64
	Title           string
	Content         string
	ImageData       string
	CreatedAt       string
	UpdatedAt       string
	DeletedAt       sql.NullString
	IsPinned        bool
	IsEncrypted     bool
	EncryptionSalt  []byte
	EncryptionNonce []byte
}

type ListArchivedNotesRow

type ListArchivedNotesRow struct {
	ID          int64
	Title       string
	Content     string
	ImageData   string
	CreatedAt   string
	UpdatedAt   string
	DeletedAt   sql.NullString
	IsPinned    bool
	IsEncrypted bool
}

type Note

type Note struct {
	ID              int64
	Title           string
	Content         string
	ImageData       string
	CreatedAt       string
	UpdatedAt       string
	DeletedAt       sql.NullString
	EncryptionSalt  []byte
	EncryptionNonce []byte
	IsPinned        bool
	IsEncrypted     bool
}

type NoteTag

type NoteTag struct {
	NoteID int64
	TagID  int64
}

type NotesFt

type NotesFt struct {
	Title   string
	Content string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddTag

func (q *Queries) AddTag(ctx context.Context, name string) error

func (*Queries) AddTagNote

func (q *Queries) AddTagNote(ctx context.Context, arg AddTagNoteParams) error

func (*Queries) CreateNote

func (q *Queries) CreateNote(ctx context.Context, arg CreateNoteParams) (int64, error)

func (*Queries) CreatePrivateNote

func (q *Queries) CreatePrivateNote(ctx context.Context, arg CreatePrivateNoteParams) (int64, error)

func (*Queries) GetEncryptDataByID

func (q *Queries) GetEncryptDataByID(ctx context.Context, id int64) (GetEncryptDataByIDRow, error)

func (*Queries) GetNoteByID

func (q *Queries) GetNoteByID(ctx context.Context, id int64) (GetNoteByIDRow, error)

func (*Queries) GetPrivateNoteByID

func (q *Queries) GetPrivateNoteByID(ctx context.Context, id int64) (GetPrivateNoteByIDRow, error)

func (*Queries) GetTagIDByName

func (q *Queries) GetTagIDByName(ctx context.Context, name string) (int64, error)

func (*Queries) ListArchivedNotes

func (q *Queries) ListArchivedNotes(ctx context.Context) ([]ListArchivedNotesRow, error)

func (*Queries) ListTags

func (q *Queries) ListTags(ctx context.Context) ([]string, error)

func (*Queries) ListTagsByNoteID

func (q *Queries) ListTagsByNoteID(ctx context.Context, noteID int64) ([]string, error)

func (*Queries) PermanentDeleteNoteByID

func (q *Queries) PermanentDeleteNoteByID(ctx context.Context, id int64) (int64, error)

func (*Queries) RestoreNoteByID

func (q *Queries) RestoreNoteByID(ctx context.Context, id int64) (int64, error)

func (*Queries) SoftDeleteNoteByID

func (q *Queries) SoftDeleteNoteByID(ctx context.Context, arg SoftDeleteNoteByIDParams) (int64, error)

func (*Queries) TogglePinNoteByID

func (q *Queries) TogglePinNoteByID(ctx context.Context, id int64) (int64, error)

func (*Queries) UpdateNoteByID

func (q *Queries) UpdateNoteByID(ctx context.Context, arg UpdateNoteByIDParams) (int64, error)

func (*Queries) UpdatePrivateNoteByID

func (q *Queries) UpdatePrivateNoteByID(ctx context.Context, arg UpdatePrivateNoteByIDParams) (int64, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SoftDeleteNoteByIDParams

type SoftDeleteNoteByIDParams struct {
	DeletedAt sql.NullString
	ID        int64
}

type Tag

type Tag struct {
	ID   int64
	Name string
}

type UpdateNoteByIDParams

type UpdateNoteByIDParams struct {
	Title     string
	Content   string
	ImageData string
	UpdatedAt string
	ID        int64
}

type UpdatePrivateNoteByIDParams

type UpdatePrivateNoteByIDParams struct {
	Title           string
	Content         string
	ImageData       string
	UpdatedAt       string
	EncryptionSalt  []byte
	EncryptionNonce []byte
	ID              int64
}

Jump to

Keyboard shortcuts

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