You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR builds on the work in #29 and #60 by @kiendang and
@jtjeferreira.
What it does:
- rebase previous works on top of current `main`
- fix table name escape
- fix `DataTypesTests` and `OptionalsTests` with the point of contention
being the lack of a dedicated boolean column type
- add more tests (inserting both values of boolean, updating BIT
columns) and document any result deviations
How this is achieved:
T-SQL (the dialect used by MS SQL Server) does have `Boolean`s as part
of filter expressions, but not as column data, with `BIT`s being used as
a substitute. Hence, these uses which are both `Boolean` on the Scala
side, need to be distinguished. To this end, a marker was introduced in
`Context`, explicitly designating `InsertValues`, `InsertSelect`,
`InsertColumns` and `Update` expression as using them as values. This
was done globally, because overloading would lead to a lot more
boilerplate, while simply disregarding the flags value leave the
existing dialects intact.
Known omissions:
- `ExprBooleanOps` for `BIT` values: small edge case, it's possible and
there's syntax for it (bitwise operators), but it needs another
branching of the above kind, to not break the normal OR/AND/NOT syntax.
Bitwise operators are also already tested as part of NumericOps.
- RETURNING: this is not a thing in T-SQL, however it does have OUTPUT,
which could be used to achieve similar results
- ON CONFLICT: similarly, not present in T-SQL, there is MERGE in the
standard, but the opinions are mixed on whether it achieves the adequate
level of isolation as Postgres's ON CONFLICT does.
- LATERAL JOIN: again, very Postgres, maybe CROSS APPLY could be used to
achieve similar effect.
- bare VALUES: not supported. However, it is not it's own `Dialect`
trait yet, which would indicate this more cleanly,
---------
Co-authored-by: Kien Dang <[email protected]>
Co-authored-by: João Ferreira <[email protected]>
0 commit comments