Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e436a94

Browse files
authored
Add locking clause syntax to dialect (vapor#230)
Provide the correct PostgreSQL syntax for SELECT locking clauses via the new SQLDialect properties.
1 parent 10797f4 commit e436a94

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎Sources/PostgresKit/PostgresDialect.swift‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,12 @@ public struct PostgresDialect: SQLDialect {
5959
public var unionFeatures: SQLUnionFeatures {
6060
[.union, .unionAll, .intersect, .intersectAll, .except, .exceptAll, .explicitDistinct, .parenthesizedSubqueries]
6161
}
62+
63+
public var sharedSelectLockExpression: SQLExpression? {
64+
SQLRaw("FOR SHARE")
65+
}
66+
67+
public var exclusiveSelectLockExpression: SQLExpression? {
68+
SQLRaw("FOR UPDATE")
69+
}
6270
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /