implausible/app/src/main/sqldelight/no/naiv/implausibly/StoredSite.sq
Ole-Morten Duesund aa66172d58 feat: implement Phase 1 MVP of Implausibly
Working Android dashboard app for self-hosted Plausible Analytics CE.
Connects to Plausible API v2 (POST /api/v2/query), displays top stats,
visitor chart, top sources, and top pages with date range selection.

Architecture: Kotlin + Jetpack Compose + Material 3 + Hilt + Ktor +
SQLDelight + EncryptedSharedPreferences. Single :app module, four-layer
unidirectional data flow (UI → ViewModel → Repository → Data).

Includes: instance management, site list, caching with TTL per date
range, encrypted API key storage, custom Canvas visitor chart,
pull-to-refresh, and unit tests for API, cache, repository, and
domain model layers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:46:08 +01:00

19 lines
459 B
Text

-- SPDX-License-Identifier: GPL-3.0-only
CREATE TABLE stored_sites (
site_id TEXT NOT NULL,
instance_id TEXT NOT NULL,
PRIMARY KEY (site_id, instance_id)
);
selectByInstance:
SELECT * FROM stored_sites WHERE instance_id = ? ORDER BY site_id ASC;
insert:
INSERT OR IGNORE INTO stored_sites VALUES (?, ?);
delete:
DELETE FROM stored_sites WHERE site_id = ? AND instance_id = ?;
deleteByInstance:
DELETE FROM stored_sites WHERE instance_id = ?;