Skip to main content

6.7 Type Handling

Type handlers bind DataQL values to JDBC parameters and convert result columns back into script values. Common strings, numbers, booleans and dates have default mappings. JSON, vectors and database-specific formats can use explicit handlers.

var query = @@selectSql(createdAt)<%
SELECT CAST(#{createdAt, jdbcType=TIMESTAMP} AS TIMESTAMP)
%>;
return query('2026-10-05 12:34:56');

This H2 example binds a string as TIMESTAMP and returns epoch milliseconds. jdbcType selects the JDBC type; typeHandler can select a specific conversion implementation.

Guides​

Scope​

SQL parameters have already passed through the DataQL data model. Java enums become their names, ordinary Java arrays become lists, and business objects become field objects. Entity annotations and ORM property mappings are not part of this execution path. There is no built-in GIS object handler; use database WKT/WKB functions or an application handler.

A conversion handler does not add support for a column type to a database. Examples identify the database they target; use the SQL syntax and JDBC types supported by your driver.