当前位置: 首页>>代码示例>>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;未经允许,请勿转载。