Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Type annotations in SQL template placeholders #18

@agentgt

Description

@agentgt

To keep accidentally data coercion with JDBC happening with SQL templates type annotations might be useful using the format -- {name:type} and --{:type}.

Example:

SELECT * FROM STUFF
WHERE ID = 1 -- {id:long}

Obviously this is not compile time type safety but run time type checking. That is for example if you bind a int, Integer, or String or anything else that is not a long or Long an error will happen when the place holders parameters are merged (.mergedParameters()). The type annotations will need to be consistent. That is you cannot later set -- {id:String} with in the same SQL template.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions