Skip to content

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.

3 participants