fictive.sqlalchemy.ext.errors package¶
Submodules¶
Module contents¶
uniform interface for accessing the data in an sqlalchemy.exc.IntegrityError
-
class
fictive.sqlalchemy.ext.errors.IntegrityErrorData(integrity_error: sqlalchemy.exc.IntegrityError)[source]¶ Bases:
fictive.errors.ErrorDataRecords information assocated with an
sqlalchemy.exc.IntegrityErrorE.g.:
>>> first = Model(value=1) >>> session.add(first) >>> second = Model(value=1) >>> session.add(second) >>> try: ... session.commit() >>> except sqlalchemy.exc.IntegrityError as integrity_error: ... data = IntegrityErrorData(integrity_error) >>> data.code 'UniqueViolation' >>> assert data.fields {'value': '1'} >>> assert data.table 'model'
-
ERROR_CLASS¶ alias of
sqlalchemy.exc.IntegrityError
-
__init__(integrity_error: sqlalchemy.exc.IntegrityError)[source]¶ - Param
integrity_error: the
sqlalchemy.exc.IntegrityErrorthat contains a databasedriver error in itsorigattribute
-
property
fields¶ table columns and values that caused the error
-
property
table¶ the table that caused the error
-