@@ -10,6 +10,12 @@ describe('DriverCapabilitiesSchema', () => {
1010 it ( 'should accept valid capabilities' , ( ) => {
1111 const capabilities : DriverCapabilities = {
1212 transactions : true ,
13+ queryFilters : true ,
14+ queryAggregations : true ,
15+ querySorting : true ,
16+ queryPagination : true ,
17+ queryWindowFunctions : true ,
18+ querySubqueries : true ,
1319 joins : true ,
1420 fullTextSearch : true ,
1521 jsonFields : true ,
@@ -22,6 +28,12 @@ describe('DriverCapabilitiesSchema', () => {
2228 it ( 'should accept minimal capabilities' , ( ) => {
2329 const capabilities : DriverCapabilities = {
2430 transactions : false ,
31+ queryFilters : false ,
32+ queryAggregations : false ,
33+ querySorting : false ,
34+ queryPagination : false ,
35+ queryWindowFunctions : false ,
36+ querySubqueries : false ,
2537 joins : false ,
2638 fullTextSearch : false ,
2739 jsonFields : false ,
@@ -35,6 +47,7 @@ describe('DriverCapabilitiesSchema', () => {
3547 const incomplete = {
3648 transactions : true ,
3749 joins : true ,
50+ queryFilters : true ,
3851 // missing other fields
3952 } ;
4053
@@ -79,6 +92,12 @@ describe('DriverInterfaceSchema', () => {
7992 dropTable : async ( ) => { } ,
8093 supports : {
8194 transactions : true ,
95+ queryFilters : true ,
96+ queryAggregations : true ,
97+ querySorting : true ,
98+ queryPagination : true ,
99+ queryWindowFunctions : true ,
100+ querySubqueries : true ,
82101 joins : true ,
83102 fullTextSearch : true ,
84103 jsonFields : true ,
@@ -114,6 +133,12 @@ describe('DriverInterfaceSchema', () => {
114133 dropTable : async ( object : string ) => { } ,
115134 supports : {
116135 transactions : false ,
136+ queryFilters : false ,
137+ queryAggregations : false ,
138+ querySorting : false ,
139+ queryPagination : false ,
140+ queryWindowFunctions : false ,
141+ querySubqueries : false ,
117142 joins : false ,
118143 fullTextSearch : false ,
119144 jsonFields : false ,
@@ -212,6 +237,12 @@ describe('DriverInterfaceSchema', () => {
212237 dropTable : async ( ) => { } ,
213238 supports : {
214239 transactions : false ,
240+ queryFilters : false ,
241+ queryAggregations : false ,
242+ querySorting : false ,
243+ queryPagination : false ,
244+ queryWindowFunctions : false ,
245+ querySubqueries : false ,
215246 joins : false ,
216247 fullTextSearch : false ,
217248 jsonFields : false ,
@@ -285,6 +316,12 @@ describe('DriverInterfaceSchema', () => {
285316 dropTable : async ( ) => { } ,
286317 supports : {
287318 transactions : false ,
319+ queryFilters : false ,
320+ queryAggregations : false ,
321+ querySorting : false ,
322+ queryPagination : false ,
323+ queryWindowFunctions : false ,
324+ querySubqueries : false ,
288325 joins : false ,
289326 fullTextSearch : false ,
290327 jsonFields : false ,
@@ -341,6 +378,12 @@ describe('DriverInterfaceSchema', () => {
341378 dropTable : async ( ) => { } ,
342379 supports : {
343380 transactions : false ,
381+ queryFilters : false ,
382+ queryAggregations : false ,
383+ querySorting : false ,
384+ queryPagination : false ,
385+ queryWindowFunctions : false ,
386+ querySubqueries : false ,
344387 joins : false ,
345388 fullTextSearch : false ,
346389 jsonFields : false ,
@@ -375,6 +418,12 @@ describe('DriverInterfaceSchema', () => {
375418 dropTable : async ( ) => { } ,
376419 supports : {
377420 transactions : true ,
421+ queryFilters : true ,
422+ queryAggregations : true ,
423+ querySorting : true ,
424+ queryPagination : true ,
425+ queryWindowFunctions : false ,
426+ querySubqueries : true ,
378427 joins : true ,
379428 fullTextSearch : false ,
380429 jsonFields : true ,
@@ -411,6 +460,12 @@ describe('DriverInterfaceSchema', () => {
411460 dropTable : async ( object ) => { } ,
412461 supports : {
413462 transactions : true ,
463+ queryFilters : true ,
464+ queryAggregations : true ,
465+ querySorting : true ,
466+ queryPagination : true ,
467+ queryWindowFunctions : true ,
468+ querySubqueries : true ,
414469 joins : true ,
415470 fullTextSearch : true ,
416471 jsonFields : true ,
@@ -445,6 +500,12 @@ describe('DriverInterfaceSchema', () => {
445500 dropTable : async ( object ) => { } ,
446501 supports : {
447502 transactions : true ,
503+ queryFilters : true ,
504+ queryAggregations : true ,
505+ querySorting : true ,
506+ queryPagination : true ,
507+ queryWindowFunctions : false , // MongoDB has limited window function support
508+ querySubqueries : true ,
448509 joins : false , // MongoDB has limited join support
449510 fullTextSearch : true ,
450511 jsonFields : true , // Native JSON support
@@ -479,6 +540,12 @@ describe('DriverInterfaceSchema', () => {
479540 dropTable : async ( object ) => { } ,
480541 supports : {
481542 transactions : false , // Salesforce doesn't support transactions
543+ queryFilters : true , // SOQL WHERE clause
544+ queryAggregations : true , // SOQL GROUP BY
545+ querySorting : true , // SOQL ORDER BY
546+ queryPagination : true , // SOQL LIMIT/OFFSET
547+ queryWindowFunctions : false , // No window functions
548+ querySubqueries : true , // SOQL supports subqueries
482549 joins : true , // SOQL supports relationships
483550 fullTextSearch : true , // SOSL
484551 jsonFields : false , // No native JSON type
@@ -513,6 +580,12 @@ describe('DriverInterfaceSchema', () => {
513580 dropTable : async ( object ) => { } ,
514581 supports : {
515582 transactions : true , // Redis supports transactions
583+ queryFilters : false , // Limited query support - key-based lookup
584+ queryAggregations : false , // No aggregation support
585+ querySorting : false , // No native sorting
586+ queryPagination : false , // No pagination support
587+ queryWindowFunctions : false , // No window functions
588+ querySubqueries : false , // No subqueries
516589 joins : false , // No join support
517590 fullTextSearch : false , // No native full-text search
518591 jsonFields : true , // RedisJSON module
@@ -522,5 +595,45 @@ describe('DriverInterfaceSchema', () => {
522595
523596 expect ( ( ) => DriverInterfaceSchema . parse ( redisDriver ) ) . not . toThrow ( ) ;
524597 } ) ;
598+
599+ it ( 'should accept memory-like driver with limited query support' , ( ) => {
600+ const memoryDriver : DriverInterface = {
601+ name : 'memory' ,
602+ version : '1.0.0' ,
603+ connect : async ( ) => { } ,
604+ disconnect : async ( ) => { } ,
605+ checkHealth : async ( ) => true ,
606+ execute : async ( ) => ( { } ) ,
607+ find : async ( object , query ) => [ ] ,
608+ findOne : async ( object , query ) => null ,
609+ create : async ( object , data ) => data ,
610+ update : async ( object , id , data ) => data ,
611+ delete : async ( object , id ) => true ,
612+ count : async ( ) => 0 ,
613+ bulkCreate : async ( object , data ) => data ,
614+ bulkUpdate : async ( object , updates ) => updates ,
615+ bulkDelete : async ( object , ids ) => { } ,
616+ beginTransaction : async ( ) => ( { } ) ,
617+ commit : async ( tx ) => { } ,
618+ rollback : async ( tx ) => { } ,
619+ syncSchema : async ( object , schema ) => { } ,
620+ dropTable : async ( object ) => { } ,
621+ supports : {
622+ transactions : false , // No transactions in memory
623+ queryFilters : false , // Memory driver doesn't support query conditions - all filtering done in-memory
624+ queryAggregations : false , // No aggregation support
625+ querySorting : false , // No native sorting
626+ queryPagination : false , // No pagination support
627+ queryWindowFunctions : false , // No window functions
628+ querySubqueries : false , // No subqueries
629+ joins : false , // No join support - joins done in-memory
630+ fullTextSearch : false , // No full-text search
631+ jsonFields : true , // Memory can store any type
632+ arrayFields : true , // Memory can store any type
633+ } ,
634+ } ;
635+
636+ expect ( ( ) => DriverInterfaceSchema . parse ( memoryDriver ) ) . not . toThrow ( ) ;
637+ } ) ;
525638 } ) ;
526639} ) ;
0 commit comments