Philip Dukhov
03/10/2023, 12:24 PMCREATE TABLE SomeTable(
enumColumn TEXT AS EnumClass
);
update:
UPDATE SomeTable
SET enumColumn = EnumClass.EnumItem;
I can use argument instead of EnumClass.EnumItem
, but my query only makes sense with single enum constant.Darron Schall
10/09/2024, 7:26 PMenumColumn = '${SomeTableAdapter.enumColumnAdapter.encode(fully.qualified.package.EnumClass.EnumItem)}'
The generated SomeTableQueries.kt code will wrap the update SQL in a multiline string literal. That means we can take advantage of string interpolation inside the generated code's update query string.
By going through the column adapter to write the string value of the enum we can avoid hard-coding as much as possible.