def schema_info(connection_alias):
    key = connection_schema_cache_key(connection_alias)
    ret = cache.get(key)
    if ret:
        return ret
    if do_async():
        build_schema_cache_async.delay(connection_alias)
    else:
        return build_schema_cache_async(connection_alias)
Example #2
0
def schema_info(connection_alias):
    key = connection_schema_cache_key(connection_alias)
    ret = cache.get(key)
    if ret:
        return ret
    if do_async():
        build_schema_cache_async.delay(connection_alias)
    else:
        return build_schema_cache_async(connection_alias)
Example #3
0
 def build_schema():
     for alias in settings.EXPLORER_CONNECTIONS:
         build_schema_cache_async(alias)
 def test_build_schema_cache_async(self, mocked_build):
     mocked_build.return_value = ['list_of_tuples']
     schema = build_schema_cache_async(CONN)
     assert mocked_build.called
     self.assertEqual(schema, ['list_of_tuples'])
Example #5
0
 def test_build_schema_cache_async(self, mocked_build):
     mocked_build.return_value = ['list_of_tuples']
     schema = build_schema_cache_async(CONN)
     assert mocked_build.called
     self.assertEqual(schema, ['list_of_tuples'])