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