db

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddTagNoteParams added in v1.4.1

type AddTagNoteParams struct {
	NoteID int64
	TagID  int64
}

type CreateNoteParams added in v1.4.1

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

type CreatePrivateNoteParams added in v1.4.1

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 added in v1.4.1

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

type GetNoteByIDRow added in v1.4.1

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

type GetPrivateNoteByIDRow added in v1.4.1

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 added in v1.4.1

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

func (*Queries) AddTagNote added in v1.4.1

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

func (*Queries) CreateNote added in v1.4.1

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

func (*Queries) CreatePrivateNote added in v1.4.1

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

func (*Queries) GetEncryptDataByID added in v1.4.1

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

func (*Queries) GetNoteByID added in v1.4.1

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

func (*Queries) GetPrivateNoteByID added in v1.4.1

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

func (*Queries) GetTagIDByName added in v1.4.1

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 added in v1.4.1

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

func (*Queries) RestoreNoteByID added in v1.4.1

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

func (*Queries) SoftDeleteNoteByID added in v1.4.1

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

func (*Queries) TogglePinNoteByID added in v1.4.1

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

func (*Queries) UpdateNoteByID added in v1.4.1

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

func (*Queries) UpdatePrivateNoteByID added in v1.4.1

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

func (*Queries) WithTx

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

type SoftDeleteNoteByIDParams added in v1.4.1

type SoftDeleteNoteByIDParams struct {
	DeletedAt sql.NullString
	ID        int64
}

type Tag

type Tag struct {
	ID   int64
	Name string
}

type UpdateNoteByIDParams added in v1.4.1

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

type UpdatePrivateNoteByIDParams added in v1.4.1

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