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

docs: [SQL Server, Oracle] Edit KDocs for Op.TRUE/FALSE #1957

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

bog-walk
Copy link
Member

@bog-walk bog-walk commented Jan 3, 2024

Current KDocs are misleading for the actual behavior of Op.TRUE and Op.FALSE as they make it seem like the objects simply translate to the SQL types for true and false.

This is technically correct for databases that support conventional boolean data types, so the objects can be used either as a stand-alone operator or as the left- or right-hand side of any comparison operator.

But for SQL Server and Oracle, which do not support syntax like WHERE 1 or WHERE TRUE, the object's logic returns an operator that always evaluates to a boolean, like 1 = 1. So attempting to use these objects as the left- or right-hand side of any comparison operator will cause a syntax error. booleanLiteral() or booleanParam() should be used in these situations.

Current KDocs are potentially misleading in that it seems like the operator
could be used both as a standalone value and on the right-hand side of a
comparison operator. For most databases, this works, but will lead to a syntax
error in SQL Server and Oracle.

The new KDocs clarify that they represent operators that always evaluate to a
boolean value, so using them on the right-hand side is not the intention.
@bog-walk bog-walk requested a review from e5l January 3, 2024 01:11
@bog-walk bog-walk changed the title docs: [SQL Server, Oracle] dit KDocs for Op.TRUE/FALSE docs: [SQL Server, Oracle] Edit KDocs for Op.TRUE/FALSE Jan 3, 2024
@bog-walk bog-walk linked an issue Jan 3, 2024 that may be closed by this pull request
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

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

lgtm

@bog-walk bog-walk merged commit 8c247e1 into main Jan 3, 2024
5 checks passed
@bog-walk bog-walk deleted the bog-walk/edit-op-kdocs branch January 3, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Op.TRUE/FALSE not working on SQLServer
2 participants