sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

Bitwise query placeholder uses type instead of `Int`

Open vanniktech opened this issue 11 months ago • 0 comments

SQLDelight Version

2.1.0-SNAPSHOT

SQLDelight Dialect

postgres

Describe the Bug

I have the following table:

CREATE TABLE profile (
  id CHARACTER VARYING(36) AS UserId NOT NULL PRIMARY KEY REFERENCES account(id),
  interestedInGenders INTEGER AS GenderList NOT NULL
);

interestedInGenders is using a custom type GenderList which is just an inline value class of type Int. I do some bit masking there.

When using a query:

SELECT * from profile WHERE interestedInGenders & :gender > 0

the generated parameter type of gender is of type GenderList. This is correct & works. However it would be much nicer if the & is used, the underlying real type is used instead of the aliased one.

Stacktrace


vanniktech avatar Nov 11 '24 09:11 vanniktech