autostore.types.sqlalchemy#
SQLAlchemy types.
Module Contents#
Classes#
SQLAlchemy NDArray -> JSON type decorator. |
|
SQLAlchemy Path -> String type decorator. |
API#
- class autostore.types.sqlalchemy.FloatArrayTypeDecorator(*args: Any, **kwargs: Any)#
Bases:
sqlalchemy.types.TypeDecoratorSQLAlchemy NDArray -> JSON type decorator.
Initialization
Construct a :class:
.TypeDecorator.Arguments sent here are passed to the constructor of the class assigned to the
implclass level attribute, assuming theimplis a callable, and the resulting object is assigned to theself.implinstance attribute (thus overriding the class attribute of the same name).If the class level
implis 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.implentirely.- 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.TypeDecoratorSQLAlchemy Path -> String type decorator.
Initialization
Construct a :class:
.TypeDecorator.Arguments sent here are passed to the constructor of the class assigned to the
implclass level attribute, assuming theimplis a callable, and the resulting object is assigned to theself.implinstance attribute (thus overriding the class attribute of the same name).If the class level
implis 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.implentirely.- 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.