This commit is contained in:
seb
2026-10-25 22:38:04 +01:00
parent 5fd7f3228c
commit 358e3009b2
17 changed files with 255 additions and 189 deletions

View File

@@ -191,7 +191,7 @@ SELECT
a.id AS articleId,
p.id AS picId,
p.hash,
p.fullbinary AS buffer
NULL AS buffer
FROM categoryarticle ca
INNER JOIN article a ON a.id = ca.article_id
OUTER APPLY (

View File

@@ -1,14 +1,12 @@
export const CREATE = `
INSERT INTO pic (
w, h, size, hash, thumbw, thumbh, thumbhash,
smallthumbw, smallthumbh, smallthumbbinary,
source, fullbinary, thumbbinary
smallthumbw, smallthumbh, smallthumbbinary, source
)
OUTPUT INSERTED.id
VALUES (
@w, @h, @size, @hash, @thumbw, @thumbh, @thumbhash,
@smallthumbw, @smallthumbh, @smallthumbbinary,
@source, @fullbinary, @thumbbinary
@smallthumbw, @smallthumbh, @smallthumbbinary, @source
)
`;
@@ -60,13 +58,13 @@ WHERE categoryId IS NOT NULL
`;
export const GET_FULL_BY_HASH = `
SELECT w, h, size, fullbinary AS buffer
SELECT w, h, size, hash
FROM pic
WHERE hash = @hash
`;
export const GET_THUMB_BY_HASH = `
SELECT thumbw AS w, thumbh AS h, thumbbinary AS buffer
SELECT thumbw AS w, thumbh AS h, hash
FROM pic
WHERE hash = @hash
`;