Skip to main content

Database Schema

Database location:

  • Linux/macOS: ~/.config/alchemist/alchemist.db
  • Linux/macOS with XDG: $XDG_CONFIG_HOME/alchemist/alchemist.db
  • Windows: %APPDATA%\Alchemist\alchemist.db
  • Override: ALCHEMIST_DB_PATH

jobs

ColumnTypeDescription
idINTEGERPrimary key
input_pathTEXTUnique source path
output_pathTEXTPlanned output path
statusTEXTCurrent job state
mtime_hashTEXTFile modification fingerprint
priorityINTEGERQueue priority
progressREALProgress percentage
attempt_countINTEGERRetry count
created_atDATETIMECreation timestamp
updated_atDATETIMELast update timestamp
archivedBOOLEANArchived flag for cleared completed jobs
health_issuesTEXTSerialized health issues from Library Doctor
last_health_checkTEXTLast library health check timestamp

encode_stats

ColumnTypeDescription
idINTEGERPrimary key
job_idINTEGERUnique foreign key to jobs.id
input_size_bytesINTEGEROriginal size
output_size_bytesINTEGEROutput size
compression_ratioREALCompression ratio
encode_time_secondsREALTotal encode duration
encode_speedREALReported encode speed
avg_bitrate_kbpsREALAverage output bitrate
vmaf_scoreREALOptional VMAF score
created_atDATETIMEInsert timestamp
output_codecTEXTOutput codec recorded with the stats row

decisions

ColumnTypeDescription
idINTEGERPrimary key
job_idINTEGERForeign key to jobs.id
actionTEXTPlanner or post-encode action
reasonTEXTLegacy machine-readable reason string retained for compatibility
reason_codeTEXTStable structured explanation code
reason_payload_jsonTEXTSerialized structured explanation payload
created_atDATETIMEInsert timestamp

job_failure_explanations

ColumnTypeDescription
job_idINTEGERPrimary key and foreign key to jobs.id
legacy_summaryTEXTLegacy failure summary retained for compatibility
codeTEXTStable structured failure code
payload_jsonTEXTSerialized structured failure explanation payload
created_atTEXTInsert timestamp
updated_atTEXTLast update timestamp

users

ColumnTypeDescription
idINTEGERPrimary key
usernameTEXTUnique login name
password_hashTEXTArgon2 password hash
created_atDATETIMEInsert timestamp

sessions

ColumnTypeDescription
tokenTEXTPrimary key session token
user_idINTEGERForeign key to users.id
expires_atDATETIMEExpiration timestamp
created_atDATETIMEInsert timestamp

logs

ColumnTypeDescription
idINTEGERPrimary key
levelTEXTLog level
job_idINTEGEROptional job association
messageTEXTLog message
created_atDATETIMEInsert timestamp

ui_preferences

ColumnTypeDescription
keyTEXTPrimary key
valueTEXTStored preference value
updated_atDATETIMELast update timestamp

watch_dirs

ColumnTypeDescription
idINTEGERPrimary key
pathTEXTUnique watched path
enabledINTEGEREnabled flag from the legacy watch-dir projection
recursiveINTEGERRecursive watch flag
extensionsTEXTOptional serialized extension filter list
created_atDATETIMEInsert timestamp
profile_idINTEGEROptional foreign key to library_profiles.id

notification_targets

ColumnTypeDescription
idINTEGERPrimary key
nameTEXTTarget name
target_typeTEXTgotify, discord, or webhook
endpoint_urlTEXTDestination URL
auth_tokenTEXTOptional auth token
eventsTEXTSerialized event list
enabledBOOLEANEnabled flag
created_atDATETIMEInsert timestamp

schedule_windows

ColumnTypeDescription
idINTEGERPrimary key
start_timeTEXTWindow start time
end_timeTEXTWindow end time
days_of_weekTEXTSerialized day list
enabledBOOLEANEnabled flag

file_settings

ColumnTypeDescription
idINTEGERSingleton row key (1)
delete_sourceBOOLEANDelete original after success
output_extensionTEXTOutput extension
output_suffixTEXTFilename suffix
replace_strategyTEXTCollision policy
output_rootTEXTOptional mirrored output root

library_profiles

ColumnTypeDescription
idINTEGERPrimary key
nameTEXTProfile name
presetTEXTPreset identifier
codecTEXTOutput codec
quality_profileTEXTQuality preset
hdr_modeTEXTHDR behavior
audio_modeTEXTAudio policy
crf_overrideINTEGEROptional CRF override
notesTEXTOptional notes
created_atTEXTInsert timestamp
updated_atTEXTLast update timestamp

health_scan_runs

ColumnTypeDescription
idINTEGERPrimary key
started_atTEXTScan start timestamp
completed_atTEXTScan completion timestamp
files_checkedINTEGERFiles examined in the run
issues_foundINTEGERIssues found in the run

schema_info

ColumnTypeDescription
keyTEXTPrimary key
valueTEXTVersion or compatibility value

Common keys include schema_version and min_compatible_version.

Migration policy

Compatibility baseline: v0.2.5.

Migration rules:

  • CREATE TABLE IF NOT EXISTS
  • ALTER TABLE ... ADD COLUMN only with NULL allowed or a DEFAULT
  • CREATE INDEX IF NOT EXISTS
  • Never remove columns
  • Never rename columns
  • Never change column types

The policy is additive only. Existing migration files are immutable.