Skip to content

Support select locks in SAP HANA #11985

Closed

Description

@alumni

Feature Description

Add select lock (the FOR UPDATE + FOR SHARE LOCK clauses in SELECT statements) support in SapDriver.

The feature already exists in most drivers (I think SAP might be the only one not supporting it).

The Solution

Similar to other drivers. Minor difference is IGNORE LOCKED (SKIP LOCKED in other drivers).

<select_option> ::= { <for_update_clause> | <for_share_lock_clause> }

<for_update_clause> ::= 
   FOR UPDATE [ OF <update_column_name_list> ] 
   [ { <wait_nowait> | IGNORE LOCKED } ]

<for_share_lock_clause> ::= 
   FOR SHARE LOCK [ OF <update_column_name_list> ]
   [ <wait_nowait> ] [ IGNORE LOCKED ]

<wait_nowait> ::= { WAIT <unsigned_integer> | NOWAIT }

Considered Alternatives

The current alternative is writing raw SQL.

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions