當前位置: 首頁>>代碼示例>>Python>>正文


Python sqlalchemy.PickleType方法代碼示例

本文整理匯總了Python中sqlalchemy.PickleType方法的典型用法代碼示例。如果您正苦於以下問題:Python sqlalchemy.PickleType方法的具體用法?Python sqlalchemy.PickleType怎麽用?Python sqlalchemy.PickleType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sqlalchemy的用法示例。


在下文中一共展示了sqlalchemy.PickleType方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('task_result',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('pull_mirror_id', sa.Integer(), nullable=True),
    sa.Column('push_mirror_id', sa.Integer(), nullable=True),
    sa.Column('task_id', sa.String(length=155), nullable=True),
    sa.Column('status', sa.String(length=50), nullable=True),
    sa.Column('task_name', sa.String(length=255), nullable=True),
    sa.Column('invoked_by', sa.Integer(), nullable=True),
    sa.Column('result', sa.PickleType(), nullable=True),
    sa.Column('date_done', sa.DateTime(), nullable=True),
    sa.Column('traceback', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['pull_mirror_id'], ['pull_mirror.id'], ),
    sa.ForeignKeyConstraint(['push_mirror_id'], ['push_mirror.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('task_id')
    )
    op.create_index(op.f('ix_task_result_pull_mirror_id'), 'task_result', ['pull_mirror_id'], unique=False)
    op.create_index(op.f('ix_task_result_push_mirror_id'), 'task_result', ['push_mirror_id'], unique=False)
    # ### end Alembic commands ### 
開發者ID:Salamek,項目名稱:gitlab-tools,代碼行數:25,代碼來源:20bcb4b2673c_.py

示例2: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    op.create_table(
        'opendaylightjournal',
        sa.Column('id', sa.String(36), primary_key=True),
        sa.Column('object_type', sa.String(36), nullable=False),
        sa.Column('object_uuid', sa.String(36), nullable=False),
        sa.Column('operation', sa.String(36), nullable=False),
        sa.Column('data', sa.PickleType, nullable=True),
        sa.Column('state',
                  sa.Enum('pending', 'processing', 'failed', 'completed',
                          name='state'),
                  nullable=False, default='pending'),
        sa.Column('retry_count', sa.Integer, default=0),
        sa.Column('created_at', sa.DateTime, default=sa.func.now()),
        sa.Column('last_retried', sa.TIMESTAMP, server_default=sa.func.now(),
                  onupdate=sa.func.now())
    ) 
開發者ID:openstack,項目名稱:networking-odl,代碼行數:19,代碼來源:37e242787ae5_opendaylight_neutron_mechanism_driver_.py

示例3: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    op.create_table(
        'opendaylightjournal_new',
        sa.Column('seqnum', sa.BigInteger(),
                  primary_key=True, autoincrement=True),
        sa.Column('object_type', sa.String(36), nullable=False),
        sa.Column('object_uuid', sa.String(36), nullable=False),
        sa.Column('operation', sa.String(36), nullable=False),
        sa.Column('data', sa.PickleType, nullable=True),
        sa.Column('state',
                  sa.Enum('pending', 'processing', 'failed', 'completed',
                          name='state'),
                  nullable=False, default='pending'),
        sa.Column('retry_count', sa.Integer, default=0),
        sa.Column('created_at', sa.DateTime, default=sa.func.now()),
        sa.Column('last_retried', sa.TIMESTAMP, server_default=sa.func.now(),
                  onupdate=sa.func.now()),
    ) 
開發者ID:openstack,項目名稱:networking-odl,代碼行數:20,代碼來源:3d560427d776_add_sequence_number_to_journal.py

示例4: test_custom_pickle

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def test_custom_pickle(self):
        class MyPickleType(types.TypeDecorator):
            impl = PickleType

            def process_bind_param(self, value, dialect):
                if value:
                    value.stuff = "BIND" + value.stuff
                return value

            def process_result_value(self, value, dialect):
                if value:
                    value.stuff = value.stuff + "RESULT"
                return value

        data = pickleable.Foo("im foo 1")
        expected = pickleable.Foo("im foo 1")
        expected.stuff = "BINDim stuffRESULT"

        self._test_round_trip(MyPickleType, data, expected=expected) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:21,代碼來源:test_types.py

示例5: test_eq_comparison

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def test_eq_comparison(self):
        p1 = PickleType()

        for obj in (
            {"1": "2"},
            pickleable.Bar(5, 6),
            pickleable.OldSchool(10, 11),
        ):
            assert p1.compare_values(p1.copy_value(obj), obj)

        assert_raises(
            NotImplementedError,
            p1.compare_values,
            pickleable.BrokenComparable("foo"),
            pickleable.BrokenComparable("foo"),
        ) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:18,代碼來源:test_types.py

示例6: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('celery_taskmeta',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('task_id', sa.String(length=155), nullable=True),
    sa.Column('status', sa.String(length=50), nullable=True),
    sa.Column('result', sa.PickleType(), nullable=True),
    sa.Column('date_done', sa.DateTime(), nullable=True),
    sa.Column('traceback', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('task_id'),
    sqlite_autoincrement=True
    )
    op.create_table('celery_tasksetmeta',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('taskset_id', sa.String(length=155), nullable=True),
    sa.Column('result', sa.PickleType(), nullable=True),
    sa.Column('date_done', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('taskset_id'),
    sqlite_autoincrement=True
    )
    op.add_column('task_result', sa.Column('celery_taskmeta_id', sa.Integer(), nullable=False))
    op.create_index(op.f('ix_task_result_celery_taskmeta_id'), 'task_result', ['celery_taskmeta_id'], unique=False)
    op.drop_constraint('task_result_task_id_key', 'task_result', type_='unique')
    op.create_foreign_key(None, 'task_result', 'celery_taskmeta', ['celery_taskmeta_id'], ['id'])
    op.drop_column('task_result', 'result')
    op.drop_column('task_result', 'status')
    op.drop_column('task_result', 'date_done')
    op.drop_column('task_result', 'task_id')
    op.drop_column('task_result', 'traceback')
    # ### end Alembic commands ### 
開發者ID:Salamek,項目名稱:gitlab-tools,代碼行數:34,代碼來源:d4841aeeb072_.py

示例7: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    op.add_column('listener', sa.Column('insert_headers', sa.PickleType())) 
開發者ID:openstack,項目名稱:octavia,代碼行數:4,代碼來源:4d9cf7d32f2_insert_headers.py

示例8: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():   # noqa: D103
    op.add_column('dag_run', sa.Column('conf', sa.PickleType(), nullable=True)) 
開發者ID:apache,項目名稱:airflow,代碼行數:4,代碼來源:40e67319e3a9_dagrun_config.py

示例9: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():   # noqa: D103
    op.add_column(TASK_INSTANCE_TABLE, sa.Column(NEW_COLUMN, sa.PickleType(pickler=dill))) 
開發者ID:apache,項目名稱:airflow,代碼行數:4,代碼來源:27c6a30d7c24_add_executor_config_to_task_instance.py

示例10: downgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def downgrade():   # noqa: D103
    # use batch_alter_table to support SQLite workaround
    with op.batch_alter_table("xcom") as batch_op:
        batch_op.alter_column('value', type_=sa.PickleType(pickler=dill)) 
開發者ID:apache,項目名稱:airflow,代碼行數:6,代碼來源:bdaa763e6c56_make_xcom_value_column_a_large_binary.py

示例11: _define_start_params_table

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def _define_start_params_table(database):
    start_params_table = Table(
        "start_params", database, Column("value", PickleType), extend_existing=True
    )
    return start_params_table 
開發者ID:OpenSourceEconomics,項目名稱:estimagic,代碼行數:7,代碼來源:create_database.py

示例12: _define_one_column_pickle_table

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def _define_one_column_pickle_table(database, table):
    params_table = Table(
        table,
        database,
        Column("iteration", Integer, primary_key=True),
        Column("value", PickleType),
        sqlite_autoincrement=True,
        extend_existing=True,
    )
    return params_table 
開發者ID:OpenSourceEconomics,項目名稱:estimagic,代碼行數:12,代碼來源:create_database.py

示例13: _define_scalar_pickle_table

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def _define_scalar_pickle_table(database, name):
    dash_options = Table(
        name, database, Column("value", PickleType), extend_existing=True
    )
    return dash_options 
開發者ID:OpenSourceEconomics,項目名稱:estimagic,代碼行數:7,代碼來源:create_database.py

示例14: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "task_results",
        sa.Column("task_id", sa.String(), nullable=False),
        sa.Column("jobs", sa.PickleType(), nullable=True),
        sa.Column("event", sa.PickleType(), nullable=True),
        sa.PrimaryKeyConstraint("task_id"),
    )
    op.drop_column("copr_builds", "logs")
    # ### end Alembic commands ### 
開發者ID:packit-service,項目名稱:packit-service,代碼行數:13,代碼來源:dc1beda6749e_add_tables_for_task_results.py

示例15: upgrade

# 需要導入模塊: import sqlalchemy [as 別名]
# 或者: from sqlalchemy import PickleType [as 別名]
def upgrade():
    op.add_column('division',
            sa.Column('pilot_transformer', sa.PickleType(), nullable=True))
    op.add_column('division',
            sa.Column('ship_transformer', sa.PickleType(), nullable=True))
    op.drop_column('request', 'ship_url') 
開發者ID:paxswill,項目名稱:evesrp,代碼行數:8,代碼來源:c1fc69b629_.py


注:本文中的sqlalchemy.PickleType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。