當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。