902 lines
45 KiB
HTML
902 lines
45 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="en" class="navy" dir="ltr">
|
|
<head>
|
|
<!-- Book generated using mdBook -->
|
|
<meta charset="UTF-8">
|
|
<title>Database Design - JellyTau Documentation</title>
|
|
|
|
|
|
<!-- Custom HTML head -->
|
|
|
|
<meta name="description" content="Requirements, traceability, and architecture for the JellyTau Jellyfin client.">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="theme-color" content="#ffffff">
|
|
|
|
<link rel="icon" href="../favicon.svg">
|
|
<link rel="shortcut icon" href="../favicon.png">
|
|
<link rel="stylesheet" href="../css/variables.css">
|
|
<link rel="stylesheet" href="../css/general.css">
|
|
<link rel="stylesheet" href="../css/chrome.css">
|
|
<link rel="stylesheet" href="../css/print.css" media="print">
|
|
|
|
<!-- Fonts -->
|
|
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
|
<link rel="stylesheet" href="../fonts/fonts.css">
|
|
|
|
<!-- Highlight.js Stylesheets -->
|
|
<link rel="stylesheet" href="../highlight.css">
|
|
<link rel="stylesheet" href="../tomorrow-night.css">
|
|
<link rel="stylesheet" href="../ayu-highlight.css">
|
|
|
|
<!-- Custom theme stylesheets -->
|
|
|
|
</head>
|
|
<body class="sidebar-visible no-js">
|
|
<div id="body-container">
|
|
<!-- Provide site root to javascript -->
|
|
<script>
|
|
var path_to_root = "../";
|
|
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "navy";
|
|
</script>
|
|
|
|
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
|
<script>
|
|
try {
|
|
var theme = localStorage.getItem('mdbook-theme');
|
|
var sidebar = localStorage.getItem('mdbook-sidebar');
|
|
|
|
if (theme.startsWith('"') && theme.endsWith('"')) {
|
|
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
|
}
|
|
|
|
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
|
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
|
}
|
|
} catch (e) { }
|
|
</script>
|
|
|
|
<!-- Set the theme before any content is loaded, prevents flash -->
|
|
<script>
|
|
var theme;
|
|
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
|
if (theme === null || theme === undefined) { theme = default_theme; }
|
|
var html = document.querySelector('html');
|
|
html.classList.remove('navy')
|
|
html.classList.add(theme);
|
|
var body = document.querySelector('body');
|
|
body.classList.remove('no-js')
|
|
body.classList.add('js');
|
|
</script>
|
|
|
|
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
|
|
|
<!-- Hide / unhide sidebar before it is displayed -->
|
|
<script>
|
|
var body = document.querySelector('body');
|
|
var sidebar = null;
|
|
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
|
if (document.body.clientWidth >= 1080) {
|
|
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
|
sidebar = sidebar || 'visible';
|
|
} else {
|
|
sidebar = 'hidden';
|
|
}
|
|
sidebar_toggle.checked = sidebar === 'visible';
|
|
body.classList.remove('sidebar-visible');
|
|
body.classList.add("sidebar-" + sidebar);
|
|
</script>
|
|
|
|
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
|
<div class="sidebar-scrollbox">
|
|
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../index.html">Introduction</a></li><li class="chapter-item expanded affix "><li class="part-title">Requirements & Traceability</li><li class="chapter-item expanded "><a href="../requirements.html"><strong aria-hidden="true">1.</strong> Requirements Specification</a></li><li class="chapter-item expanded "><a href="../traceability.html"><strong aria-hidden="true">2.</strong> Traceability Matrix</a></li><li class="chapter-item expanded "><a href="../traceability-ci.html"><strong aria-hidden="true">3.</strong> Traceability CI</a></li><li class="chapter-item expanded "><a href="../traces-quick-ref.html"><strong aria-hidden="true">4.</strong> Traces Quick Reference</a></li><li class="chapter-item expanded affix "><li class="part-title">Architecture</li><li class="chapter-item expanded "><a href="../architecture/index.html"><strong aria-hidden="true">5.</strong> Overview</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../architecture/01-rust-backend.html"><strong aria-hidden="true">5.1.</strong> Rust Backend</a></li><li class="chapter-item "><a href="../architecture/02-svelte-frontend.html"><strong aria-hidden="true">5.2.</strong> Svelte Frontend</a></li><li class="chapter-item "><a href="../architecture/03-data-flow.html"><strong aria-hidden="true">5.3.</strong> Data Flow</a></li><li class="chapter-item "><a href="../architecture/04-type-sync-and-threading.html"><strong aria-hidden="true">5.4.</strong> Type Sync & Threading</a></li><li class="chapter-item "><a href="../architecture/05-platform-backends.html"><strong aria-hidden="true">5.5.</strong> Platform Backends</a></li><li class="chapter-item "><a href="../architecture/06-downloads-and-offline.html"><strong aria-hidden="true">5.6.</strong> Downloads & Offline</a></li><li class="chapter-item "><a href="../architecture/07-connectivity.html"><strong aria-hidden="true">5.7.</strong> Connectivity</a></li><li class="chapter-item expanded "><a href="../architecture/08-database-design.html" class="active"><strong aria-hidden="true">5.8.</strong> Database Design</a></li><li class="chapter-item "><a href="../architecture/09-security.html"><strong aria-hidden="true">5.9.</strong> Security</a></li></ol></li><li class="chapter-item expanded "><li class="part-title">UX</li><li class="chapter-item expanded "><a href="../ux-flows.html"><strong aria-hidden="true">6.</strong> UX Flows</a></li><li class="chapter-item expanded affix "><li class="part-title">Specs — Pending Work</li><li class="chapter-item expanded "><a href="../specs/index.html"><strong aria-hidden="true">7.</strong> Specs Index</a></li><li class="chapter-item expanded "><a href="../specs/SPEC-TEMPLATE.html"><strong aria-hidden="true">8.</strong> Spec Template</a></li><li class="chapter-item expanded "><a href="../specs/SPEC-REVIEW-CHECKLIST.html"><strong aria-hidden="true">9.</strong> Spec Review Checklist</a></li><li class="chapter-item expanded "><a href="../specs/playback-backend-unification.html"><strong aria-hidden="true">10.</strong> Playback Backend Unification</a></li><li class="chapter-item expanded "><a href="../specs/linux-native-video-spike.html"><strong aria-hidden="true">11.</strong> Linux Native Video Spike</a></li><li class="chapter-item expanded "><a href="../specs/backend-owned-stream-selection.html"><strong aria-hidden="true">12.</strong> Backend-Owned Stream Selection</a></li><li class="chapter-item expanded "><a href="../specs/player-facade-enforcement.html"><strong aria-hidden="true">13.</strong> Player Facade Enforcement</a></li><li class="chapter-item expanded "><a href="../specs/windows-native-audio-backend.html"><strong aria-hidden="true">14.</strong> Windows Native Audio Backend</a></li><li class="chapter-item expanded "><a href="../specs/libmpv2-migration.html"><strong aria-hidden="true">15.</strong> libmpv2 Migration</a></li><li class="chapter-item expanded "><a href="../specs/read-through-media-cache.html"><strong aria-hidden="true">16.</strong> Read-Through Media Cache</a></li><li class="chapter-item expanded "><a href="../specs/scoped-search.html"><strong aria-hidden="true">17.</strong> Scoped Search</a></li><li class="chapter-item expanded "><a href="../specs/scoped-search-boundary.html"><strong aria-hidden="true">18.</strong> Scoped Search Boundary</a></li><li class="chapter-item expanded "><a href="../specs/scoped-search-boundary-implementation.html"><strong aria-hidden="true">19.</strong> Scoped Search Boundary — Implementation</a></li><li class="chapter-item expanded "><a href="../specs/frontend-domain-model.html"><strong aria-hidden="true">20.</strong> Frontend Domain Model</a></li><li class="chapter-item expanded "><a href="../specs/desktop-native-video.html"><strong aria-hidden="true">21.</strong> Desktop Native Video</a></li><li class="chapter-item expanded "><a href="../specs/build-provenance.html"><strong aria-hidden="true">22.</strong> Build Provenance</a></li><li class="chapter-item expanded affix "><li class="part-title">Build & Release</li><li class="chapter-item expanded "><a href="../build/build-release.html"><strong aria-hidden="true">23.</strong> Build & Release</a></li><li class="chapter-item expanded "><a href="../release-checklist.html"><strong aria-hidden="true">24.</strong> Release Checklist</a></li><li class="chapter-item expanded "><a href="../native-player-verification.html"><strong aria-hidden="true">25.</strong> Native Player Verification</a></li><li class="chapter-item expanded "><a href="../build/build-desktop-packages.html"><strong aria-hidden="true">26.</strong> Desktop Packaging</a></li><li class="chapter-item expanded "><a href="../build/build-windows.html"><strong aria-hidden="true">27.</strong> Windows Build</a></li><li class="chapter-item expanded "><a href="../defect-windows.html"><strong aria-hidden="true">28.</strong> Defect Windows</a></li><li class="chapter-item expanded "><a href="../build/docker.html"><strong aria-hidden="true">29.</strong> Docker</a></li><li class="chapter-item expanded "><a href="../build/build-builder-image.html"><strong aria-hidden="true">30.</strong> Builder Image</a></li><li class="chapter-item expanded affix "><li class="spacer"></li><li class="chapter-item expanded affix "><a href="../api-redirect.html">Rust API Reference (rustdoc)</a></li></ol>
|
|
</div>
|
|
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
|
|
<div class="sidebar-resize-indicator"></div>
|
|
</div>
|
|
</nav>
|
|
|
|
<!-- Track and set sidebar scroll position -->
|
|
<script>
|
|
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
|
|
sidebarScrollbox.addEventListener('click', function(e) {
|
|
if (e.target.tagName === 'A') {
|
|
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
|
|
}
|
|
}, { passive: true });
|
|
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
|
|
sessionStorage.removeItem('sidebar-scroll');
|
|
if (sidebarScrollTop) {
|
|
// preserve sidebar scroll position when navigating via links within sidebar
|
|
sidebarScrollbox.scrollTop = sidebarScrollTop;
|
|
} else {
|
|
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
|
|
var activeSection = document.querySelector('#sidebar .active');
|
|
if (activeSection) {
|
|
activeSection.scrollIntoView({ block: 'center' });
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div id="page-wrapper" class="page-wrapper">
|
|
|
|
<div class="page">
|
|
<div id="menu-bar-hover-placeholder"></div>
|
|
<div id="menu-bar" class="menu-bar sticky">
|
|
<div class="left-buttons">
|
|
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
|
<i class="fa fa-bars"></i>
|
|
</label>
|
|
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
|
<i class="fa fa-paint-brush"></i>
|
|
</button>
|
|
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
|
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
|
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
|
</ul>
|
|
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
|
<i class="fa fa-search"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<h1 class="menu-title">JellyTau Documentation</h1>
|
|
|
|
<div class="right-buttons">
|
|
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
|
<i id="print-button" class="fa fa-print"></i>
|
|
</a>
|
|
<a href="https://gitea.tourolle.paris/dtourolle/jellytau" title="Git repository" aria-label="Git repository">
|
|
<i id="git-repository-button" class="fa fa-github"></i>
|
|
</a>
|
|
<a href="https://gitea.tourolle.paris/dtourolle/jellytau/_edit/master/docs/../docs/architecture/08-database-design.md" title="Suggest an edit" aria-label="Suggest an edit">
|
|
<i id="git-edit-button" class="fa fa-edit"></i>
|
|
</a>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div id="search-wrapper" class="hidden">
|
|
<form id="searchbar-outer" class="searchbar-outer">
|
|
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
|
</form>
|
|
<div id="searchresults-outer" class="searchresults-outer hidden">
|
|
<div id="searchresults-header" class="searchresults-header"></div>
|
|
<ul id="searchresults">
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
|
<script>
|
|
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
|
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
|
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
|
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
|
});
|
|
</script>
|
|
|
|
<div id="content" class="content">
|
|
<main>
|
|
<h1 id="offline-database-design"><a class="header" href="#offline-database-design">Offline Database Design</a></h1>
|
|
<h2 id="entity-relationship-diagram"><a class="header" href="#entity-relationship-diagram">Entity Relationship Diagram</a></h2>
|
|
<pre><code class="language-mermaid">erDiagram
|
|
servers ||--o{ users : "has"
|
|
servers ||--o{ libraries : "has"
|
|
libraries ||--o{ items : "contains"
|
|
items ||--o{ items : "parent_of"
|
|
items ||--o{ user_data : "has"
|
|
items ||--o{ downloads : "has"
|
|
items ||--o{ media_streams : "has"
|
|
items ||--o{ thumbnails : "has"
|
|
users ||--o{ user_data : "owns"
|
|
users ||--o{ downloads : "owns"
|
|
users ||--o{ sync_queue : "owns"
|
|
|
|
servers {
|
|
int id PK
|
|
string jellyfin_id UK
|
|
string name
|
|
string url
|
|
string version
|
|
datetime last_sync
|
|
}
|
|
|
|
users {
|
|
int id PK
|
|
string jellyfin_id
|
|
int server_id FK
|
|
string name
|
|
boolean is_active
|
|
}
|
|
|
|
libraries {
|
|
int id PK
|
|
string jellyfin_id
|
|
int server_id FK
|
|
string name
|
|
string collection_type
|
|
string image_tag
|
|
}
|
|
|
|
items {
|
|
int id PK
|
|
string jellyfin_id
|
|
int server_id FK
|
|
int library_id FK
|
|
int parent_id FK
|
|
string type
|
|
string name
|
|
string sort_name
|
|
string overview
|
|
int production_year
|
|
float community_rating
|
|
string official_rating
|
|
int runtime_ticks
|
|
string primary_image_tag
|
|
string backdrop_image_tag
|
|
string album_id
|
|
string album_name
|
|
string album_artist
|
|
json artists
|
|
json genres
|
|
int index_number
|
|
int parent_index_number
|
|
string premiere_date
|
|
json metadata_json
|
|
datetime created_at
|
|
datetime updated_at
|
|
datetime last_sync
|
|
}
|
|
|
|
user_data {
|
|
int id PK
|
|
int item_id FK
|
|
int user_id FK
|
|
int position_ticks
|
|
int play_count
|
|
boolean is_favorite
|
|
boolean played
|
|
datetime last_played
|
|
datetime updated_at
|
|
datetime synced_at
|
|
}
|
|
|
|
downloads {
|
|
int id PK
|
|
int item_id FK
|
|
int user_id FK
|
|
string file_path
|
|
int file_size
|
|
string status
|
|
float progress
|
|
int priority
|
|
string error_message
|
|
datetime created_at
|
|
datetime completed_at
|
|
}
|
|
|
|
media_streams {
|
|
int id PK
|
|
int item_id FK
|
|
int stream_index
|
|
string type
|
|
string codec
|
|
string language
|
|
string display_title
|
|
boolean is_default
|
|
boolean is_forced
|
|
boolean is_external
|
|
}
|
|
|
|
sync_queue {
|
|
int id PK
|
|
int user_id FK
|
|
string operation
|
|
string entity_type
|
|
string entity_id
|
|
json payload
|
|
datetime created_at
|
|
int attempts
|
|
datetime last_attempt
|
|
string status
|
|
}
|
|
|
|
thumbnails {
|
|
int id PK
|
|
int item_id FK
|
|
string image_type
|
|
string image_tag
|
|
string file_path
|
|
int width
|
|
int height
|
|
datetime cached_at
|
|
}
|
|
</code></pre>
|
|
<h2 id="table-definitions"><a class="header" href="#table-definitions">Table Definitions</a></h2>
|
|
<h3 id="servers"><a class="header" href="#servers">servers</a></h3>
|
|
<p>Stores connected Jellyfin server information.</p>
|
|
<pre><code class="language-sql">CREATE TABLE servers (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
jellyfin_id TEXT NOT NULL UNIQUE,
|
|
name TEXT NOT NULL,
|
|
url TEXT NOT NULL,
|
|
version TEXT,
|
|
last_sync DATETIME,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
</code></pre>
|
|
<h3 id="users"><a class="header" href="#users">users</a></h3>
|
|
<p>Stores user accounts per server. Access tokens are stored separately in secure storage (see <a href="09-security.html">09-security.md</a>).</p>
|
|
<pre><code class="language-sql">CREATE TABLE users (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
jellyfin_id TEXT NOT NULL,
|
|
server_id INTEGER NOT NULL REFERENCES servers(id) ON DELETE CASCADE,
|
|
name TEXT NOT NULL,
|
|
is_active BOOLEAN DEFAULT 0,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE(jellyfin_id, server_id)
|
|
);
|
|
</code></pre>
|
|
<h3 id="libraries"><a class="header" href="#libraries">libraries</a></h3>
|
|
<p>Stores library/collection metadata.</p>
|
|
<pre><code class="language-sql">CREATE TABLE libraries (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
jellyfin_id TEXT NOT NULL,
|
|
server_id INTEGER NOT NULL REFERENCES servers(id) ON DELETE CASCADE,
|
|
name TEXT NOT NULL,
|
|
collection_type TEXT,
|
|
image_tag TEXT,
|
|
sort_order INTEGER DEFAULT 0,
|
|
last_sync DATETIME,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE(jellyfin_id, server_id)
|
|
);
|
|
|
|
CREATE INDEX idx_libraries_server ON libraries(server_id);
|
|
</code></pre>
|
|
<h3 id="items"><a class="header" href="#items">items</a></h3>
|
|
<p>Main table for all media items (movies, episodes, albums, songs, etc.).</p>
|
|
<pre><code class="language-sql">CREATE TABLE items (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
jellyfin_id TEXT NOT NULL,
|
|
server_id INTEGER NOT NULL REFERENCES servers(id) ON DELETE CASCADE,
|
|
library_id INTEGER REFERENCES libraries(id) ON DELETE SET NULL,
|
|
parent_id INTEGER REFERENCES items(id) ON DELETE CASCADE,
|
|
|
|
-- Basic metadata
|
|
type TEXT NOT NULL,
|
|
name TEXT NOT NULL,
|
|
sort_name TEXT,
|
|
overview TEXT,
|
|
|
|
-- Media info
|
|
production_year INTEGER,
|
|
community_rating REAL,
|
|
official_rating TEXT,
|
|
runtime_ticks INTEGER,
|
|
|
|
-- Images
|
|
primary_image_tag TEXT,
|
|
backdrop_image_tag TEXT,
|
|
|
|
-- Audio-specific
|
|
album_id TEXT,
|
|
album_name TEXT,
|
|
album_artist TEXT,
|
|
artists TEXT, -- JSON array
|
|
|
|
-- Series/Season-specific
|
|
index_number INTEGER,
|
|
parent_index_number INTEGER,
|
|
series_id TEXT,
|
|
series_name TEXT,
|
|
season_id TEXT,
|
|
|
|
-- Additional
|
|
genres TEXT, -- JSON array
|
|
premiere_date TEXT,
|
|
metadata_json TEXT,
|
|
|
|
-- Sync tracking
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
last_sync DATETIME,
|
|
|
|
UNIQUE(jellyfin_id, server_id)
|
|
|
|
-- Logical container (migration 027): episode → season/series, season →
|
|
-- series, track → album, else parent. See "Listing query shape".
|
|
-- container_id TEXT GENERATED ALWAYS AS (CASE item_type … END) VIRTUAL
|
|
);
|
|
|
|
-- Performance indexes
|
|
CREATE INDEX idx_items_container ON items(container_id, sort_name, name);
|
|
CREATE INDEX idx_items_server ON items(server_id);
|
|
CREATE INDEX idx_items_library ON items(library_id);
|
|
CREATE INDEX idx_items_parent ON items(parent_id);
|
|
CREATE INDEX idx_items_type ON items(type);
|
|
CREATE INDEX idx_items_album ON items(album_id);
|
|
CREATE INDEX idx_items_series ON items(series_id);
|
|
CREATE INDEX idx_items_name ON items(name COLLATE NOCASE);
|
|
|
|
-- Full-text search
|
|
CREATE VIRTUAL TABLE items_fts USING fts5(
|
|
name,
|
|
overview,
|
|
artists,
|
|
album_name,
|
|
album_artist,
|
|
content='items',
|
|
content_rowid='id'
|
|
);
|
|
|
|
-- Triggers to keep FTS in sync
|
|
CREATE TRIGGER items_ai AFTER INSERT ON items BEGIN
|
|
INSERT INTO items_fts(rowid, name, overview, artists, album_name, album_artist)
|
|
VALUES (new.id, new.name, new.overview, new.artists, new.album_name, new.album_artist);
|
|
END;
|
|
|
|
CREATE TRIGGER items_ad AFTER DELETE ON items BEGIN
|
|
INSERT INTO items_fts(items_fts, rowid, name, overview, artists, album_name, album_artist)
|
|
VALUES ('delete', old.id, old.name, old.overview, old.artists, old.album_name, old.album_artist);
|
|
END;
|
|
|
|
CREATE TRIGGER items_au AFTER UPDATE ON items BEGIN
|
|
INSERT INTO items_fts(items_fts, rowid, name, overview, artists, album_name, album_artist)
|
|
VALUES ('delete', old.id, old.name, old.overview, old.artists, old.album_name, old.album_artist);
|
|
INSERT INTO items_fts(rowid, name, overview, artists, album_name, album_artist)
|
|
VALUES (new.id, new.name, new.overview, new.artists, new.album_name, new.album_artist);
|
|
END;
|
|
</code></pre>
|
|
<h3 id="media_streams"><a class="header" href="#media_streams">media_streams</a></h3>
|
|
<p>Stores subtitle and audio track information for items.</p>
|
|
<pre><code class="language-sql">CREATE TABLE media_streams (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
stream_index INTEGER NOT NULL,
|
|
type TEXT NOT NULL,
|
|
codec TEXT,
|
|
language TEXT,
|
|
display_title TEXT,
|
|
is_default BOOLEAN DEFAULT 0,
|
|
is_forced BOOLEAN DEFAULT 0,
|
|
is_external BOOLEAN DEFAULT 0,
|
|
path TEXT,
|
|
UNIQUE(item_id, stream_index)
|
|
);
|
|
|
|
CREATE INDEX idx_media_streams_item ON media_streams(item_id);
|
|
</code></pre>
|
|
<h3 id="user_data"><a class="header" href="#user_data">user_data</a></h3>
|
|
<p>Stores per-user data for items (favorites, progress, play count).</p>
|
|
<pre><code class="language-sql">CREATE TABLE user_data (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
|
|
-- Playback state
|
|
position_ticks INTEGER DEFAULT 0,
|
|
play_count INTEGER DEFAULT 0,
|
|
played BOOLEAN DEFAULT 0,
|
|
last_played DATETIME,
|
|
|
|
-- User preferences
|
|
is_favorite BOOLEAN DEFAULT 0,
|
|
user_rating REAL,
|
|
|
|
-- Sync tracking
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
synced_at DATETIME,
|
|
needs_sync BOOLEAN DEFAULT 0,
|
|
|
|
UNIQUE(item_id, user_id)
|
|
);
|
|
|
|
CREATE INDEX idx_user_data_item ON user_data(item_id);
|
|
CREATE INDEX idx_user_data_user ON user_data(user_id);
|
|
CREATE INDEX idx_user_data_needs_sync ON user_data(needs_sync) WHERE needs_sync = 1;
|
|
CREATE INDEX idx_user_data_favorites ON user_data(user_id, is_favorite) WHERE is_favorite = 1;
|
|
CREATE INDEX idx_user_data_in_progress ON user_data(user_id, position_ticks)
|
|
WHERE position_ticks > 0 AND played = 0;
|
|
</code></pre>
|
|
<h3 id="downloads"><a class="header" href="#downloads">downloads</a></h3>
|
|
<p>Tracks downloaded media files.</p>
|
|
<pre><code class="language-sql">CREATE TABLE downloads (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
|
|
file_path TEXT,
|
|
file_size INTEGER,
|
|
file_hash TEXT,
|
|
|
|
status TEXT NOT NULL DEFAULT 'pending',
|
|
progress REAL DEFAULT 0,
|
|
bytes_downloaded INTEGER DEFAULT 0,
|
|
|
|
transcode_profile TEXT,
|
|
|
|
priority INTEGER DEFAULT 0,
|
|
error_message TEXT,
|
|
retry_count INTEGER DEFAULT 0,
|
|
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
started_at DATETIME,
|
|
completed_at DATETIME,
|
|
expires_at DATETIME,
|
|
|
|
UNIQUE(item_id, user_id)
|
|
);
|
|
|
|
CREATE INDEX idx_downloads_status ON downloads(status);
|
|
CREATE INDEX idx_downloads_user ON downloads(user_id);
|
|
CREATE INDEX idx_downloads_queue ON downloads(status, priority DESC, created_at ASC)
|
|
WHERE status IN ('pending', 'downloading');
|
|
</code></pre>
|
|
<h3 id="sync_queue"><a class="header" href="#sync_queue">sync_queue</a></h3>
|
|
<p>Stores mutations to sync back to server when online.</p>
|
|
<pre><code class="language-sql">CREATE TABLE sync_queue (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
|
|
operation TEXT NOT NULL,
|
|
entity_type TEXT NOT NULL,
|
|
entity_id TEXT NOT NULL,
|
|
payload TEXT,
|
|
|
|
status TEXT DEFAULT 'pending',
|
|
attempts INTEGER DEFAULT 0,
|
|
max_attempts INTEGER DEFAULT 5,
|
|
last_attempt DATETIME,
|
|
error_message TEXT,
|
|
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
completed_at DATETIME
|
|
);
|
|
|
|
CREATE INDEX idx_sync_queue_status ON sync_queue(status, created_at ASC)
|
|
WHERE status = 'pending';
|
|
CREATE INDEX idx_sync_queue_user ON sync_queue(user_id);
|
|
</code></pre>
|
|
<h3 id="thumbnails"><a class="header" href="#thumbnails">thumbnails</a></h3>
|
|
<p>Caches downloaded artwork.</p>
|
|
<pre><code class="language-sql">CREATE TABLE thumbnails (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
image_type TEXT NOT NULL,
|
|
image_tag TEXT,
|
|
file_path TEXT NOT NULL,
|
|
width INTEGER,
|
|
height INTEGER,
|
|
file_size INTEGER,
|
|
cached_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
last_accessed DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE(item_id, image_type, width)
|
|
);
|
|
|
|
CREATE INDEX idx_thumbnails_item ON thumbnails(item_id);
|
|
CREATE INDEX idx_thumbnails_lru ON thumbnails(last_accessed ASC);
|
|
</code></pre>
|
|
<h3 id="playlists-for-localsynced-playlists"><a class="header" href="#playlists-for-localsynced-playlists">playlists (for local/synced playlists)</a></h3>
|
|
<pre><code class="language-sql">CREATE TABLE playlists (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
jellyfin_id TEXT,
|
|
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
|
name TEXT NOT NULL,
|
|
description TEXT,
|
|
is_local_only BOOLEAN DEFAULT 0,
|
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
synced_at DATETIME,
|
|
needs_sync BOOLEAN DEFAULT 0
|
|
);
|
|
|
|
CREATE TABLE playlist_items (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
playlist_id INTEGER NOT NULL REFERENCES playlists(id) ON DELETE CASCADE,
|
|
item_id INTEGER NOT NULL REFERENCES items(id) ON DELETE CASCADE,
|
|
sort_order INTEGER NOT NULL,
|
|
added_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
UNIQUE(playlist_id, item_id)
|
|
);
|
|
|
|
CREATE INDEX idx_playlist_items_playlist ON playlist_items(playlist_id, sort_order);
|
|
</code></pre>
|
|
<h2 id="key-queries"><a class="header" href="#key-queries">Key Queries</a></h2>
|
|
<h3 id="get-items-for-offline-library-browsing"><a class="header" href="#get-items-for-offline-library-browsing">Get items for offline library browsing</a></h3>
|
|
<pre><code class="language-sql">-- Get all albums in a music library
|
|
SELECT * FROM items
|
|
WHERE library_id = ? AND type = 'MusicAlbum'
|
|
ORDER BY sort_name;
|
|
|
|
-- Get tracks for an album
|
|
SELECT * FROM items
|
|
WHERE album_id = ? AND type = 'Audio'
|
|
ORDER BY parent_index_number, index_number;
|
|
</code></pre>
|
|
<h3 id="resume--continue-watching"><a class="header" href="#resume--continue-watching">Resume / Continue Watching</a></h3>
|
|
<pre><code class="language-sql">SELECT i.*, ud.position_ticks, ud.last_played
|
|
FROM items i
|
|
JOIN user_data ud ON ud.item_id = i.id
|
|
WHERE ud.user_id = ?
|
|
AND ud.position_ticks > 0
|
|
AND ud.played = 0
|
|
ORDER BY ud.last_played DESC
|
|
LIMIT 20;
|
|
</code></pre>
|
|
<h3 id="offline-search"><a class="header" href="#offline-search">Offline search</a></h3>
|
|
<pre><code class="language-sql">SELECT i.* FROM items i
|
|
JOIN items_fts fts ON fts.rowid = i.id
|
|
WHERE items_fts MATCH ?
|
|
ORDER BY rank;
|
|
</code></pre>
|
|
<h3 id="download-queue-management"><a class="header" href="#download-queue-management">Download queue management</a></h3>
|
|
<pre><code class="language-sql">-- Get next item to download
|
|
SELECT d.*, i.name, i.type
|
|
FROM downloads d
|
|
JOIN items i ON i.id = d.item_id
|
|
WHERE d.status = 'pending'
|
|
ORDER BY d.priority DESC, d.created_at ASC
|
|
LIMIT 1;
|
|
|
|
-- Get download progress for UI
|
|
SELECT
|
|
d.status,
|
|
COUNT(*) as count,
|
|
SUM(d.file_size) as total_size,
|
|
SUM(d.bytes_downloaded) as downloaded
|
|
FROM downloads d
|
|
WHERE d.user_id = ?
|
|
GROUP BY d.status;
|
|
</code></pre>
|
|
<h3 id="sync-queue-processing"><a class="header" href="#sync-queue-processing">Sync queue processing</a></h3>
|
|
<pre><code class="language-sql">-- Get pending sync operations (oldest first)
|
|
SELECT * FROM sync_queue
|
|
WHERE status = 'pending'
|
|
AND attempts < max_attempts
|
|
ORDER BY created_at ASC
|
|
LIMIT 10;
|
|
|
|
-- Mark operation complete
|
|
UPDATE sync_queue
|
|
SET status = 'completed', completed_at = CURRENT_TIMESTAMP
|
|
WHERE id = ?;
|
|
</code></pre>
|
|
<h2 id="data-flow"><a class="header" href="#data-flow">Data Flow</a></h2>
|
|
<h3 id="online-mode"><a class="header" href="#online-mode">Online Mode</a></h3>
|
|
<pre><code class="language-mermaid">flowchart TB
|
|
subgraph OnlineMode["Online Mode"]
|
|
JellyfinServer["Jellyfin Server"]
|
|
OnlineRepo["OnlineRepo"]
|
|
SQLite["SQLite"]
|
|
HybridRepo["HybridRepository"]
|
|
UI["UI / Stores"]
|
|
|
|
JellyfinServer -->|"API Response"| OnlineRepo
|
|
OnlineRepo -->|"Cache"| SQLite
|
|
SQLite -->|"Sync"| JellyfinServer
|
|
OnlineRepo -->|"Response"| HybridRepo
|
|
SQLite -->|"Fallback"| HybridRepo
|
|
HybridRepo --> UI
|
|
end
|
|
</code></pre>
|
|
<h3 id="offline-mode"><a class="header" href="#offline-mode">Offline Mode</a></h3>
|
|
<pre><code class="language-mermaid">flowchart TB
|
|
subgraph OfflineMode["Offline Mode"]
|
|
OfflineRepo["OfflineRepo"]
|
|
SQLite2["SQLite"]
|
|
SyncQueue["sync_queue<br/>(Queued for later)"]
|
|
HybridRepo2["HybridRepository"]
|
|
UI2["UI / Stores"]
|
|
|
|
OfflineRepo <-->|"Query"| SQLite2
|
|
SQLite2 -->|"Mutations"| SyncQueue
|
|
OfflineRepo --> HybridRepo2
|
|
HybridRepo2 --> UI2
|
|
end
|
|
</code></pre>
|
|
<h3 id="sync-on-reconnect"><a class="header" href="#sync-on-reconnect">Sync on Reconnect</a></h3>
|
|
<pre><code class="language-mermaid">flowchart LR
|
|
NetworkRestored["Network restored"]
|
|
SyncService["SyncService"]
|
|
SyncQueue2["sync_queue"]
|
|
JellyfinAPI["Jellyfin API"]
|
|
MarkSynced["Mark synced"]
|
|
|
|
NetworkRestored --> SyncService
|
|
SyncService -->|"Read"| SyncQueue2
|
|
SyncQueue2 -->|"Send"| JellyfinAPI
|
|
JellyfinAPI -->|"Success"| MarkSynced
|
|
MarkSynced --> SyncService
|
|
</code></pre>
|
|
<h2 id="storage-estimates"><a class="header" href="#storage-estimates">Storage Estimates</a></h2>
|
|
<div class="table-wrapper"><table><thead><tr><th>Content Type</th><th>Metadata Size</th><th>Thumbnail Size</th><th>Media Size</th></tr></thead><tbody>
|
|
<tr><td>Song</td><td>~2 KB</td><td>~50 KB (300px)</td><td>5-15 MB</td></tr>
|
|
<tr><td>Album (12 tracks)</td><td>~30 KB</td><td>~100 KB</td><td>60-180 MB</td></tr>
|
|
<tr><td>Movie</td><td>~5 KB</td><td>~200 KB</td><td>1-8 GB</td></tr>
|
|
<tr><td>Episode</td><td>~3 KB</td><td>~100 KB</td><td>300 MB - 2 GB</td></tr>
|
|
<tr><td>Full music library (5000 songs)</td><td>~10 MB</td><td>~250 MB</td><td>25-75 GB</td></tr>
|
|
</tbody></table>
|
|
</div>
|
|
<h2 id="connection-ownership"><a class="header" href="#connection-ownership">Connection ownership</a></h2>
|
|
<p><code>storage::Database</code> is opened once at startup and owns the database for the
|
|
life of the app; nothing else opens the file. Everything goes through
|
|
<code>Database::service()</code>, which returns a clone of one <code>RusqliteService</code>
|
|
(<code>storage/db_service.rs</code>) — callers never hold a <code>Connection</code>.</p>
|
|
<pre><code> ┌─────────────────────────────┐
|
|
execute / insert / │ writer thread ("db-writer") │ one read-write connection,
|
|
transaction / ────►│ jobs run in arrival order │ foreign_keys = ON
|
|
execute_detached └─────────────────────────────┘
|
|
┌─────────────────────────────┐
|
|
query_one / │ reader pool (3 connections) │ query_only = ON; WAL gives
|
|
query_optional / ─►│ via spawn_blocking │ each the last committed
|
|
query_many └─────────────────────────────┘ snapshot
|
|
</code></pre>
|
|
<p>Pragmas: <code>journal_mode = WAL</code>, <code>synchronous = NORMAL</code>, <code>busy_timeout = 5 s</code> on
|
|
every connection. <code>PRAGMA optimize</code> runs once at open, after migrations, so the planner has
|
|
statistics (see "Listing query shape").</p>
|
|
<p><strong>Why.</strong> It used to be one connection behind one <code>std::sync::Mutex</code>. WAL was on,
|
|
but with a single connection its one benefit — readers running beside a writer —
|
|
never applied: every read queued behind every write. A series page's background
|
|
refresh cached hundreds of episodes one autocommit (and one fsync) at a time,
|
|
and library pages, thumbnail lookups and settings reads all waited behind the
|
|
pile; the same page measured 1.7 s or 3.95 s depending on what was queued.</p>
|
|
<p><strong>Invariants a change must keep:</strong></p>
|
|
<ul>
|
|
<li><strong>Writes go to the writer, reads to the pool.</strong> A reader is <code>query_only</code>, so a
|
|
write sent through <code>query_*</code> fails loudly rather than racing the writer. A
|
|
read that must see a write <em>in the same unit of work</em> belongs inside the
|
|
<code>transaction</code> closure, which runs on the writer.</li>
|
|
<li><strong>Connection-wide state is set inside one writer job.</strong> <code>PRAGMA foreign_keys</code>
|
|
is per connection and ignored inside a transaction. <code>save_to_cache</code> used to
|
|
switch it off with one <code>execute</code> and back on with another, so it stayed off
|
|
for every other write that ran across the save's awaits (they did — nearly
|
|
all of 1,600 FK-violating writes got through in the regression test).
|
|
<code>transaction_without_foreign_keys</code> flips it around <code>BEGIN</code>/<code>COMMIT</code> in a single
|
|
job. Any future pragma toggle must work the same way.</li>
|
|
<li><strong>An insert's rowid comes from the same job.</strong> <code>insert()</code> returns it; there is
|
|
deliberately no standalone <code>last_insert_rowid()</code>, which returned whichever row
|
|
the last <em>anyone</em> inserted.</li>
|
|
<li><strong>Batch writes into one transaction.</strong> A commit is a queue slot on the
|
|
writer; a page of items is one <code>transaction</code>, not one <code>execute</code> per row.</li>
|
|
<li><strong>Best-effort bookkeeping does not wait.</strong> <code>execute_detached</code> queues a write
|
|
(the thumbnail LRU access time) in order with the rest and returns
|
|
immediately; failures are only logged.</li>
|
|
<li><strong>The writer survives a panicking job.</strong> The job's caller gets an error; the
|
|
loop rolls back any transaction the job left open and restores
|
|
<code>foreign_keys = ON</code>, then carries on.</li>
|
|
</ul>
|
|
<p><strong><code>synchronous = NORMAL</code></strong> is corruption-safe in WAL mode and survives an app
|
|
crash; only a power cut can lose the last few commits. Everything stored is
|
|
either re-fetchable from the server or (the sync queue, local positions)
|
|
recoverable at that granularity.</p>
|
|
<p><strong>In-memory databases</strong> (tests) cannot be shared between connections, so
|
|
<code>RusqliteService::new</code> has no pool and routes reads through the writer — the
|
|
old serialized behaviour.</p>
|
|
<p><strong>Not done, and why:</strong> grouping consecutive small <code>execute</code> jobs into one
|
|
commit on the writer. With <code>synchronous = NORMAL</code> a commit no longer fsyncs, so
|
|
the gain is small, and it would change a failed statement's error semantics
|
|
for the jobs grouped with it.</p>
|
|
<h3 id="listing-query-shape"><a class="header" href="#listing-query-shape">Listing query shape</a></h3>
|
|
<p><code>OfflineRepository::get_items</code> (<code>items_listing_sql</code>) is the hot read: every
|
|
library, series, season and album page goes through it, and it must fit the
|
|
100 ms cache fast path on a phone. Every other cached read follows the same
|
|
rules.</p>
|
|
<ul>
|
|
<li><strong>Children are matched on <code>items.container_id</code></strong> (migration 027), a VIRTUAL
|
|
generated column holding the item's <em>logical</em> container: an episode's season
|
|
(else series, else parent), a season's series, a track's album, otherwise the
|
|
parent. Jellyfin's <code>ParentId</code> is the storage parent, not the logical one — in
|
|
a series without season folders an episode's <code>ParentId</code> is the series while
|
|
its <code>SeasonId</code> names a virtual season — so listings used to match on four
|
|
columns at once. That <code>OR</code> defeated the planner into walking the whole table,
|
|
and it was wrong: every episode carries its series id, so a series listed all
|
|
its episodes beside its seasons. Being generated, the column covers every
|
|
write path (cache, downloads, catalog crawl) without any of them knowing, and
|
|
cannot drift from the columns it is computed from.</li>
|
|
<li><strong><code>idx_items_container (container_id, sort_name, name)</code></strong> serves a listing as
|
|
one index range already in display order — no sort step. <code>sort_name</code> is
|
|
usually NULL in the cache (the cache never writes it), hence <code>name</code> in the
|
|
index too.</li>
|
|
<li><strong>Containers exist even when never browsed.</strong> A series lists its seasons, so
|
|
an episode whose season row was never cached (it arrived through Next Up or
|
|
Latest) would be unreachable from its series offline. <code>save_to_cache</code> — and
|
|
migration 027 for rows already on disk — inserts placeholders named from the
|
|
child's own fields (<code>season_name</code>, <code>series_name</code>, <code>album_name</code>) with
|
|
<code>synced_at</code> NULL, so they show only when a download makes them available; the
|
|
server's real row replaces them wholesale on the next browse.</li>
|
|
<li><strong>Availability is a per-row <code>EXISTS</code></strong> (<code>downloaded_sql</code> / <code>available_sql</code>):
|
|
cached for browsing (only with the catalog-browse flag), downloaded, or a
|
|
container with a downloaded <em>descendant</em> — which is why that one check still
|
|
looks at all four link columns (a series is available through an episode two
|
|
levels down). It used to be a CTE that built the id of every available item
|
|
in the database before filtering, paying for the whole table on every call.</li>
|
|
<li><strong>The library clause is added only for a library parent</strong> (<code>is_library</code>),
|
|
never <code>OR</code>ed into an ordinary listing, where it forces a full scan.</li>
|
|
<li><strong><code>+i.server_id</code></strong> keeps the planner off the server index, which every row
|
|
shares. <code>PRAGMA optimize</code> at open (<code>analysis_limit = 400</code>) gives the planner
|
|
statistics, but even with them it chose that index for the old <code>OR</code>; the <code>+</code>
|
|
is the guarantee.</li>
|
|
<li><strong>User data is fetched in batches</strong> (<code>with_user_data</code>, one <code>IN (…)</code> query per
|
|
500 rows), not once per row.</li>
|
|
</ul>
|
|
<p>Measured on a ~110k-item benchmark catalogue (desktop): a series listing went
|
|
from ~80 ms to under 1 ms; migration 027 upgrades an existing database of that
|
|
size in ~0.1 s. <code>listing_a_non_library_parent_uses_the_container_index</code> and
|
|
migration 027's tests assert the plans; <code>storage::tests::write_bench_database</code>
|
|
(ignored; set <code>JELLYTAU_BENCH_DB</code>) writes the benchmark catalogue for the
|
|
<code>sqlite3</code> CLI.</p>
|
|
<h2 id="rust-module-structure"><a class="header" href="#rust-module-structure">Rust Module Structure</a></h2>
|
|
<pre><code>src-tauri/src/storage/
|
|
├── mod.rs # Module exports, Database struct
|
|
├── schema.rs # Table definitions, migrations
|
|
├── models.rs # Rust structs matching tables
|
|
├── queries/
|
|
│ ├── mod.rs
|
|
│ ├── items.rs # Item CRUD operations
|
|
│ ├── user_data.rs # User data operations
|
|
│ ├── downloads.rs # Download queue operations
|
|
│ └── sync.rs # Sync queue operations
|
|
└── sync/
|
|
├── mod.rs # SyncService
|
|
├── manager.rs # Background sync manager
|
|
└── operations.rs # Individual sync operation handlers
|
|
</code></pre>
|
|
|
|
</main>
|
|
|
|
<nav class="nav-wrapper" aria-label="Page navigation">
|
|
<!-- Mobile navigation buttons -->
|
|
<a rel="prev" href="../architecture/07-connectivity.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
<a rel="next prefetch" href="../architecture/09-security.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
<div style="clear: both"></div>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
|
<a rel="prev" href="../architecture/07-connectivity.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
<a rel="next prefetch" href="../architecture/09-security.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
window.playground_copyable = true;
|
|
</script>
|
|
|
|
|
|
<script src="../elasticlunr.min.js"></script>
|
|
<script src="../mark.min.js"></script>
|
|
<script src="../searcher.js"></script>
|
|
|
|
<script src="../clipboard.min.js"></script>
|
|
<script src="../highlight.js"></script>
|
|
<script src="../book.js"></script>
|
|
|
|
<!-- Custom JS scripts -->
|
|
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|