feat(platform): add the notification inbox and deterministic match search

This commit is contained in:
shira committed 2026-10-09 13:14:46 +03:00
1 parent 5edff21d2d
commit 0b11021b16
169 files changed
+17083 -443

No files matched your search

+14
View File
@@ -2,6 +2,20 @@
-- finally usage rows. The organization lock serializes quota decisions for
-- the tenant and makes the subsequent count and insert atomic.
-- Takes the organization lock ahead of every share lock of a reader that will
-- reserve usage later. FOR NO KEY UPDATE conflicts with itself and with FOR
-- SHARE, so readers of one organization queue up instead of deadlocking on a
-- share lock that each then tries to raise, but it does not conflict with the
-- FOR KEY SHARE that a foreign key takes, such as the hidden-organization
-- insert of a candidate, which holds the candidate's row and then needs this
-- one. The reservation itself still takes FOR UPDATE inside the same
-- transaction.
-- name: LockCompanyQuotaOrganizationFirst :one
SELECT id
FROM organizations
WHERE id = sqlc.arg(organization_id)
FOR NO KEY UPDATE;
-- name: LockCompanyQuotaOrganization :one
SELECT
id,