Skip to content

Add sql.TypedLiteral #205

@dvarrazzo

Description

@dvarrazzo

In order to make client-side queries more similar to the server-side ones, we can introduce a sql.TypedLiteral object, which, on as_string(), would:

  • use the transformer to find the object oid
  • use the TypesRegistry to find the name of the type
  • add a cast to the object representation (e.g. '2021-01-01'::date).

Note that this might require to create many more Transformer. A worthwile optimisation (which could be useful for any recursive type) could be to not create a transformer when a transformer is passed as a context, but use always the same instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions