本文整理匯總了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"