@@ -53,7 +53,7 @@ describe('execute-sql tool', () => {
5353
5454 describe ( 'basic execution' , ( ) => {
5555 it ( 'should execute SELECT and return rows' , async ( ) => {
56- const mockResult : SQLResult = { rows : [ { id : 1 , name : 'test' } ] } ;
56+ const mockResult : SQLResult = { rows : [ { id : 1 , name : 'test' } ] , rowCount : 1 } ;
5757 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
5858
5959 const handler = createExecuteSqlToolHandler ( 'test_source' ) ;
@@ -67,7 +67,7 @@ describe('execute-sql tool', () => {
6767 } ) ;
6868
6969 it ( 'should pass multi-statement SQL directly to connector' , async ( ) => {
70- const mockResult : SQLResult = { rows : [ { id : 1 } ] } ;
70+ const mockResult : SQLResult = { rows : [ { id : 1 } ] , rowCount : 1 } ;
7171 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
7272
7373 const sql = 'SELECT * FROM users; SELECT * FROM roles;' ;
@@ -102,7 +102,7 @@ describe('execute-sql tool', () => {
102102 } ) ;
103103
104104 it ( 'should allow SELECT statements' , async ( ) => {
105- const mockResult : SQLResult = { rows : [ { id : 1 } ] } ;
105+ const mockResult : SQLResult = { rows : [ { id : 1 } ] , rowCount : 1 } ;
106106 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
107107
108108 const handler = createExecuteSqlToolHandler ( 'test_source' ) ;
@@ -114,7 +114,7 @@ describe('execute-sql tool', () => {
114114 } ) ;
115115
116116 it ( 'should allow multiple read-only statements' , async ( ) => {
117- const mockResult : SQLResult = { rows : [ ] } ;
117+ const mockResult : SQLResult = { rows : [ ] , rowCount : 0 } ;
118118 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
119119
120120 const sql = 'SELECT * FROM users; SELECT * FROM roles;' ;
@@ -173,7 +173,7 @@ describe('execute-sql tool', () => {
173173 mockGetToolRegistry . mockReturnValue ( {
174174 getBuiltinToolConfig : vi . fn ( ) . mockReturnValue ( toolConfig ) ,
175175 } as any ) ;
176- const mockResult : SQLResult = { rows : [ ] } ;
176+ const mockResult : SQLResult = { rows : [ ] , rowCount : 0 } ;
177177 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
178178
179179 const handler = createExecuteSqlToolHandler ( 'writable_source' ) ;
@@ -208,7 +208,7 @@ describe('execute-sql tool', () => {
208208 [ 'inline comments' , 'SELECT id, -- user id\n name FROM users' ] ,
209209 [ 'only comments' , '-- Just a comment\n/* Another */' ] ,
210210 ] ) ( 'should allow SELECT with %s' , async ( _ , sql ) => {
211- const mockResult : SQLResult = { rows : [ ] } ;
211+ const mockResult : SQLResult = { rows : [ ] , rowCount : 0 } ;
212212 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
213213
214214 const handler = createExecuteSqlToolHandler ( 'test_source' ) ;
@@ -231,7 +231,7 @@ describe('execute-sql tool', () => {
231231 [ 'empty string' , '' ] ,
232232 [ 'only semicolons and whitespace' , ' ; ; ; ' ] ,
233233 ] ) ( 'should handle %s' , async ( _ , sql ) => {
234- const mockResult : SQLResult = { rows : [ ] } ;
234+ const mockResult : SQLResult = { rows : [ ] , rowCount : 0 } ;
235235 vi . mocked ( mockConnector . executeSQL ) . mockResolvedValue ( mockResult ) ;
236236
237237 const handler = createExecuteSqlToolHandler ( 'test_source' ) ;
0 commit comments