Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions vendor/wheels/databaseAdapters/CockroachDB/CockroachDBModel.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ component extends="wheels.databaseAdapters.PostgreSQL.PostgreSQLModel" output=fa
}

/**
* CockroachDB intentionally omits the PostgreSQL advisory-lock primitives
* (`pg_advisory_lock` / `pg_advisory_unlock`) — it surfaces them as no-op
* stubs that error rather than honoring the contract. Override the
* PostgreSQL adapter's `true` and report unsupported so `withAdvisoryLock`
* callers (and the capability-aware lockingSpec `beforeEach`) skip
* standalone-lock paths instead of erroring.
* CockroachDB lacks a pg_advisory_lock equivalent — its
* $acquireAdvisoryLock and $releaseAdvisoryLock both throw
* Wheels.AdvisoryLockNotSupported. Overriding the parent PostgreSQL
* adapter's `true` to `false` lets capability-aware callers
* (`withAdvisoryLock`, the lockingSpec `beforeEach` guard) route around
* the missing primitive instead of hitting the throw, matching the
* H2 / SQL Server pattern from #2665.
*/
public boolean function $supportsAdvisoryLocks() {
return false;
Expand Down
7 changes: 7 additions & 0 deletions vendor/wheels/tests/specs/database/CockroachDBUnitSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ component extends="wheels.WheelsTest" {
});
});

describe("$supportsAdvisoryLocks", () => {

it("returns false (CockroachDB has no pg_advisory_lock equivalent)", () => {
expect(adapter.$supportsAdvisoryLocks()).toBeFalse();
});
});

describe("$identitySelect", () => {

it("returns lastId from result.generatedKey", () => {
Expand Down
Loading