database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package database provides SQLite database operations for the Olsen photo indexer.

It implements a portable catalog design where all metadata, thumbnails, and color palettes are stored in a single SQLite file with WAL mode enabled for concurrent read access. The database schema supports photos, bursts, duplicates, tags, and collections.

Index

Constants

View Source
const FacetMetadataInserts = `` /* 392-byte string literal not displayed */
View Source
const Schema = `` /* 6539-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

DB wraps the SQLite database connection

func Open

func Open(path string) (*DB, error)

Open creates a new database connection and initializes the schema

func (*DB) DeletePhoto

func (db *DB) DeletePhoto(filePath string) error

DeletePhoto deletes a photo and all related data (thumbnails, colors, etc.) by file path

func (*DB) GetPhotoCount

func (db *DB) GetPhotoCount() (int, error)

GetPhotoCount returns the total number of photos in the database

func (*DB) GetPhotoHash

func (db *DB) GetPhotoHash(filePath string) (string, error)

GetPhotoHash returns the file hash for a photo by file path

func (*DB) InsertPhoto

func (db *DB) InsertPhoto(photo *models.PhotoMetadata) error

InsertPhoto inserts a photo and its related data into the database

func (*DB) PhotoExists

func (db *DB) PhotoExists(filePath string) (bool, error)

PhotoExists checks if a photo with the given file path already exists

Jump to

Keyboard shortcuts

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