Skip to content

Commit e06ef89

Browse files
authored
Merge pull request #442 from objectstack-ai/copilot/update-documentation-content
2 parents bfb4e4d + 3f30779 commit e06ef89

File tree

12 files changed

+2325
-37
lines changed

12 files changed

+2325
-37
lines changed

content/docs/references/automation/connector.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ description: Connector protocol schemas
66
# Connector
77

88
<Callout type="info">
9-
**Source:** `packages/spec/src/automation/connector.zod.ts`
9+
**Source:** `packages/spec/src/integration/connector.zod.ts`
1010
</Callout>
1111

1212
## TypeScript Usage
1313

1414
```typescript
15-
import { AuthenticationSchema, ConflictResolutionSchema, ConnectorSchema, DataSyncConfigSchema } from '@objectstack/spec/automation';
16-
import type { Authentication, ConflictResolution, Connector, DataSyncConfig } from '@objectstack/spec/automation';
15+
import { AuthenticationSchema, ConflictResolutionSchema, ConnectorSchema, DataSyncConfigSchema } from '@objectstack/spec/integration';
16+
import type { Authentication, ConflictResolution, Connector, DataSyncConfig } from '@objectstack/spec/integration';
1717

1818
// Validate data
1919
const result = AuthenticationSchema.parse(data);
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: MongoDB Driver
3+
description: MongoDB driver configuration schema
4+
---
5+
6+
# MongoDB Driver
7+
8+
<Callout type="info">
9+
**Source:** `packages/spec/src/data/driver/mongo.zod.ts`
10+
</Callout>
11+
12+
## Overview
13+
14+
MongoDB driver configuration schema defines connection settings and capabilities specific to MongoDB databases.
15+
16+
## TypeScript Usage
17+
18+
```typescript
19+
import { MongoConfigSchema, MongoDriverSpec } from '@objectstack/spec/data/driver/mongo';
20+
import type { MongoConfig } from '@objectstack/spec/data/driver/mongo';
21+
22+
// Validate MongoDB configuration
23+
const config: MongoConfig = MongoConfigSchema.parse({
24+
database: 'myapp',
25+
host: '127.0.0.1',
26+
port: 27017,
27+
username: 'admin',
28+
password: 'secret',
29+
});
30+
```
31+
32+
---
33+
34+
## MongoConfig
35+
36+
MongoDB connection configuration schema.
37+
38+
### Properties
39+
40+
| Property | Type | Required | Description |
41+
| :--- | :--- | :--- | :--- |
42+
| **url** | `string` | optional | Connection URI. Format: mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]] |
43+
| **database** | `string` || Database name (required) |
44+
| **host** | `string` | optional | Hostname (default: '127.0.0.1') |
45+
| **port** | `number` | optional | Port number (default: 27017) |
46+
| **username** | `string` | optional | Username for authentication |
47+
| **password** | `string` | optional | Password for authentication |
48+
| **authSource** | `string` | optional | Authentication database (defaults to admin or database name) |
49+
| **options** | `Record<string, any>` | optional | Extra driver options (ssl, poolSize, etc) |
50+
51+
---
52+
53+
## MongoDriverSpec
54+
55+
The static definition of MongoDB driver capabilities.
56+
57+
### Capabilities
58+
59+
| Capability | Supported | Description |
60+
| :--- | :--- | :--- |
61+
| **transactions** || ACID transactions |
62+
| **fullTextSearch** || Full-text search indexes |
63+
| **geoSpatial** || Geospatial queries |
64+
| **aggregation** || Aggregation pipeline |
65+
| **mutableSchema** || Dynamic schema changes |
66+
| **jsonField** || Native JSON/BSON storage |
67+
| **crossObjectJoin** || $lookup aggregation |
68+
69+
---
70+
71+
## Examples
72+
73+
### Basic Configuration
74+
75+
```typescript
76+
const config: MongoConfig = {
77+
database: 'crm',
78+
host: '127.0.0.1',
79+
port: 27017,
80+
username: 'app_user',
81+
password: 'secure_password',
82+
};
83+
```
84+
85+
### Connection URI
86+
87+
```typescript
88+
const config: MongoConfig = {
89+
url: 'mongodb://user:password@localhost:27017/mydb',
90+
database: 'mydb', // Still required
91+
};
92+
```
93+
94+
### Replica Set Configuration
95+
96+
```typescript
97+
const config: MongoConfig = {
98+
url: 'mongodb://node1:27017,node2:27017,node3:27017/mydb?replicaSet=rs0',
99+
database: 'mydb',
100+
options: {
101+
replicaSet: 'rs0',
102+
readPreference: 'secondaryPreferred',
103+
},
104+
};
105+
```
106+
107+
### SSL Configuration
108+
109+
```typescript
110+
const config: MongoConfig = {
111+
database: 'production',
112+
host: 'mongodb.example.com',
113+
port: 27017,
114+
username: 'app_user',
115+
password: 'secure_password',
116+
authSource: 'admin',
117+
options: {
118+
ssl: true,
119+
sslValidate: true,
120+
sslCA: '/path/to/ca.pem',
121+
},
122+
};
123+
```
124+
125+
### Connection Pool Options
126+
127+
```typescript
128+
const config: MongoConfig = {
129+
database: 'myapp',
130+
host: 'localhost',
131+
port: 27017,
132+
options: {
133+
poolSize: 20,
134+
socketTimeoutMS: 30000,
135+
connectTimeoutMS: 10000,
136+
serverSelectionTimeoutMS: 5000,
137+
},
138+
};
139+
```
140+
141+
---
142+
143+
## Related
144+
145+
- [Driver](/docs/references/data/driver) - Base driver protocol
146+
- [Driver NoSQL](/docs/references/data/driver-nosql) - NoSQL driver interface
147+
- [Datasource](/docs/references/system/datasource) - Datasource configuration
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: PostgreSQL Driver
3+
description: PostgreSQL driver configuration schema
4+
---
5+
6+
# PostgreSQL Driver
7+
8+
<Callout type="info">
9+
**Source:** `packages/spec/src/data/driver/postgres.zod.ts`
10+
</Callout>
11+
12+
## Overview
13+
14+
PostgreSQL driver configuration schema defines connection settings and options specific to PostgreSQL databases.
15+
16+
## TypeScript Usage
17+
18+
```typescript
19+
import { PostgresConfigSchema } from '@objectstack/spec/data/driver/postgres';
20+
import type { PostgresConfig } from '@objectstack/spec/data/driver/postgres';
21+
22+
// Validate PostgreSQL configuration
23+
const config: PostgresConfig = PostgresConfigSchema.parse({
24+
database: 'myapp',
25+
host: 'localhost',
26+
port: 5432,
27+
username: 'postgres',
28+
password: 'secret',
29+
ssl: false,
30+
});
31+
```
32+
33+
---
34+
35+
## PostgresConfig
36+
37+
PostgreSQL connection configuration schema.
38+
39+
### Properties
40+
41+
| Property | Type | Required | Description |
42+
| :--- | :--- | :--- | :--- |
43+
| **url** | `string` | optional | Connection URI. Format: postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...] |
44+
| **database** | `string` || Database name |
45+
| **host** | `string` | optional | Hostname or IP address (default: 'localhost') |
46+
| **port** | `number` | optional | Port number (default: 5432) |
47+
| **username** | `string` | optional | Authentication username |
48+
| **password** | `string` | optional | Authentication password |
49+
| **schema** | `string` | optional | Default schema for tables (default: 'public') |
50+
| **ssl** | `boolean \| object` | optional | Enable SSL/TLS connection |
51+
| **applicationName** | `string` | optional | Sets the application_name configuration parameter |
52+
| **max** | `number` | optional | Maximum number of clients in pool (default: 10) |
53+
| **min** | `number` | optional | Minimum number of clients in pool (default: 0) |
54+
| **idleTimeoutMillis** | `number` | optional | Idle timeout in milliseconds |
55+
| **connectionTimeoutMillis** | `number` | optional | Connection timeout in milliseconds |
56+
| **statementTimeout** | `number` | optional | Statement timeout in milliseconds |
57+
58+
### SSL Configuration
59+
60+
When `ssl` is an object, it can contain:
61+
62+
| Property | Type | Description |
63+
| :--- | :--- | :--- |
64+
| **rejectUnauthorized** | `boolean` | Whether to reject unauthorized certificates |
65+
| **ca** | `string` | CA certificate |
66+
| **key** | `string` | Client key |
67+
| **cert** | `string` | Client certificate |
68+
69+
---
70+
71+
## Examples
72+
73+
### Basic Configuration
74+
75+
```typescript
76+
const config: PostgresConfig = {
77+
database: 'crm',
78+
host: 'localhost',
79+
port: 5432,
80+
username: 'app_user',
81+
password: 'secure_password',
82+
};
83+
```
84+
85+
### Connection URI
86+
87+
```typescript
88+
const config: PostgresConfig = {
89+
url: 'postgresql://user:password@localhost:5432/mydb',
90+
database: 'mydb', // Required even with URL
91+
};
92+
```
93+
94+
### SSL Configuration
95+
96+
```typescript
97+
const config: PostgresConfig = {
98+
database: 'production',
99+
host: 'db.example.com',
100+
port: 5432,
101+
username: 'app_user',
102+
password: 'secure_password',
103+
ssl: {
104+
rejectUnauthorized: true,
105+
ca: '-----BEGIN CERTIFICATE-----\n...',
106+
},
107+
};
108+
```
109+
110+
### Connection Pool Configuration
111+
112+
```typescript
113+
const config: PostgresConfig = {
114+
database: 'myapp',
115+
host: 'localhost',
116+
port: 5432,
117+
username: 'postgres',
118+
password: 'secret',
119+
max: 20, // Max 20 connections
120+
min: 5, // Keep at least 5 connections
121+
idleTimeoutMillis: 30000, // Close idle connections after 30s
122+
connectionTimeoutMillis: 2000, // Timeout connection attempts after 2s
123+
statementTimeout: 5000, // Abort slow queries after 5s
124+
};
125+
```
126+
127+
---
128+
129+
## Related
130+
131+
- [Driver](/docs/references/data/driver) - Base driver protocol
132+
- [Driver SQL](/docs/references/data/driver-sql) - SQL driver interface
133+
- [Datasource](/docs/references/system/datasource) - Datasource configuration

content/docs/references/data/meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"dataset",
66
"document",
77
"driver",
8+
"driver-mongo",
89
"driver-nosql",
10+
"driver-postgres",
911
"driver-sql",
1012
"external-lookup",
1113
"field",

content/docs/references/data/search-engine.mdx

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)