sqlite
This commit is contained in:
@@ -44,3 +44,14 @@ OUTPUT INSERTED.id, INSERTED.[type], INSERTED.prefix, INSERTED.padding, INSERTED
|
||||
WHERE id = @id
|
||||
AND company_id = @companyId
|
||||
`;
|
||||
|
||||
export const GET_FOR_UPDATE = `
|
||||
SELECT id, [type], prefix, padding, [next] AS [next]
|
||||
FROM numbers WITH (UPDLOCK, ROWLOCK)
|
||||
WHERE company_id = @companyId AND [type] = @type;
|
||||
`;
|
||||
|
||||
export const INCREMENT = `
|
||||
UPDATE numbers SET [next] = [next] + 1 WHERE id = @id;
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user