autostore.types.sqlalchemy#

SQLAlchemy types.

Module Contents#

Classes#

FloatArrayTypeDecorator

SQLAlchemy NDArray -> JSON type decorator.

PathTypeDecorator

SQLAlchemy Path -> String type decorator.

API#

class autostore.types.sqlalchemy.FloatArrayTypeDecorator(*args: Any, **kwargs: Any)#

Bases: sqlalchemy.types.TypeDecorator

SQLAlchemy NDArray -> JSON type decorator.

Initialization

Construct a :class:.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.

impl#

None

cache_ok#

True

process_bind_param(value, dialect)#

Convert NumPy array to list for database.

process_result_value(value, dialect)#

Convert list from database back to NumPy array.

class autostore.types.sqlalchemy.PathTypeDecorator(*args: Any, **kwargs: Any)#

Bases: sqlalchemy.types.TypeDecorator

SQLAlchemy Path -> String type decorator.

Initialization

Construct a :class:.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.

impl#

None

cache_ok#

True

process_bind_param(value, dialect)#

Convert Path object to a string for the database.

process_result_value(value, dialect)#

Convert string from the database back to a Path object.