Skip to content

Add JsonDocument type support #109

Description

@krasnovdm

Problem

Currently ydb-sqlalchemy does not support the JsonDocument type. When writing a column of type JsonDocument, the parameter is always cast to Json, resulting in the error:

Failed to convert 'meta_info': Json to Optional<JsonDocument>

The issue is in compiler/base.py where the type is always mapped to Json.

Workaround

sqla.text(f"CAST(:{param_name} AS JsonDocument)").bindparams(bindvalue)

Expected behavior

JsonDocument should be a first-class supported type in ydb-sqlalchemy, both for reading and writing.

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