Compare commits

..
1 Commits
Author SHA1 Message Date
sneak 03b11e9703 Declare only the tables and columns pixa writes and reads (closes #310)
check / check (push) Canceled after 0s
Removes output_content and request_cache, which nothing writes, and every
column that was written but never read: the host, path, query, content_type
and fetched_at of source_content, the content_type and created_at of
variant_content, and the status_code, error_message and fetched_at of
negative_cache.

StoreSource no longer takes the fetch result and LookupSource returns only
the source key. StoreVariant no longer takes a content type and
StoreNegative no longer takes a status code or message, so
extractStatusCode and the status constants, which only fed status_code,
are gone. Reconciliation adopts a variant file without opening it, as its
row no longer records a content type. Tests that set or checked a removed
column follow.

Model: opus-5-5
2026-10-21 16:32:49 +00:00
+8 -7
View File
@@ -297,17 +297,18 @@ func (c *Cache) LookupSource(
key := req.Source.Key()
var rowExists bool
var foundKey string
err := c.db.QueryRowContext(ctx, `
SELECT EXISTS(SELECT 1 FROM source_content WHERE source_key = ?)
`, string(key)).Scan(&rowExists)
if err != nil {
return "", fmt.Errorf("failed to lookup source: %w", err)
SELECT source_key FROM source_content WHERE source_key = ?
`, string(key)).Scan(&foundKey)
if errors.Is(err, sql.ErrNoRows) {
return "", nil
}
if !rowExists {
return "", nil
if err != nil {
return "", fmt.Errorf("failed to lookup source: %w", err)
}
// Verify the content file exists