@@ -33,11 +33,13 @@ const parseToolResponse = (response: any) => {
3333describe ( 'execute-sql tool' , ( ) => {
3434 let mockConnector : Connector ;
3535 const mockGetCurrentConnector = vi . mocked ( ConnectorManager . getCurrentConnector ) ;
36+ const mockGetCurrentExecuteOptions = vi . mocked ( ConnectorManager . getCurrentExecuteOptions ) ;
3637 const mockIsReadOnlyMode = vi . mocked ( isReadOnlyMode ) ;
3738
3839 beforeEach ( ( ) => {
3940 mockConnector = createMockConnector ( 'sqlite' ) ;
4041 mockGetCurrentConnector . mockReturnValue ( mockConnector ) ;
42+ mockGetCurrentExecuteOptions . mockReturnValue ( { } ) ;
4143 mockIsReadOnlyMode . mockReturnValue ( false ) ;
4244 } ) ;
4345
@@ -56,7 +58,7 @@ describe('execute-sql tool', () => {
5658 expect ( parsedResult . success ) . toBe ( true ) ;
5759 expect ( parsedResult . data . rows ) . toEqual ( [ { id : 1 , name : 'test' } ] ) ;
5860 expect ( parsedResult . data . count ) . toBe ( 1 ) ;
59- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( 'SELECT * FROM users' ) ;
61+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( 'SELECT * FROM users' , { } ) ;
6062 } ) ;
6163
6264 it ( 'should handle execution errors' , async ( ) => {
@@ -82,7 +84,7 @@ describe('execute-sql tool', () => {
8284 const parsedResult = parseToolResponse ( result ) ;
8385
8486 expect ( parsedResult . success ) . toBe ( true ) ;
85- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
87+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
8688 } ) ;
8789 } ) ;
8890
@@ -111,7 +113,7 @@ describe('execute-sql tool', () => {
111113 const parsedResult = parseToolResponse ( result ) ;
112114
113115 expect ( parsedResult . success ) . toBe ( true ) ;
114- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
116+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
115117 } ) ;
116118
117119 it ( 'should reject single INSERT statement in read-only mode' , async ( ) => {
@@ -150,7 +152,7 @@ describe('execute-sql tool', () => {
150152 const parsedResult = parseToolResponse ( result ) ;
151153
152154 expect ( parsedResult . success ) . toBe ( true ) ;
153- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
155+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
154156 } ) ;
155157
156158 it ( 'should allow SELECT with multi-line comment in read-only mode' , async ( ) => {
@@ -163,7 +165,7 @@ describe('execute-sql tool', () => {
163165 const parsedResult = parseToolResponse ( result ) ;
164166
165167 expect ( parsedResult . success ) . toBe ( true ) ;
166- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
168+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
167169 } ) ;
168170
169171 it ( 'should handle multiple statements with comments in read-only mode' , async ( ) => {
@@ -176,7 +178,7 @@ describe('execute-sql tool', () => {
176178 const parsedResult = parseToolResponse ( result ) ;
177179
178180 expect ( parsedResult . success ) . toBe ( true ) ;
179- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
181+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
180182 } ) ;
181183
182184 it ( 'should reject INSERT with comment in read-only mode' , async ( ) => {
@@ -202,7 +204,7 @@ describe('execute-sql tool', () => {
202204 const parsedResult = parseToolResponse ( result ) ;
203205
204206 expect ( parsedResult . success ) . toBe ( true ) ;
205- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
207+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
206208 } ) ;
207209
208210 it ( 'should handle inline comments correctly' , async ( ) => {
@@ -215,7 +217,7 @@ describe('execute-sql tool', () => {
215217 const parsedResult = parseToolResponse ( result ) ;
216218
217219 expect ( parsedResult . success ) . toBe ( true ) ;
218- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql ) ;
220+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( sql , { } ) ;
219221 } ) ;
220222 } ) ;
221223
@@ -229,7 +231,7 @@ describe('execute-sql tool', () => {
229231 const parsedResult = parseToolResponse ( result ) ;
230232
231233 expect ( parsedResult . success ) . toBe ( true ) ;
232- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( '' ) ;
234+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( '' , { } ) ;
233235 } ) ;
234236
235237 it ( 'should handle SQL with only semicolons and whitespace' , async ( ) => {
@@ -240,7 +242,7 @@ describe('execute-sql tool', () => {
240242 const parsedResult = parseToolResponse ( result ) ;
241243
242244 expect ( parsedResult . success ) . toBe ( true ) ;
243- expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( ' ; ; ; ' ) ;
245+ expect ( mockConnector . executeSQL ) . toHaveBeenCalledWith ( ' ; ; ; ' , { } ) ;
244246 } ) ;
245247 } ) ;
246248} ) ;
0 commit comments