MCPcopy Index your code
hub / github.com/bytebase/dbhub / areAllStatementsReadOnly

Function areAllStatementsReadOnly

src/tools/execute-sql.ts:26–29  ·  view source on GitHub ↗

* Check if all SQL statements in a multi-statement query are read-only * @param sql The SQL string (possibly containing multiple statements) * @param connectorType The database type to check against * @returns True if all statements are read-only

(sql: string, connectorType: ConnectorType)

Source from the content-addressed store, hash-verified

24 * @returns True if all statements are read-only
25 */
26function areAllStatementsReadOnly(sql: string, connectorType: ConnectorType): boolean {
27 const statements = splitSQLStatements(sql, connectorType);
28 return statements.every(statement => isReadOnlySQL(statement, connectorType));
29}
30
31/**
32 * Create an execute_sql tool handler for a specific source

Callers 1

Calls 2

splitSQLStatementsFunction · 0.85
isReadOnlySQLFunction · 0.85

Tested by

no test coverage detected