Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
-- name: ListRawProducts :many
|
||||
SELECT * FROM raw_products
|
||||
WHERE company_id = $1
|
||||
ORDER BY created_at DESC
|
||||
LIMIT $2 OFFSET $3;
|
||||
|
||||
-- name: CountRawProducts :one
|
||||
SELECT count(*)::bigint FROM raw_products WHERE company_id = $1;
|
||||
|
||||
-- name: GetRawProduct :one
|
||||
SELECT * FROM raw_products
|
||||
WHERE id = $1 AND company_id = $2
|
||||
LIMIT 1;
|
||||
|
||||
-- name: UpdateRawProductStatus :one
|
||||
UPDATE raw_products
|
||||
SET processing_status = $3, is_processed = $4, updated_at = now()
|
||||
WHERE id = $1 AND company_id = $2
|
||||
RETURNING *;
|
||||
|
||||
-- name: ListProcessedProducts :many
|
||||
SELECT * FROM processed_products
|
||||
WHERE company_id = $1
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT $2 OFFSET $3;
|
||||
|
||||
-- name: GetProcessedProduct :one
|
||||
SELECT * FROM processed_products
|
||||
WHERE id = $1 AND company_id = $2
|
||||
LIMIT 1;
|
||||
|
||||
-- name: UpdateProcessedProduct :one
|
||||
UPDATE processed_products
|
||||
SET name = COALESCE($3, name),
|
||||
description = COALESCE($4, description),
|
||||
processed_name = COALESCE($5, processed_name),
|
||||
processed_description = COALESCE($6, processed_description),
|
||||
category = COALESCE($7, category),
|
||||
status = COALESCE($8, status),
|
||||
updated_at = now()
|
||||
WHERE id = $1 AND company_id = $2
|
||||
RETURNING *;
|
||||
|
||||
-- name: CreateProcessedProduct :one
|
||||
INSERT INTO processed_products (
|
||||
company_id, user_id, raw_product_id, product_id, name, description, status, attributes
|
||||
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||
RETURNING *;
|
||||
Reference in New Issue
Block a user