Skip to content

Commit 628fb75

Browse files
authored
Merge pull request #49 from objectstack-ai/copilot/document-driver-capabilities
2 parents 64e275e + 7767187 commit 628fb75

File tree

11 files changed

+365
-28
lines changed

11 files changed

+365
-28
lines changed

content/docs/references/system/DriverCapabilities.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ description: DriverCapabilities Schema Reference
88
| Property | Type | Required | Description |
99
| :--- | :--- | :--- | :--- |
1010
| **transactions** | `boolean` || Supports transactions |
11+
| **queryFilters** | `boolean` || Supports WHERE clause filtering |
12+
| **queryAggregations** | `boolean` || Supports GROUP BY and aggregation functions |
13+
| **querySorting** | `boolean` || Supports ORDER BY sorting |
14+
| **queryPagination** | `boolean` || Supports LIMIT/OFFSET pagination |
15+
| **queryWindowFunctions** | `boolean` || Supports window functions with OVER clause |
16+
| **querySubqueries** | `boolean` || Supports subqueries |
1117
| **joins** | `boolean` || Supports SQL joins |
1218
| **fullTextSearch** | `boolean` || Supports full-text search |
1319
| **jsonFields** | `boolean` || Supports JSON field types |

content/docs/references/system/integration/DatasourceCapabilities.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ description: DatasourceCapabilities Schema Reference
77

88
| Property | Type | Required | Description |
99
| :--- | :--- | :--- | :--- |
10-
| **joins** | `boolean` | optional | |
1110
| **transactions** | `boolean` | optional | |
11+
| **queryFilters** | `boolean` | optional | |
12+
| **queryAggregations** | `boolean` | optional | |
13+
| **querySorting** | `boolean` | optional | |
14+
| **queryPagination** | `boolean` | optional | |
15+
| **queryWindowFunctions** | `boolean` | optional | |
16+
| **querySubqueries** | `boolean` | optional | |
17+
| **joins** | `boolean` | optional | |
1218
| **fullTextSearch** | `boolean` | optional | |
13-
| **aggregation** | `boolean` | optional | |
14-
| **dynamicSchema** | `boolean` | optional | |
1519
| **readOnly** | `boolean` | optional | |
20+
| **dynamicSchema** | `boolean` | optional | |

packages/driver-memory/src/memory-driver.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,22 @@ export class InMemoryDriver implements DriverInterface {
2323
}
2424

2525
supports = {
26+
// Transaction & Connection Management
2627
transactions: false,
27-
joins: false,
28-
fullTextSearch: false,
29-
jsonFields: true,
30-
arrayFields: true,
28+
29+
// Query Operations
30+
queryFilters: false, // TODO: Not implemented - basic find() doesn't handle filters
31+
queryAggregations: false, // TODO: Not implemented - count() only returns total
32+
querySorting: false, // TODO: Not implemented - find() doesn't handle sorting
33+
queryPagination: true, // Basic pagination via 'top' is implemented
34+
queryWindowFunctions: false, // TODO: Not implemented
35+
querySubqueries: false, // TODO: Not implemented
36+
joins: false, // TODO: Not implemented
37+
38+
// Advanced Features
39+
fullTextSearch: false, // TODO: Not implemented
40+
jsonFields: true, // Native JS object support
41+
arrayFields: true, // Native JS array support
3142
};
3243

3344
/**

packages/spec/json-schema/Datasource.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,49 @@
2525
"capabilities": {
2626
"type": "object",
2727
"properties": {
28-
"joins": {
28+
"transactions": {
2929
"type": "boolean",
3030
"default": false
3131
},
32-
"transactions": {
32+
"queryFilters": {
3333
"type": "boolean",
3434
"default": false
3535
},
36-
"fullTextSearch": {
36+
"queryAggregations": {
3737
"type": "boolean",
3838
"default": false
3939
},
40-
"aggregation": {
40+
"querySorting": {
4141
"type": "boolean",
4242
"default": false
4343
},
44-
"dynamicSchema": {
44+
"queryPagination": {
45+
"type": "boolean",
46+
"default": false
47+
},
48+
"queryWindowFunctions": {
49+
"type": "boolean",
50+
"default": false
51+
},
52+
"querySubqueries": {
53+
"type": "boolean",
54+
"default": false
55+
},
56+
"joins": {
57+
"type": "boolean",
58+
"default": false
59+
},
60+
"fullTextSearch": {
4561
"type": "boolean",
4662
"default": false
4763
},
4864
"readOnly": {
4965
"type": "boolean",
5066
"default": false
67+
},
68+
"dynamicSchema": {
69+
"type": "boolean",
70+
"default": false
5171
}
5272
},
5373
"additionalProperties": false,

packages/spec/json-schema/DatasourceCapabilities.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,49 @@
44
"DatasourceCapabilities": {
55
"type": "object",
66
"properties": {
7-
"joins": {
7+
"transactions": {
88
"type": "boolean",
99
"default": false
1010
},
11-
"transactions": {
11+
"queryFilters": {
1212
"type": "boolean",
1313
"default": false
1414
},
15-
"fullTextSearch": {
15+
"queryAggregations": {
1616
"type": "boolean",
1717
"default": false
1818
},
19-
"aggregation": {
19+
"querySorting": {
2020
"type": "boolean",
2121
"default": false
2222
},
23-
"dynamicSchema": {
23+
"queryPagination": {
24+
"type": "boolean",
25+
"default": false
26+
},
27+
"queryWindowFunctions": {
28+
"type": "boolean",
29+
"default": false
30+
},
31+
"querySubqueries": {
32+
"type": "boolean",
33+
"default": false
34+
},
35+
"joins": {
36+
"type": "boolean",
37+
"default": false
38+
},
39+
"fullTextSearch": {
2440
"type": "boolean",
2541
"default": false
2642
},
2743
"readOnly": {
2844
"type": "boolean",
2945
"default": false
46+
},
47+
"dynamicSchema": {
48+
"type": "boolean",
49+
"default": false
3050
}
3151
},
3252
"additionalProperties": false

packages/spec/json-schema/DriverCapabilities.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@
88
"type": "boolean",
99
"description": "Supports transactions"
1010
},
11+
"queryFilters": {
12+
"type": "boolean",
13+
"description": "Supports WHERE clause filtering"
14+
},
15+
"queryAggregations": {
16+
"type": "boolean",
17+
"description": "Supports GROUP BY and aggregation functions"
18+
},
19+
"querySorting": {
20+
"type": "boolean",
21+
"description": "Supports ORDER BY sorting"
22+
},
23+
"queryPagination": {
24+
"type": "boolean",
25+
"description": "Supports LIMIT/OFFSET pagination"
26+
},
27+
"queryWindowFunctions": {
28+
"type": "boolean",
29+
"description": "Supports window functions with OVER clause"
30+
},
31+
"querySubqueries": {
32+
"type": "boolean",
33+
"description": "Supports subqueries"
34+
},
1135
"joins": {
1236
"type": "boolean",
1337
"description": "Supports SQL joins"
@@ -27,6 +51,12 @@
2751
},
2852
"required": [
2953
"transactions",
54+
"queryFilters",
55+
"queryAggregations",
56+
"querySorting",
57+
"queryPagination",
58+
"queryWindowFunctions",
59+
"querySubqueries",
3060
"joins",
3161
"fullTextSearch",
3262
"jsonFields",

packages/spec/json-schema/DriverDefinition.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,49 @@
2626
"capabilities": {
2727
"type": "object",
2828
"properties": {
29-
"joins": {
29+
"transactions": {
3030
"type": "boolean",
3131
"default": false
3232
},
33-
"transactions": {
33+
"queryFilters": {
3434
"type": "boolean",
3535
"default": false
3636
},
37-
"fullTextSearch": {
37+
"queryAggregations": {
3838
"type": "boolean",
3939
"default": false
4040
},
41-
"aggregation": {
41+
"querySorting": {
4242
"type": "boolean",
4343
"default": false
4444
},
45-
"dynamicSchema": {
45+
"queryPagination": {
46+
"type": "boolean",
47+
"default": false
48+
},
49+
"queryWindowFunctions": {
50+
"type": "boolean",
51+
"default": false
52+
},
53+
"querySubqueries": {
54+
"type": "boolean",
55+
"default": false
56+
},
57+
"joins": {
58+
"type": "boolean",
59+
"default": false
60+
},
61+
"fullTextSearch": {
4662
"type": "boolean",
4763
"default": false
4864
},
4965
"readOnly": {
5066
"type": "boolean",
5167
"default": false
68+
},
69+
"dynamicSchema": {
70+
"type": "boolean",
71+
"default": false
5272
}
5373
},
5474
"additionalProperties": false

packages/spec/json-schema/DriverInterface.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,30 @@
1919
"type": "boolean",
2020
"description": "Supports transactions"
2121
},
22+
"queryFilters": {
23+
"type": "boolean",
24+
"description": "Supports WHERE clause filtering"
25+
},
26+
"queryAggregations": {
27+
"type": "boolean",
28+
"description": "Supports GROUP BY and aggregation functions"
29+
},
30+
"querySorting": {
31+
"type": "boolean",
32+
"description": "Supports ORDER BY sorting"
33+
},
34+
"queryPagination": {
35+
"type": "boolean",
36+
"description": "Supports LIMIT/OFFSET pagination"
37+
},
38+
"queryWindowFunctions": {
39+
"type": "boolean",
40+
"description": "Supports window functions with OVER clause"
41+
},
42+
"querySubqueries": {
43+
"type": "boolean",
44+
"description": "Supports subqueries"
45+
},
2246
"joins": {
2347
"type": "boolean",
2448
"description": "Supports SQL joins"
@@ -38,6 +62,12 @@
3862
},
3963
"required": [
4064
"transactions",
65+
"queryFilters",
66+
"queryAggregations",
67+
"querySorting",
68+
"queryPagination",
69+
"queryWindowFunctions",
70+
"querySubqueries",
4171
"joins",
4272
"fullTextSearch",
4373
"jsonFields",

packages/spec/src/system/datasource.zod.ts

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,50 @@ export const DriverDefinitionSchema = z.object({
5151
* and what to compute in memory.
5252
*/
5353
export const DatasourceCapabilities = z.object({
54-
/** Can execute SQL-like joins natively? */
55-
joins: z.boolean().default(false),
54+
// ============================================================================
55+
// Transaction & Connection Management
56+
// ============================================================================
57+
5658
/** Can handle ACID transactions? */
5759
transactions: z.boolean().default(false),
60+
61+
// ============================================================================
62+
// Query Operations
63+
// ============================================================================
64+
65+
/** Can execute WHERE clause filters natively? */
66+
queryFilters: z.boolean().default(false),
67+
68+
/** Can perform aggregation (group by, sum, avg)? */
69+
queryAggregations: z.boolean().default(false),
70+
71+
/** Can perform ORDER BY sorting? */
72+
querySorting: z.boolean().default(false),
73+
74+
/** Can perform LIMIT/OFFSET pagination? */
75+
queryPagination: z.boolean().default(false),
76+
77+
/** Can perform window functions? */
78+
queryWindowFunctions: z.boolean().default(false),
79+
80+
/** Can perform subqueries? */
81+
querySubqueries: z.boolean().default(false),
82+
83+
/** Can execute SQL-like joins natively? */
84+
joins: z.boolean().default(false),
85+
86+
// ============================================================================
87+
// Advanced Features
88+
// ============================================================================
89+
5890
/** Can perform full-text search? */
5991
fullTextSearch: z.boolean().default(false),
60-
/** Can perform aggregation (group by, sum, avg)? */
61-
aggregation: z.boolean().default(false),
62-
/** Is scheme-less (needs schema inference)? */
63-
dynamicSchema: z.boolean().default(false),
92+
6493
/** Is read-only? */
6594
readOnly: z.boolean().default(false),
95+
96+
/** Is scheme-less (needs schema inference)? */
97+
dynamicSchema: z.boolean().default(false),
6698
});
6799

68100
/**

0 commit comments

Comments
 (0)