Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select: Add support for locking clauses #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nilmerg
Copy link
Member

@nilmerg nilmerg commented May 10, 2022

No description provided.

*/
public function buildFor($lockStrength)
{
$sql = [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just return ! empty($lockStrength) ? "FOR $lockStrength" : ""?

/**
* Build the locking clause of a query
*
* @param ?string $lockStrength
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just string here?

*
* @param string $lockStrength
*
* @return self
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be @return $this.

/**
* Build the locking clause of a query
*
* @param ?string $lockStrength
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find the ANSI-SQL definition, but read that this is defined in ANSI-SQL (to an extent, of course). Here is what I found about the implementation in our supported databases:

Because of the different implementations, I would say locking clause instead of lock strength everywhere. And don't bother with MSSQL for now.

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

Successfully merging this pull request may close these issues.

2 participants