sidx/src/q/latest-download.sql
SomeoneSerge 56a0b346cd Ingestable: use ingest_path for local paths
This way we don't error-out when a path is a directory. That said, we're
still only including the root in sidx.db (e.g. manifests/ but not
manifests/*.json). We should change that next.

Also renamed "blob_id" to "blake3_id" because datasette has a special
branch for ${column}_id referencing a table that contains ${column}
2025-04-20 00:13:35 +00:00

16 lines
232 B
SQL

SELECT
s.id AS sample_id,
b.blake3,
s.epoch
FROM
sidx_uri_sample AS s,
sidx_uri AS u,
sidx_blake3 AS b
ON
s.uri_id = u.id
AND s.blake3_id = b.id
WHERE
u.uri = ?
ORDER BY
s.epoch DESC
LIMIT 1;