当前位置: 首页>>代码示例>>Python>>正文


Python types.BLOB属性代码示例

本文整理汇总了Python中sqlalchemy.types.BLOB属性的典型用法代码示例。如果您正苦于以下问题:Python types.BLOB属性的具体用法?Python types.BLOB怎么用?Python types.BLOB使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在sqlalchemy.types的用法示例。


在下文中一共展示了types.BLOB属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_type

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def get_type(data_type):
    type_map = {
        "bytes": types.LargeBinary,
        "boolean": types.Boolean,
        "date": types.Date,
        "datetime": types.DateTime,
        "double": types.Numeric,
        "text": types.String,
        "keyword": types.String,
        "integer": types.Integer,
        "half_float": types.Float,
        "geo_point": types.String,
        # TODO get a solution for nested type
        "nested": types.String,
        # TODO get a solution for object
        "object": types.BLOB,
        "long": types.BigInteger,
        "float": types.Float,
        "ip": types.String,
    }
    type_ = type_map.get(data_type)
    if not type_:
        logger.warning(f"Unknown type found {data_type} reverting to string")
        type_ = types.String
    return type_ 
开发者ID:preset-io,项目名称:elasticsearch-dbapi,代码行数:27,代码来源:basesqlalchemy.py

示例2: _type_affinity_fixture

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def _type_affinity_fixture(self):
        return [
            ("LONGTEXT", sqltypes.TEXT()),
            ("TINYINT", sqltypes.INTEGER()),
            ("MEDIUMINT", sqltypes.INTEGER()),
            ("INT2", sqltypes.INTEGER()),
            ("UNSIGNED BIG INT", sqltypes.INTEGER()),
            ("INT8", sqltypes.INTEGER()),
            ("CHARACTER(20)", sqltypes.TEXT()),
            ("CLOB", sqltypes.TEXT()),
            ("CLOBBER", sqltypes.TEXT()),
            ("VARYING CHARACTER(70)", sqltypes.TEXT()),
            ("NATIVE CHARACTER(70)", sqltypes.TEXT()),
            ("BLOB", sqltypes.BLOB()),
            ("BLOBBER", sqltypes.NullType()),
            ("DOUBLE PRECISION", sqltypes.REAL()),
            ("FLOATY", sqltypes.REAL()),
            ("SOMETHING UNKNOWN", sqltypes.NUMERIC()),
        ] 
开发者ID:sqlalchemy,项目名称:sqlalchemy,代码行数:21,代码来源:test_sqlite.py

示例3: visit_BLOB

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def visit_BLOB(self, type_, **kwargs):
        raise exceptions.NotSupportedError("Type BLOB is not supported") 
开发者ID:preset-io,项目名称:elasticsearch-dbapi,代码行数:4,代码来源:basesqlalchemy.py

示例4: test_blob

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def test_blob(self):
        for t in ['blob', 'bytea', 'bytes']:
            self._test(t, sqltypes.BLOB) 
开发者ID:cockroachdb,项目名称:sqlalchemy-cockroachdb,代码行数:5,代码来源:test_introspection.py

示例5: visit_TEXT

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def visit_TEXT(self, type_, **kw):
        return "BLOB SUB_TYPE 1" 
开发者ID:sqlalchemy,项目名称:sqlalchemy,代码行数:4,代码来源:base.py

示例6: visit_BLOB

# 需要导入模块: from sqlalchemy import types [as 别名]
# 或者: from sqlalchemy.types import BLOB [as 别名]
def visit_BLOB(self, type_, **kw):
        return "BLOB SUB_TYPE 0" 
开发者ID:sqlalchemy,项目名称:sqlalchemy,代码行数:4,代码来源:base.py


注:本文中的sqlalchemy.types.BLOB属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。