SQLAlchemy.exc部分错误总结

文章目录

class ArgumentError(SQLAlchemyError):
    """
    原文:
    Raised when an invalid or conflicting function argument is supplied.
    This error generally corresponds to construction time state errors.
    提供无效或冲突的函数参数时引发。
    此错误通常与施工时间状态错误相对应。

    实践:
    常见于创建实例的时候,参数传递不对索引发,如:非空字段,外键等
    """

class ObjectNotExecutableError(ArgumentError):   # 对象不可执行错误
    """
    Raised when an object is passed to .execute() that can't be executed as SQL.
    当对象传递给.execute()时引发作为SQL执行。
    """

class NoSuchModuleError(ArgumentError):   # 没有这样的模块
    """
    Raised when a dynamically-loaded module (usually a database dialect)
    of a particular name cannot be located.

    当动态加载模块(通常是数据库方言)时引发无法找到特定名称的。
    """

class NoForeignKeysError(ArgumentError):   # 没有外键
    """
    Raised when no foreign keys can be located between two selectables
    during a join.
    当两个可选择项之间没有外键时引发在加入时。
    """

class AmbiguousForeignKeysError(ArgumentError):   # 外键混乱
    """
    Raised when more than one foreign key matching can be located
    between two selectables during a join.

    当可以找到多个外键匹配时引发在连接期间在两个可选择项之间。
    """

class IdentifierError(SQLAlchemyError):  # 标识符错误
    """
    Raised when a schema name is beyond the max character limit
    当架构名称超过最大字符限制时引发
    """

class TimeoutError(SQLAlchemyError):  # 超时
    """Raised when a connection pool times out on getting a connection."""


class InvalidRequestError(SQLAlchemyError):   # 无效请求
    """SQLAlchemy was asked to do something it can't do.

    This error generally corresponds to runtime state errors.

    SQLAlchemy被要求做一些它不能做的事情。此错误通常对应于运行时状态错误。
    """

class ResourceClosedError(InvalidRequestError):
    """An operation was requested from a connection, cursor, or other
    object that's in a closed state.
    从连接、游标或其他对象请求操作处于关闭状态的对象。
    """

class NoSuchColumnError(KeyError, InvalidRequestError):
    """A nonexistent column is requested from a ``RowProxy``."""


class NoSuchTableError(InvalidRequestError):
    """Table does not exist or is not visible to a connection."""

你可能感兴趣的:(数据库,Python)