Skip to content

Commit a6068c0

Browse files
Copilothotlong
andcommitted
Add examples, migration guide, and README documentation
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 07a9f02 commit a6068c0

3 files changed

Lines changed: 874 additions & 0 deletions

File tree

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,55 @@ os generate # Scaffold objects, views, flows
110110
os doctor # Check environment health
111111
```
112112

113+
## 🗄️ Database-Backed Metadata
114+
115+
ObjectStack now supports storing metadata in databases instead of being locked to filesystem storage. This enables:
116+
117+
- **Dynamic metadata**: Change metadata without redeployment
118+
- **Multi-tenant**: Isolated metadata per tenant
119+
- **Scalability**: Distribute metadata across multiple databases
120+
- **Flexibility**: Switch between PostgreSQL, MySQL, MongoDB, etc.
121+
122+
### Quick Example
123+
124+
```typescript
125+
import { defineConfig } from '@objectstack/spec';
126+
127+
export default defineConfig({
128+
datasources: [
129+
{
130+
name: 'metadata_db',
131+
driver: 'postgres',
132+
config: {
133+
host: 'localhost',
134+
database: 'objectstack_metadata',
135+
user: process.env.DB_USER,
136+
password: process.env.DB_PASSWORD,
137+
},
138+
},
139+
],
140+
141+
metadata: {
142+
loaders: [
143+
{
144+
name: 'database-loader',
145+
protocol: 'database:',
146+
datasourceConfig: {
147+
datasource: 'metadata_db',
148+
table: '_framework_metadata',
149+
autoMigrate: true,
150+
},
151+
},
152+
],
153+
},
154+
});
155+
```
156+
157+
**Documentation:**
158+
- [📖 Metadata Datasource Guide](./docs/METADATA_DATASOURCE.md) — Complete protocol documentation
159+
- [🔄 Migration Guide](./docs/METADATA_MIGRATION_GUIDE.md) — Migrate from filesystem to database
160+
- [📝 Configuration Examples](./examples/metadata-datasource-config.example.ts) — Multiple scenarios
161+
113162
## 📦 Monorepo Structure
114163

115164
### Core Packages

0 commit comments

Comments
 (0)