• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python metadata.get_result函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中metadata.get_result函数的典型用法代码示例。如果您正苦于以下问题:Python get_result函数的具体用法?Python get_result怎么用?Python get_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_result函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_suggested_multiple_column_names

def test_suggested_multiple_column_names(completer):
    result = get_result(
        completer, 'SELECT id,  from custom.products', len('SELECT id, ')
    )
    assert completions_to_set(result) == completions_to_set(testdata.columns_functions_and_keywords(
        'products', 'custom'
    ))
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例2: test_all_schema_objects_with_aliases

def test_all_schema_objects_with_aliases(completer):
    text = ('SELECT * FROM ')
    result = get_result(completer, text)
    assert completions_to_set(result) >= completions_to_set(
        [table(x) for x in ('orders o', '"select" s', 'custom.shipments s')]
        + [function(x) for x in ('func2() f',)]
    )
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例3: test_suggested_aliases_after_on_right_side

def test_suggested_aliases_after_on_right_side(completer, text):
    position = len(
        'SELECT u.name, o.id FROM users u JOIN orders o ON o.user_id = '
    )
    result = get_result(completer, text, position)
    assert completions_to_set(result) == completions_to_set(
        [alias('u'), alias('o')])
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例4: test_user_function_name_completion_matches_anywhere

def test_user_function_name_completion_matches_anywhere(completer):
    result = get_result(completer, 'SELECT om')
    assert completions_to_set(result) == completions_to_set([
        function('custom_fun()', -2),
        function('_custom_fun()', -2),
        function('custom_func1()', -2),
        function('custom_func2()', -2)])
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例5: test_suggested_join_conditions

def test_suggested_join_conditions(completer, text):
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set([
        alias('users'),
        alias('shipments'),
        name_join('shipments.id = users.id'),
        fk_join('shipments.user_id = users.id')])
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例6: test_aliased_joins

def test_aliased_joins(completer, text):
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set(testdata.schemas() + aliased_rels + [
        join('"Users" U ON U.userid = Users.id'),
        join('users u ON u.id = Users.parentid'),
        join('users u ON u.parentid = Users.id'),
    ])
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例7: test_suggest_columns_from_aliased_set_returning_function

def test_suggest_columns_from_aliased_set_returning_function(completer):
    result = get_result(
        completer, 'select f. from set_returning_func() f', len('select f.')
    )
    assert completions_to_set(result) == completions_to_set(
        testdata.columns('set_returning_func', typ='functions')
    )
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例8: test_cased_joins

def test_cased_joins(completer, text):
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set([schema('PUBLIC')] + cased_rels + [
        join('"Users" ON "Users".UserID = Users.ID'),
        join('Users Users2 ON Users2.ID = Users.PARENTID'),
        join('Users Users2 ON Users2.PARENTID = Users.ID'),
    ])
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例9: test_join_functions_using_suggests_common_columns

def test_join_functions_using_suggests_common_columns(completer):
    text = '''SELECT * FROM set_returning_func() f1
              INNER JOIN set_returning_func() f2 USING ('''
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set(
        testdata.columns('set_returning_func', typ='functions')
    )
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例10: test_suggested_column_names_from_schema_qualifed_table

def test_suggested_column_names_from_schema_qualifed_table(completer):
    result = get_result(
        completer, 'SELECT  from custom.products', len('SELECT ')
    )
    assert completions_to_set(result) == completions_to_set(testdata.columns_functions_and_keywords(
        'products', 'custom'
    ))
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例11: test_suggest_columns_from_set_returning_function

def test_suggest_columns_from_set_returning_function(completer):
    result = get_result(
        completer, 'select  from set_returning_func()', len('select ')
    )
    assert completions_to_set(result) == completions_to_set(testdata.columns_functions_and_keywords(
        'set_returning_func', typ='functions'
    ))
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例12: test_suggested_auto_qualified_column_names_two_tables

def test_suggested_auto_qualified_column_names_two_tables(text, completer):
    position = text.index('  ') + 1
    cols = [column('U.' + c.lower()) for c in cased_users_col_names]
    cols += [column('"Users".' + c.lower()) for c in cased_users2_col_names]
    result = get_result(completer, text, position)
    assert completions_to_set(result) == completions_to_set(
        cols + testdata.functions_and_keywords())
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_public_schema_only.py


示例13: test_all_schema_objects_with_casing

def test_all_schema_objects_with_casing(completer):
    text = 'SELECT * FROM '
    result = get_result(completer, text)
    assert completions_to_set(result) >= completions_to_set(
        [table(x) for x in ('Orders', '"select"', 'CUSTOM.shipments')]
        + [function(x + '()') for x in ('func2',)]
    )
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例14: test_function_alias_search_with_aliases

def test_function_alias_search_with_aliases(completer):
    text = 'SELECT blog.ee'
    result = get_result(completer, text)
    first = result[0]
    assert first.start_position == -2
    assert first.text == 'enter_entry(_title := , _text := )'
    assert first.display_text == 'enter_entry(_title, _text)'
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例15: test_function_alias_search_without_aliases

def test_function_alias_search_without_aliases(completer):
    text = 'SELECT blog.ees'
    result = get_result(completer, text)
    first = result[0]
    assert first.start_position == -3
    assert first.text == 'extract_entry_symbols()'
    assert first.display_text == 'extract_entry_symbols(_entryid)'
开发者ID:dbcli,项目名称:pgcli,代码行数:7,代码来源:test_smart_completion_multiple_schemata.py


示例16: test_suggested_multiple_column_names_with_alias

def test_suggested_multiple_column_names_with_alias(completer):
    result = get_result(
        completer,
        'SELECT p.id, p. from custom.products p',
        len('SELECT u.id, u.')
    )
    assert completions_to_set(result) == completions_to_set(
        testdata.columns('products', 'custom'))
开发者ID:dbcli,项目名称:pgcli,代码行数:8,代码来源:test_smart_completion_multiple_schemata.py


示例17: test_suggested_aliases_after_on

def test_suggested_aliases_after_on(completer, text):
    position = len('SELECT u.name, o.id FROM users u JOIN orders o ON ')
    result = get_result(completer, text, position)
    assert completions_to_set(result) == completions_to_set([
        alias('u'),
        name_join('o.id = u.id'),
        name_join('o.email = u.email'),
        alias('o')])
开发者ID:dbcli,项目名称:pgcli,代码行数:8,代码来源:test_smart_completion_public_schema_only.py


示例18: test_table_aliases

def test_table_aliases(completer, text):
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set(testdata.schemas() + [
        table('users u'),
        table('orders o' if text == 'SELECT * FROM ' else 'orders o2'),
        table('"select" s'),
        function('func1() f'),
        function('func2() f')])
开发者ID:dbcli,项目名称:pgcli,代码行数:8,代码来源:test_smart_completion_multiple_schemata.py


示例19: test_set_schema

def test_set_schema(completer):
    text = ('SET SCHEMA ')
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set([
        schema(u"'blog'"),
        schema(u"'Custom'"),
        schema(u"'custom'"),
        schema(u"'public'")])
开发者ID:dbcli,项目名称:pgcli,代码行数:8,代码来源:test_smart_completion_multiple_schemata.py


示例20: test_table_casing

def test_table_casing(completer, text):
    result = get_result(completer, text)
    assert completions_to_set(result) == completions_to_set(cased_schemas + [
        table('users'),
        table('Orders'),
        table('"select"'),
        function('Func1()'),
        function('func2()')])
开发者ID:dbcli,项目名称:pgcli,代码行数:8,代码来源:test_smart_completion_multiple_schemata.py



注:本文中的metadata.get_result函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.insert_run_start函数代码示例发布时间:2022-05-27
下一篇:
Python metaclass.twiss函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap