M shared/storage/sqlite/query.sql →
shared/storage/sqlite/query.sql INSERT INTO url (path) VALUES (?);
-- name: InsertFile :execlastid
-INSERT INTO file (url_id, content_type, last_modified, etag, style_hash, title, headers)
+INSERT INTO file (
+ url_id, content_type, last_modified, etag, style_hash, title, headers
+)
VALUES (
- @url_id,
- @content_type,
- @last_modified,
- @etag,
- @style_hash,
- @title,
- @headers
+ @url_id,
+ @content_type,
+ @last_modified,
+ @etag,
+ @style_hash,
+ @title,
+ @headers
);
-- name: InsertContent :exec
-- name: GetFile :many
SELECT
- sqlc.embed(file),
- sqlc.embed(content)
+ sqlc.embed(file),
+ sqlc.embed(content)
FROM url
INNER JOIN file
- USING (url_id)
+ USING (url_id)
INNER JOIN content
- USING (file_id)
+ USING (file_id)
WHERE
- url.path = ?;
+ url.path = ?;
-- name: CheckPath :one
SELECT
- EXISTS(
- SELECT 1
- FROM url
- WHERE path = ?
- ) AS differs;
+ EXISTS(
+ SELECT 1
+ FROM url
+ WHERE path = ?
+ ) AS differs;