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


Python postgresql.TSVECTOR屬性代碼示例

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


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

示例1: visit_TSVECTOR

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def visit_TSVECTOR(self, type, **kw):
        return "TSVECTOR" 
開發者ID:jpush,項目名稱:jbox,代碼行數:4,代碼來源:base.py

示例2: downgrade

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('web_pages', sa.Column('previous_release', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('web_pages_previous_release_fkey', 'web_pages', 'web_page_history', ['previous_release'], ['id'])
    op.create_table('web_page_history',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('errno', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('url', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('file', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('distance', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('is_text', sa.BOOLEAN(), autoincrement=False, nullable=True),
    sa.Column('title', citext.CIText(), autoincrement=False, nullable=True),
    sa.Column('mimetype', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('content', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('fetchtime', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('addtime', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('tsv_content', postgresql.TSVECTOR(), autoincrement=False, nullable=True),
    sa.Column('root_rel', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('newer_rel', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('older_rel', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('contenthash', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('is_diff', sa.BOOLEAN(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['file'], ['web_files.id'], name='web_page_history_file_fkey'),
    sa.ForeignKeyConstraint(['newer_rel'], ['web_page_history.id'], name='web_page_history_newer_rel_fkey'),
    sa.ForeignKeyConstraint(['older_rel'], ['web_page_history.id'], name='web_page_history_older_rel_fkey'),
    sa.ForeignKeyConstraint(['root_rel'], ['web_pages.id'], name='web_page_history_root_rel_fkey'),
    sa.PrimaryKeyConstraint('id', name='web_page_history_pkey')
    )
    ### end Alembic commands ### 
開發者ID:fake-name,項目名稱:ReadableWebProxy,代碼行數:31,代碼來源:00004_09ec7dda0433_remove_old_history_tool.py

示例3: visit_TSVECTOR

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def visit_TSVECTOR(self, type):
        return "TSVECTOR" 
開發者ID:gltn,項目名稱:stdm,代碼行數:4,代碼來源:base.py

示例4: visit_TSVECTOR

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def visit_TSVECTOR(self, type_, **kw):
        return "TSVECTOR" 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:4,代碼來源:base.py

示例5: special_types_table

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def special_types_table(self, metadata):

        # create these types so that we can issue
        # special SQL92 INTERVAL syntax
        class y2m(types.UserDefinedType, postgresql.INTERVAL):
            def get_col_spec(self):
                return "INTERVAL YEAR TO MONTH"

        class d2s(types.UserDefinedType, postgresql.INTERVAL):
            def get_col_spec(self):
                return "INTERVAL DAY TO SECOND"

        table = Table(
            "sometable",
            metadata,
            Column("id", postgresql.UUID, primary_key=True),
            Column("flag", postgresql.BIT),
            Column("bitstring", postgresql.BIT(4)),
            Column("addr", postgresql.INET),
            Column("addr2", postgresql.MACADDR),
            Column("price", postgresql.MONEY),
            Column("addr3", postgresql.CIDR),
            Column("doubleprec", postgresql.DOUBLE_PRECISION),
            Column("plain_interval", postgresql.INTERVAL),
            Column("year_interval", y2m()),
            Column("month_interval", d2s()),
            Column("precision_interval", postgresql.INTERVAL(precision=3)),
            Column("tsvector_document", postgresql.TSVECTOR),
        )

        return table 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:33,代碼來源:test_types.py

示例6: test_tsvector_round_trip

# 需要導入模塊: from sqlalchemy.dialects import postgresql [as 別名]
# 或者: from sqlalchemy.dialects.postgresql import TSVECTOR [as 別名]
def test_tsvector_round_trip(self, connection):
        t = Table("t1", self.metadata, Column("data", postgresql.TSVECTOR))
        t.create()
        connection.execute(t.insert(), data="a fat cat sat")
        eq_(connection.scalar(select([t.c.data])), "'a' 'cat' 'fat' 'sat'")

        connection.execute(t.update(), data="'a' 'cat' 'fat' 'mat' 'sat'")

        eq_(
            connection.scalar(select([t.c.data])),
            "'a' 'cat' 'fat' 'mat' 'sat'",
        ) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:14,代碼來源:test_types.py


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