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."""

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值