Skip to content

(DuckDB) SQLPage warning when using casting shorthand #1200

@kspeeckaert

Description

@kspeeckaert

Introduction

SQLPage emits a warning regarding the casting syntax when using ::.

To Reproduce

Simplest example without needing any database setup (just a blank DuckDB database):

select '0'::int
from duckdb_functions()
limit 1;

Actual behavior

Output in the logs:

[2026-01-23T22:53:24.247Z WARN  sqlpage::webserver::database::sql] Casting with '::' is not supported on your database. For backwards compatibility with older SQLPage versions, we will transform it to CAST(... AS ...).

Expected behavior

As mentioned in the DuckDB docs:

The standard SQL syntax for explicit casting is CAST(expr AS TYPENAME), where TYPENAME is a name (or alias) of one of DuckDB's data types. DuckDB also supports the shorthand expr::TYPENAME, which is also present in PostgreSQL.

As the shorthand :: is supported, the warning should not appear and there's no need to transform the syntaxt to CAST(... AS ...).

Version information

  • OS: Debian, but also reproducible on macOS
  • Database: DuckDB
  • SQLPage v0.42.0 (using the docker.io/lovasoa/sqlpage:main-duckdb image)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions