database

package
v0.102.2-nightly Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package database provides a generic database interface for the deployment system. This allows different database implementations (RQLite, SQLite, etc.) to be used interchangeably throughout the deployment handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	// Query executes a SELECT query and scans results into dest
	// dest should be a pointer to a slice of structs with `db` tags
	Query(ctx context.Context, dest interface{}, query string, args ...interface{}) error

	// QueryOne executes a SELECT query and scans a single result into dest
	// dest should be a pointer to a struct with `db` tags
	// Returns an error if no rows are found or multiple rows are returned
	QueryOne(ctx context.Context, dest interface{}, query string, args ...interface{}) error

	// Exec executes an INSERT, UPDATE, or DELETE query
	// Returns the result (typically last insert ID or rows affected)
	Exec(ctx context.Context, query string, args ...interface{}) (interface{}, error)
}

Database is a generic interface for database operations It provides methods for executing queries and commands that can be implemented by various database clients (RQLite, SQLite, etc.)

Jump to

Keyboard shortcuts

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