mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
* super sketchy big merge with main * gitignore * gitignore * Delete cli/bin/air * Delete cli/bin directory * Delete cli/cline-host * Fix missing package.json in cli Copy the package JSON into the dist-standalone dir during compilation. Remove workaround for missing package.json * Update scripts/build-cli.sh Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Remove reference to watchservice, it has been removed * Update scripts/build-go-proto.mjs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix timestamp to string conversion * diff.go ellipsis fix * COMMON_TYPES --------- Co-authored-by: Sarah Fortune <sarah.fortune@gmail.com> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
55 lines
1.4 KiB
Go
55 lines
1.4 KiB
Go
package common
|
|
|
|
// Database query constants for the SQLite locks database
|
|
const (
|
|
|
|
// SelectInstanceLocksSQL selects all instance locks ordered by creation time
|
|
SelectInstanceLocksSQL = `
|
|
SELECT id, held_by, lock_type, lock_target, locked_at
|
|
FROM locks
|
|
WHERE lock_type = 'instance'
|
|
ORDER BY locked_at ASC
|
|
`
|
|
|
|
SelectInstanceLockByHolderSQL = `
|
|
SELECT held_by, lock_target, locked_at
|
|
FROM locks
|
|
WHERE held_by = ? AND lock_type = 'instance'
|
|
`
|
|
SelectInstanceLockHoldersAscSQL = `
|
|
SELECT held_by, lock_target, locked_at
|
|
FROM locks
|
|
WHERE lock_type = 'instance'
|
|
ORDER BY locked_at ASC
|
|
`
|
|
|
|
// DeleteInstanceLockSQL deletes an instance lock by address
|
|
DeleteInstanceLockSQL = `
|
|
DELETE FROM locks
|
|
WHERE held_by = ? AND lock_type = 'instance'
|
|
`
|
|
|
|
InsertFileLockSQL = `
|
|
INSERT INTO locks (held_by, lock_type, lock_target, locked_at)
|
|
VALUES (?, 'file', ?, ?)
|
|
`
|
|
|
|
// DeleteFileLockSQL deletes a file lock by holder and target
|
|
DeleteFileLockSQL = `
|
|
DELETE FROM locks
|
|
WHERE held_by = ? AND lock_type = 'file' AND lock_target = ?
|
|
`
|
|
|
|
// CountInstanceLockSQL counts instance locks for a given address
|
|
CountInstanceLockSQL = `
|
|
SELECT COUNT(*) FROM locks
|
|
WHERE held_by = ? AND lock_type = 'instance'
|
|
`
|
|
|
|
// InsertInstanceLockSQL inserts or replaces an instance lock
|
|
InsertInstanceLockSQL = `
|
|
INSERT OR REPLACE INTO locks (held_by, lock_type, lock_target, locked_at)
|
|
VALUES (?, 'instance', ?, ?)
|
|
`
|
|
)
|