Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
49c7398
docs(adr): propose SQLite read layer for canonical pricing database
claude Jun 27, 2026
cc2809b
docs(adr): link ADR 0001 to migration tracking issue #60
claude Jun 27, 2026
e5078d2
docs: move architecture decision records to wiki/decisions
claude Jun 27, 2026
6102ff6
feat(sync): add build-db step — SQLite prices.db from canonical JSON …
claude Jun 27, 2026
31f60e9
fix(docs): use absolute URL for ADR link to satisfy VitePress dead-li…
claude Jun 27, 2026
dfe3fcc
feat(dashboard): add SQLite read path with airtight JSON fallback (Ph…
claude Jun 27, 2026
7bcd008
ci: publish prices.db to rolling database-latest GitHub Release
claude Jun 27, 2026
6f17d8b
ci: only commit refreshed data on scheduled sync runs
claude Jun 27, 2026
713e3c3
feat(python-sdk): add optional SQLite read backend (Phase 2)
claude Jun 27, 2026
ad5d67a
style: satisfy pre-commit (ruff format + end-of-file newline)
claude Jun 27, 2026
75b129a
feat: publish slim + full SQLite databases (SDK vs web platform)
claude Jun 27, 2026
cb69bc4
feat(typescript): add optional SQLite read backend (Phase 2)
claude Jun 27, 2026
fd8b435
test(typescript): build SQLite fixture at runtime instead of committi…
claude Jun 27, 2026
19fa0c1
build(typescript): update pnpm lockfile for better-sqlite3 + allow it…
claude Jun 27, 2026
3688b33
build(typescript): allow better-sqlite3 build via pnpm-workspace.yaml
claude Jun 27, 2026
b832174
docs(adr): add ADR 0002 — data persistence and JSON retention (Phase 4)
claude Jun 27, 2026
d9202b5
feat(phase3): emit compact price-history.json, dashboard fetches sing…
claude Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/database-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish Database Release

# Builds the derived SQLite databases from the committed canonical JSON and
# publishes them to the rolling `database-latest` GitHub Release, giving
# consumers stable download URLs:
# https://github.com/Atena-IT/tokenpricing/releases/download/database-latest/prices.db
# https://github.com/Atena-IT/tokenpricing/releases/download/database-latest/prices-current.db
#
# Two assets are published:
# prices.db — full database including price_history (dashboard / history charts)
# prices-current.db — slim database without price_history (SDK default, smaller download)
#
# Triggers:
# - workflow_dispatch: manual, on-demand publish
# - push of a `database-release-*` tag: lets the release be (re)published from
# any ref, including before this workflow lands on the default branch
on:
workflow_dispatch:
push:
tags:
- "database-release-*"

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
version: latest
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
working-directory: services/sync
run: uv sync
- name: Build prices.db from committed canonical JSON
working-directory: services/sync
run: uv run tokenpricing-sync build-db
- name: Publish databases to the rolling database-latest release
uses: softprops/action-gh-release@v2
with:
tag_name: database-latest
name: Canonical pricing database (latest)
body: |
Auto-published derived SQLite builds of the canonical pricing database,
schema v1 (`PRAGMA user_version = 1`).

| Asset | Contents | Primary consumer |
|---|---|---|
| `prices.db` | Full database with `price_history` | Dashboard, history charts |
| `prices-current.db` | Slim database without `price_history` | Python SDK (default), other SDK consumers |

This is a **rolling** release: both assets are replaced on every
database sync, so the download URLs are stable. These are data
artifacts, not software releases.
files: |
database/current/prices.db
database/current/prices-current.db
make_latest: false
prerelease: false
37 changes: 37 additions & 0 deletions .github/workflows/database-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ jobs:
if [ "${#history_files[@]}" -gt 42 ]; then
printf '%s\0' "${history_files[@]:42}" | xargs -0 rm -f --
fi
- name: Build prices.db
working-directory: services/sync
run: uv run tokenpricing-sync build-db
- name: Commit refreshed data
# Only scheduled runs persist refreshed data to git. Manual dispatches
# refresh the release/artifact for testing without mutating the branch.
if: github.event_name == 'schedule'
run: |
if git diff --quiet; then
echo "No database changes"
Expand All @@ -41,3 +47,34 @@ jobs:
git add database/current database/history database/changelog
git commit -m "chore: refresh canonical pricing database"
git push
- name: Upload databases as workflow artifacts
uses: actions/upload-artifact@v4
with:
name: prices-db
path: |
database/current/prices.db
database/current/prices-current.db
if-no-files-found: error
retention-days: 7
- name: Publish databases to the rolling database-latest release
uses: softprops/action-gh-release@v2
with:
tag_name: database-latest
name: Canonical pricing database (latest)
body: |
Auto-published derived SQLite builds of the canonical pricing database,
schema v1 (`PRAGMA user_version = 1`).

| Asset | Contents | Primary consumer |
|---|---|---|
| `prices.db` | Full database with `price_history` | Dashboard, history charts |
| `prices-current.db` | Slim database without `price_history` | Python SDK (default), other SDK consumers |

This is a **rolling** release: both assets are replaced on every
database sync, so the download URLs are stable. These are data
artifacts, not software releases.
files: |
database/current/prices.db
database/current/prices-current.db
make_latest: false
prerelease: false
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ coverage.xml
cython_debug
db.sqlite3
db.sqlite3-journal

# Derived SQLite databases (built by CI, not committed to git)
database/current/prices.db
database/current/prices.db-wal
database/current/prices.db-shm
database/current/prices-current.db
database/current/prices-current.db-wal
database/current/prices-current.db-shm
*.db-wal
*.db-shm
develop-eggs
dist
dmypy.json
Expand Down
Loading
Loading