Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/docs/references/system/DriverCapabilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ description: DriverCapabilities Schema Reference
| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **transactions** | `boolean` | ✅ | Supports transactions |
| **queryFilters** | `boolean` | ✅ | Supports WHERE clause filtering |
| **queryAggregations** | `boolean` | ✅ | Supports GROUP BY and aggregation functions |
| **querySorting** | `boolean` | ✅ | Supports ORDER BY sorting |
| **queryPagination** | `boolean` | ✅ | Supports LIMIT/OFFSET pagination |
| **queryWindowFunctions** | `boolean` | ✅ | Supports window functions with OVER clause |
| **querySubqueries** | `boolean` | ✅ | Supports subqueries |
| **joins** | `boolean` | ✅ | Supports SQL joins |
| **fullTextSearch** | `boolean` | ✅ | Supports full-text search |
| **jsonFields** | `boolean` | ✅ | Supports JSON field types |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ description: DatasourceCapabilities Schema Reference

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **joins** | `boolean` | optional | |
| **transactions** | `boolean` | optional | |
| **queryFilters** | `boolean` | optional | |
| **queryAggregations** | `boolean` | optional | |
| **querySorting** | `boolean` | optional | |
| **queryPagination** | `boolean` | optional | |
| **queryWindowFunctions** | `boolean` | optional | |
| **querySubqueries** | `boolean` | optional | |
| **joins** | `boolean` | optional | |
| **fullTextSearch** | `boolean` | optional | |
| **aggregation** | `boolean` | optional | |
| **dynamicSchema** | `boolean` | optional | |
| **readOnly** | `boolean` | optional | |
| **dynamicSchema** | `boolean` | optional | |
19 changes: 15 additions & 4 deletions packages/driver-memory/src/memory-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ export class InMemoryDriver implements DriverInterface {
}

supports = {
// Transaction & Connection Management
transactions: false,
joins: false,
fullTextSearch: false,
jsonFields: true,
arrayFields: true,

// Query Operations
queryFilters: false, // TODO: Not implemented - basic find() doesn't handle filters
queryAggregations: false, // TODO: Not implemented - count() only returns total
querySorting: false, // TODO: Not implemented - find() doesn't handle sorting
queryPagination: true, // Basic pagination via 'top' is implemented
queryWindowFunctions: false, // TODO: Not implemented
querySubqueries: false, // TODO: Not implemented
joins: false, // TODO: Not implemented

// Advanced Features
fullTextSearch: false, // TODO: Not implemented
jsonFields: true, // Native JS object support
arrayFields: true, // Native JS array support
};

/**
Expand Down
30 changes: 25 additions & 5 deletions packages/spec/json-schema/Datasource.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,49 @@
"capabilities": {
"type": "object",
"properties": {
"joins": {
"transactions": {
"type": "boolean",
"default": false
},
"transactions": {
"queryFilters": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"queryAggregations": {
"type": "boolean",
"default": false
},
"aggregation": {
"querySorting": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"queryPagination": {
"type": "boolean",
"default": false
},
"queryWindowFunctions": {
"type": "boolean",
"default": false
},
"querySubqueries": {
"type": "boolean",
"default": false
},
"joins": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"type": "boolean",
"default": false
},
"readOnly": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false,
Expand Down
30 changes: 25 additions & 5 deletions packages/spec/json-schema/DatasourceCapabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,49 @@
"DatasourceCapabilities": {
"type": "object",
"properties": {
"joins": {
"transactions": {
"type": "boolean",
"default": false
},
"transactions": {
"queryFilters": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"queryAggregations": {
"type": "boolean",
"default": false
},
"aggregation": {
"querySorting": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"queryPagination": {
"type": "boolean",
"default": false
},
"queryWindowFunctions": {
"type": "boolean",
"default": false
},
"querySubqueries": {
"type": "boolean",
"default": false
},
"joins": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"type": "boolean",
"default": false
},
"readOnly": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down
30 changes: 30 additions & 0 deletions packages/spec/json-schema/DriverCapabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,30 @@
"type": "boolean",
"description": "Supports transactions"
},
"queryFilters": {
"type": "boolean",
"description": "Supports WHERE clause filtering"
},
"queryAggregations": {
"type": "boolean",
"description": "Supports GROUP BY and aggregation functions"
},
"querySorting": {
"type": "boolean",
"description": "Supports ORDER BY sorting"
},
"queryPagination": {
"type": "boolean",
"description": "Supports LIMIT/OFFSET pagination"
},
"queryWindowFunctions": {
"type": "boolean",
"description": "Supports window functions with OVER clause"
},
"querySubqueries": {
"type": "boolean",
"description": "Supports subqueries"
},
"joins": {
"type": "boolean",
"description": "Supports SQL joins"
Expand All @@ -27,6 +51,12 @@
},
"required": [
"transactions",
"queryFilters",
"queryAggregations",
"querySorting",
"queryPagination",
"queryWindowFunctions",
"querySubqueries",
"joins",
"fullTextSearch",
"jsonFields",
Expand Down
30 changes: 25 additions & 5 deletions packages/spec/json-schema/DriverDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,49 @@
"capabilities": {
"type": "object",
"properties": {
"joins": {
"transactions": {
"type": "boolean",
"default": false
},
"transactions": {
"queryFilters": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"queryAggregations": {
"type": "boolean",
"default": false
},
"aggregation": {
"querySorting": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"queryPagination": {
"type": "boolean",
"default": false
},
"queryWindowFunctions": {
"type": "boolean",
"default": false
},
"querySubqueries": {
"type": "boolean",
"default": false
},
"joins": {
"type": "boolean",
"default": false
},
"fullTextSearch": {
"type": "boolean",
"default": false
},
"readOnly": {
"type": "boolean",
"default": false
},
"dynamicSchema": {
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down
30 changes: 30 additions & 0 deletions packages/spec/json-schema/DriverInterface.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@
"type": "boolean",
"description": "Supports transactions"
},
"queryFilters": {
"type": "boolean",
"description": "Supports WHERE clause filtering"
},
"queryAggregations": {
"type": "boolean",
"description": "Supports GROUP BY and aggregation functions"
},
"querySorting": {
"type": "boolean",
"description": "Supports ORDER BY sorting"
},
"queryPagination": {
"type": "boolean",
"description": "Supports LIMIT/OFFSET pagination"
},
"queryWindowFunctions": {
"type": "boolean",
"description": "Supports window functions with OVER clause"
},
"querySubqueries": {
"type": "boolean",
"description": "Supports subqueries"
},
"joins": {
"type": "boolean",
"description": "Supports SQL joins"
Expand All @@ -38,6 +62,12 @@
},
"required": [
"transactions",
"queryFilters",
"queryAggregations",
"querySorting",
"queryPagination",
"queryWindowFunctions",
"querySubqueries",
"joins",
"fullTextSearch",
"jsonFields",
Expand Down
44 changes: 38 additions & 6 deletions packages/spec/src/system/datasource.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,50 @@ export const DriverDefinitionSchema = z.object({
* and what to compute in memory.
*/
export const DatasourceCapabilities = z.object({
/** Can execute SQL-like joins natively? */
joins: z.boolean().default(false),
// ============================================================================
// Transaction & Connection Management
// ============================================================================

/** Can handle ACID transactions? */
transactions: z.boolean().default(false),

// ============================================================================
// Query Operations
// ============================================================================

/** Can execute WHERE clause filters natively? */
queryFilters: z.boolean().default(false),

Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the aggregation capability field and its replacement with queryAggregations is a breaking change. While this rename provides better clarity and consistency with the new query capability naming scheme, any existing code that references capabilities.aggregation will break.

Consider:

  1. Adding a migration guide or deprecation notice in the PR description
  2. If backwards compatibility is required, temporarily supporting both field names with the old one marked as deprecated
  3. Documenting this breaking change in a CHANGELOG or migration guide
Suggested change
/**
* @deprecated Use `queryAggregations` instead.
* Legacy aggregation capability flag kept for backwards compatibility.
*/
aggregation: z.boolean().default(false).describe('Deprecated: use queryAggregations'),

Copilot uses AI. Check for mistakes.
/** Can perform aggregation (group by, sum, avg)? */
queryAggregations: z.boolean().default(false),

/** Can perform ORDER BY sorting? */
querySorting: z.boolean().default(false),

/** Can perform LIMIT/OFFSET pagination? */
queryPagination: z.boolean().default(false),

/** Can perform window functions? */
queryWindowFunctions: z.boolean().default(false),

/** Can perform subqueries? */
querySubqueries: z.boolean().default(false),
Comment on lines +65 to +81
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new query capability fields in DatasourceCapabilities lack .describe() method calls, which causes the auto-generated documentation to have empty descriptions. For consistency with DriverCapabilitiesSchema (which uses both JSDoc comments and .describe() calls) and to ensure proper documentation generation, each field should include a .describe() call with the description text.

For example:

  • queryFilters: z.boolean().default(false).describe('Can execute WHERE clause filters natively?')
  • queryAggregations: z.boolean().default(false).describe('Can perform aggregation (group by, sum, avg)?')

This would ensure the generated documentation tables include meaningful descriptions for each capability.

Copilot uses AI. Check for mistakes.

/** Can execute SQL-like joins natively? */
joins: z.boolean().default(false),

// ============================================================================
// Advanced Features
// ============================================================================

/** Can perform full-text search? */
fullTextSearch: z.boolean().default(false),
/** Can perform aggregation (group by, sum, avg)? */
aggregation: z.boolean().default(false),
/** Is scheme-less (needs schema inference)? */
dynamicSchema: z.boolean().default(false),

/** Is read-only? */
readOnly: z.boolean().default(false),

/** Is scheme-less (needs schema inference)? */
dynamicSchema: z.boolean().default(false),
});

/**
Expand Down
Loading
Loading