本文整理汇总了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_
示例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()),
]
示例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")
示例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)
示例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"
示例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"