我想访问Sqlite中任何特定表的所有特定视图.我知道我可以使用sqlite_master获取数据库中所有可用表的列表
SELECT name from sqlite_master WHERE type='table';
Run Code Online (Sandbox Code Playgroud)
以及使用的所有可用视图的列表
SELECT name from sqlite_master WHERE type ='view';
Run Code Online (Sandbox Code Playgroud)
但我想找到特定表的所有可用视图.我怎么做 ?
我是python的新手,我试图在这里理解一个基本的错误.我得到一个TypeError:'list'对象在下面的代码中不是可调用的错误.有人可以解释一下我的代码中有什么问题吗?
graph = {'a': ['b', 'c'], 'b': ['a', 'c'], 'c': ['b', 'd'], 'd': ['a'], 'e': ['a']}
def reachable(graph, node):
res = [node]
reachable = graph[node]
for currentnode in reachable:
if currentnode not in res :
reachableNodes = reachable(graph,currentnode) << TypeError:
for newNode in reachableNodes:
if newNode not in res :
res.append(newNode)
return res
Run Code Online (Sandbox Code Playgroud)
错误:TypeError:'list'对象不可调用错误