digikam

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package digikam provides utilities accessing SQLite3-based Digikam databases.

It could be updated for other databases that Digikam might use in the future.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLStore added in v1.1.0

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

SQLStore is an implementation of Store.

func (*SQLStore) Close added in v1.1.0

func (s *SQLStore) Close()

Close cleans up the resources and closes the backing database.

func (*SQLStore) FindFileWithNameAndCam added in v1.1.0

func (s *SQLStore) FindFileWithNameAndCam(name string, camMaker, camModel string) (string, error)

FindFileWithNameAndCam returns the filesystem path to the image matching the basename, the camera maker and the camera model (to distinguish pictures from different cameras that happen to have the same basename).

This could match on date proximity as well, or matching whether a year or year+month appears in the filepath, or similar attributes that could disambiguate in case name+camMaker+camModel result in multiple results, but it currently does not.

Bug: There is no detection if multiple matches are present in the Digikam database.

type Store

type Store interface {
	Close()
	FindFileWithNameAndCam(name string, camMaker, camModel string) (string, error)
}

Store is a wrapper around a Digikam store, and has utility functions querying and accessing a Digikam database.

func New deprecated

func New(path string) (Store, error)

New returns a Store at the passed local filesystem path, loaded with the default database/sql driver "sqlite3".

Deprecated: use NewWithDriver. Will likely be updated to accept same args as NewWithDriver.

func NewWithDB added in v1.1.0

func NewWithDB(db *sql.DB) (Store, error)

NewWithDB returns a Store based on a preopened sql.DB. The database should be opened with the sqlite3 driver.

func NewWithDriver added in v1.1.0

func NewWithDriver(driver, path string) (Store, error)

NewWithDriver returns a Store at the passed local filesystem path, loaded with the passed database/sql driver.

Currently must be sqlite3. If another driver should be attempted, add "force:" prefix, which will be stripped before being used in sql.Open.

Jump to

Keyboard shortcuts

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