Skip to content

Database Schema

Sublarr uses SQLite by default (PostgreSQL supported via SUBLARR_DATABASE_URL).

The database is at /config/sublarr.db inside the container.


Tracks all background jobs (translation, search, sync, OCR).

ColumnTypeDescription
idTEXTUUID primary key
typeTEXTJob type: translate, search, sync, ocr, batch
statusTEXTpending, running, done, error
file_pathTEXTTarget file path
progressINTEGER0–100 progress percentage
error_msgTEXTError message if status = error
created_atDATETIMEJob creation timestamp
updated_atDATETIMELast status update
result_jsonTEXTJSON blob with job results

Aggregates subtitle activity per day for the Statistics page.

ColumnTypeDescription
dateTEXTISO date string YYYY-MM-DD
downloadsINTEGERSubtitles downloaded that day
translationsINTEGERTranslations completed
upgradesINTEGERSubtitle upgrades performed
failuresINTEGERFailed operations

Runtime configuration overrides that take precedence over environment variables. Edited via the Settings UI.

ColumnTypeDescription
keyTEXTSetting key (e.g. ollama_model)
valueTEXTSetting value as string
updated_atDATETIMELast update timestamp

Queue of episodes/movies that need subtitles.

ColumnTypeDescription
idINTEGERAuto-increment primary key
file_pathTEXTAbsolute path to video file
series_idINTEGERSonarr/Radarr series ID
episode_idINTEGERSonarr episode ID (NULL for movies)
titleTEXTSeries/movie title
seasonINTEGERSeason number
episodeINTEGEREpisode number
target_languageTEXTTarget subtitle language
subtitle_typeTEXTass, srt, or any
existing_subTEXTPath to existing subtitle (empty = missing)
attemptsINTEGERNumber of search attempts made
next_attempt_atDATETIMEAdaptive backoff: earliest next attempt time
created_atDATETIMEWhen the item was first detected
updated_atDATETIMELast update

Unique constraint: (file_path, target_language, subtitle_type) prevents duplicates.

Records every subtitle upgrade performed.

ColumnTypeDescription
idINTEGERAuto-increment primary key
file_pathTEXTVideo file path
old_subtitleTEXTPath to replaced subtitle
new_subtitleTEXTPath to replacement subtitle
old_scoreINTEGERScore of replaced subtitle
new_scoreINTEGERScore of replacement subtitle
reasonTEXTUpgrade reason (e.g. SRT->ASS format upgrade)
created_atDATETIMETimestamp

Caches subtitle search results to avoid redundant provider requests.

ColumnTypeDescription
idINTEGERAuto-increment primary key
cache_keyTEXTSHA-256 of query parameters (unique)
providerTEXTProvider name
results_jsonTEXTJSON array of search results
created_atDATETIMECache timestamp
expires_atDATETIMEExpiry timestamp (based on Settings → Providers → Cache TTL)

Per-provider download counters used for success-rate statistics.

ColumnTypeDescription
idINTEGERAuto-increment primary key
providerTEXTProvider name
languageTEXTSubtitle language code
formatTEXTass or srt
scoreINTEGERSubtitle score at download time
created_atDATETIMEDownload timestamp

Full audit log of every subtitle download.

ColumnTypeDescription
idINTEGERAuto-increment primary key
file_pathTEXTVideo file path
subtitle_pathTEXTDownloaded subtitle path
providerTEXTProvider that supplied the subtitle
languageTEXTSubtitle language
formatTEXTass or srt
scoreINTEGERFinal subtitle score
translatedBOOLEANWhether subtitle was translated
created_atDATETIMETimestamp

User-defined term pairs injected into translation prompts.

ColumnTypeDescription
idINTEGERAuto-increment primary key
source_termTEXTOriginal term
target_termTEXTTranslated equivalent
language_pairTEXTe.g. ja-de or en-de
created_atDATETIMECreation timestamp

Named language profile definitions.

ColumnTypeDescription
idINTEGERAuto-increment primary key
nameTEXTProfile name (unique)
target_languageTEXTISO 639-1 target language code
source_languageTEXTISO 639-1 source language code
format_preferenceTEXTass, srt, or any
translation_backendTEXTBackend name: ollama, deepl, libretranslate, etc.
prompt_preset_idINTEGERFK to prompt_presets
upgrade_enabledBOOLEANWhether to auto-upgrade subs in this profile
created_atDATETIMECreation timestamp

Maps Sonarr series IDs to language profiles.

ColumnTypeDescription
series_idINTEGERSonarr series ID
profile_idINTEGERFK to language_profiles

Maps Radarr movie IDs to language profiles.

ColumnTypeDescription
movie_idINTEGERRadarr movie ID
profile_idINTEGERFK to language_profiles

Subtitles that have been manually or automatically blacklisted.

ColumnTypeDescription
idINTEGERAuto-increment primary key
file_pathTEXTVideo file path
subtitle_hashTEXTSHA-256 of blacklisted subtitle
providerTEXTProvider that supplied the subtitle
reasonTEXTBlacklist reason
created_atDATETIMETimestamp

Saved search filter configurations for the Wanted page.

ColumnTypeDescription
idINTEGERAuto-increment primary key
nameTEXTPreset name
filter_jsonTEXTJSON blob of filter settings
created_atDATETIMETimestamp

Translation prompt templates (built-in + user-created).

ColumnTypeDescription
idINTEGERAuto-increment primary key
nameTEXTPreset name (unique)
prompt_templateTEXTTemplate text with {source_language} and {target_language} placeholders
is_defaultBOOLEANWhether this is the active default preset
is_builtinBOOLEANWhether this is a built-in template
created_atDATETIMECreation timestamp

Built-in presets: Anime, Documentary, Casual, Literal, Dubbed.


Caches ffprobe metadata results to avoid repeated scans.

ColumnTypeDescription
file_pathTEXTAbsolute path to video file (primary key)
mtimeFLOATFile modification time at cache time
metadata_jsonTEXTJSON ffprobe output
cached_atDATETIMECache timestamp

Cache invalidation: mtime changes trigger a rescan.


Maps TVDB series/episode IDs to AniDB absolute episode numbers.

ColumnTypeDescription
tvdb_series_idINTEGERTVDB series ID
tvdb_seasonINTEGERTVDB season number
tvdb_episodeINTEGERTVDB episode number
anidb_aidINTEGERAniDB anime ID
absolute_episodeINTEGERAbsolute episode number in AniDB order
updated_atDATETIMELast sync timestamp

This table is populated by the weekly AniDB sync (anidb_sync.py).


Per-series configuration overrides.

ColumnTypeDescription
series_idINTEGERSonarr series ID (primary key)
glossary_jsonTEXTJSON array of term overrides for this series
forced_sub_preferenceTEXTdisabled, separate, or auto
updated_atDATETIMELast update

SQLite backups are stored as .db files in the directory configured under Settings → System → Backup directory (default /config/backups). Each backup is a full SQLite hot copy created via the SQLite backup API (no interruption to active reads/writes).

For PostgreSQL, use standard pg_dump — Sublarr does not manage PostgreSQL backups.