SAReferenceTypeDecorator

class SAReferenceTypeDecorator(*args: Any, **kwargs: Any)[source]

Bases: TypeDecorator

A SQLAlchemy type decorator for a curies.Reference.

Construct a TypeDecorator.

Arguments sent here are passed to the constructor of the class assigned to the impl class level attribute, assuming the impl is a callable, and the resulting object is assigned to the self.impl instance attribute (thus overriding the class attribute of the same name).

If the class level impl is not a callable (the unusual case), it will be assigned to the same instance attribute ‘as-is’, ignoring those arguments passed to the constructor.

Subclasses can override this to customize the generation of self.impl entirely.

Attributes Summary

cache_ok

Set SQLAlchemy caching to true

Methods Summary

process_bind_param(value, dialect)

Convert the Python object into a database value.

process_result_value(value, dialect)

Convert the database value into a Python object.

Attributes Documentation

cache_ok: ClassVar[bool] = True

Set SQLAlchemy caching to true

Methods Documentation

process_bind_param(value: str | Reference | None, dialect: Dialect) str | None[source]

Convert the Python object into a database value.

process_result_value(value: str | None, dialect: Dialect) Reference | None[source]

Convert the database value into a Python object.