Documentation
¶
Overview ¶
Package db provides a SQLite-backed persistence layer for the deploy tool.
It stores deployment execution records (status, output, timestamps) and user-defined key-value configuration. The database is created automatically on first use and migrations are applied on Open.
Index ¶
- type DB
- func (d *DB) Close() error
- func (d *DB) DeleteConfig(key string) error
- func (d *DB) GetConfig(key string) (*types.ConfigEntry, error)
- func (d *DB) GetDeployment(id int64) (*types.DeploymentRecord, error)
- func (d *DB) InsertDeployment(name, hash, description, filePath, pluginName string) (int64, error)
- func (d *DB) ListConfig() ([]types.ConfigEntry, error)
- func (d *DB) ListPlugins() ([]types.PluginRecord, error)
- func (d *DB) QueryDeployments(filter string) ([]types.DeploymentRecord, error)
- func (d *DB) SetConfig(key, value string) error
- func (d *DB) TouchPluginUsed(name string) error
- func (d *DB) UpdateDeploymentStatus(id int64, status, output string) error
- func (d *DB) UpsertPlugin(name, source, version, execPath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps the SQLite connection.
func (*DB) DeleteConfig ¶
DeleteConfig removes a config key.
func (*DB) GetConfig ¶
func (d *DB) GetConfig(key string) (*types.ConfigEntry, error)
GetConfig retrieves a config value by key.
func (*DB) GetDeployment ¶
func (d *DB) GetDeployment(id int64) (*types.DeploymentRecord, error)
GetDeployment returns a deployment by ID.
func (*DB) InsertDeployment ¶
InsertDeployment creates a new deployment record and returns its ID.
func (*DB) ListConfig ¶
func (d *DB) ListConfig() ([]types.ConfigEntry, error)
ListConfig returns all config entries.
func (*DB) ListPlugins ¶
func (d *DB) ListPlugins() ([]types.PluginRecord, error)
ListPlugins returns all registered plugins.
func (*DB) QueryDeployments ¶
func (d *DB) QueryDeployments(filter string) ([]types.DeploymentRecord, error)
QueryDeployments searches deployments by an optional filter (name, hash, status, or description substring).
func (*DB) TouchPluginUsed ¶
TouchPluginUsed updates the last_used_at timestamp for a plugin.
func (*DB) UpdateDeploymentStatus ¶
UpdateDeploymentStatus sets the final status and output of a deployment.
func (*DB) UpsertPlugin ¶
UpsertPlugin records a plugin, updating it if it already exists.