tisserande.db_oper.data_types

Attributes

data_file_type

config_file_type

config_dict_type

parameter

array

class_

Classes

DataFileTypeOperations

Base class for Table operations with full type safety.

ConfigFileTypeOperations

Base class for Table operations with full type safety.

ConfigDictTypeOperations

Base class for Table operations with full type safety.

ParameterOperations

Base class for Table operations with full type safety.

ArrayOperations

Base class for Table operations with full type safety.

ClassOperations

Base class for Table operations with full type safety.

Module Contents

class tisserande.db_oper.data_types.DataFileTypeOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.DataFileTypeTable, tisserande.models.DataFileType, tisserande.models.DataFileTypeCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
class tisserande.db_oper.data_types.ConfigFileTypeOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.ConfigFileTypeTable, tisserande.models.ConfigFileType, tisserande.models.ConfigFileTypeCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
class tisserande.db_oper.data_types.ConfigDictTypeOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.ConfigDictTypeTable, tisserande.models.ConfigDictType, tisserande.models.ConfigDictTypeCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
class tisserande.db_oper.data_types.ParameterOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.ParameterTable, tisserande.models.Parameter, tisserande.models.ParameterCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
class tisserande.db_oper.data_types.ArrayOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.ArrayTable, tisserande.models.Array, tisserande.models.ArrayCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
class tisserande.db_oper.data_types.ClassOperations(context: TableContext[T, ResponseT, CreateT])[source]

Bases: macon.db_oper.base.TableOperations[tisserande.db.data_types.ClassTable, tisserande.models.Class, tisserande.models.ClassCreate]

Base class for Table operations with full type safety.

Provides common CRUD operations for database tables with validation, lifecycle hooks, and complete type safety across database models and their Pydantic representations.

Type Parameters

TTypeVar, bound=Base

Database model class (SQLAlchemy)

ResponseTTypeVar, bound=BaseModel

Pydantic model class for responses

CreateTTypeVar, bound=BaseModel

Pydantic model class for creation

Important

All methods that modify the database (create_row, create_rows, etc.) DO NOT commit transactions. The caller MUST manage transactions using async with session.begin() or explicit commit/rollback.

All create methods DO add objects to the session and flush them to get database-generated values (like auto-increment IDs), but the transaction must still be committed by the caller.

param context:

Shared configuration for this operation

Examples

>>> from myapp.models import User, UserResponse, UserCreate
>>> context = TableContext(
...     db_class=User,
...     response_class=UserResponse,
...     create_class=UserCreate,
...     class_string="user"
... )
>>> ops = TableOperations(context)
>>>
>>> async with get_session() as session:
...     async with session.begin():
...         user = await ops.create_row(
...             session,
...             username="alice",
...             email="alice@example.com"
...         )
...         # user is type User (T)
...         pydantic_user = ops.to_pydantic(user)
...         # pydantic_user is type UserResponse (ResponseT)
tisserande.db_oper.data_types.data_file_type[source]
tisserande.db_oper.data_types.config_file_type[source]
tisserande.db_oper.data_types.config_dict_type[source]
tisserande.db_oper.data_types.parameter[source]
tisserande.db_oper.data_types.array[source]
tisserande.db_oper.data_types.class_[source]