本文整理汇总了Python中sqlalchemy.dialects.mysql.LONGTEXT属性的典型用法代码示例。如果您正苦于以下问题:Python mysql.LONGTEXT属性的具体用法?Python mysql.LONGTEXT怎么用?Python mysql.LONGTEXT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sqlalchemy.dialects.mysql
的用法示例。
在下文中一共展示了mysql.LONGTEXT属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_dialect_impl
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def load_dialect_impl(self, dialect):
if dialect.name == 'mysql':
return dialect.type_descriptor(mysql.LONGTEXT())
else:
return self.impl
示例2: upgrade
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('documents', sa.Column('raw_calais', mysql.LONGTEXT(), nullable=True))
### end Alembic commands ###
示例3: load_dialect_impl
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def load_dialect_impl(self, dialect):
if dialect.name == "mysql":
return dialect.type_descriptor(
LONGTEXT(charset="utf8mb4", collation="utf8mb4_unicode_ci")
)
else:
return dialect.type_descriptor(Text())
示例4: upgrade
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade():
bind = op.get_bind()
engine = bind.engine
if engine.name == 'mysql':
op.alter_column('atomdetails', 'results', type_=mysql.LONGTEXT,
existing_nullable=True)
示例5: __init__
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def __init__(self, mysql_as_long=False, mysql_as_medium=False):
"""Initialize JSON-encoding type."""
super(JsonEncodedType, self).__init__()
if mysql_as_long and mysql_as_medium:
raise TypeError("mysql_as_long and mysql_as_medium are mutually "
"exclusive")
if mysql_as_long:
self.impl = Text().with_variant(mysql.LONGTEXT(), 'mysql')
elif mysql_as_medium:
self.impl = Text().with_variant(mysql.MEDIUMTEXT(), 'mysql')
示例6: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade_development():
### commands auto generated by Alembic - please adjust! ###
op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True))
op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True))
op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
### end Alembic commands ###
示例7: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade_test():
### commands auto generated by Alembic - please adjust! ###
op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True))
op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True))
op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
### end Alembic commands ###
示例8: upgrade_production
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade_production():
### commands auto generated by Alembic - please adjust! ###
op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True))
op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True))
op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
### end Alembic commands ###
示例9: LongText
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def LongText():
# TODO(rakhmerov): Need to do for postgres.
return sa.Text().with_variant(mysql.LONGTEXT(), 'mysql')
示例10: upgrade
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def upgrade():
op.add_column('event', sa.Column('_description', mysql.LONGTEXT(),
nullable=True))
示例11: downgrade
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import LONGTEXT [as 别名]
def downgrade():
op.drop_index('ix_transaction_public_id', table_name='transaction')
op.drop_column('transaction', 'public_id')
op.drop_column('transaction', 'object_public_id')
op.add_column('transaction', sa.Column(u'additional_data',
mysql.LONGTEXT(), nullable=True))
op.drop_column('transaction', 'public_snapshot')
op.drop_column('transaction', 'private_snapshot')