Skip to content

Allow Kotlin enums to be interpolated #17

@cies

Description

@cies

This issue is related to this: ExoQuery/terpal-sql#21

Currently I convert enums to a String (usually with .name) before I interpolate then into an SQL String with Terpal.

It would be nice this plugins accepts enum values (of enums annotated with @serializable).
Simply taking their .name as the value (overridden with their @SerialName, if provided).

Looking at the code this would probably require kotlinx.serialization as a dependency of this plugin: not sure if that's acceptable.
Maybe using this could also make interpolating lists less boilerplate-y (${Params.list(...)}.

Alternatively a Param function could also be used to interpolate Kotlin enums (but I do not see how to do that without kotlinx.serialization or reflection).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions