MCPcopy Create free account
hub / github.com/2234839/mcpserver / executeSQLQuery

Function executeSQLQuery

src/tools/siyuan/sql-query.ts:14–33  ·  view source on GitHub ↗
(stmt: string)

Source from the content-addressed store, hash-verified

12
13// 执行 SQL 查询的函数
14export async function executeSQLQuery(stmt: string) {
15 try {
16 const result = await makeSiYuanRequest<SQLQueryResult>({
17 endpoint: 'query/sql',
18 data: { stmt },
19 });
20
21 return result;
22 } catch (error) {
23 logger.error('SQL query execution failed', { stmt, error });
24 return {
25 results: {
26 results: {},
27 },
28 success: false,
29 error: error instanceof Error ? error.message : String(error),
30 query: stmt,
31 };
32 }
33}
34
35// 注册 SQL 查询工具
36// 作者:Frostime

Callers 1

registerSQLQueryToolFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected