You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text: The Standard Protocol for AI Software Generation
7
-
tagline: A universal, metadata-driven ORM and protocol designed to empower LLMs to generate enterprise apps without hallucinations.
6
+
text: The Universal Data Compiler
7
+
tagline: Stop writing glue code. Start compiling your data layer. Define schemas once in YAML, compile to optimized SQL for any database, auto-generate type-safe APIs.
8
8
image:
9
9
src: /logo.svg
10
10
alt: ObjectQL Logo
11
11
actions:
12
12
- theme: brand
13
-
text: 📖 Read the Guide
13
+
text: Get Started
14
14
link: /guide/getting-started
15
15
- theme: alt
16
-
text: 🤖 AI-Native Development
17
-
link: /ai/
18
-
- theme: alt
19
-
text: 🔌 API Reference
20
-
link: /api/
16
+
text: View on GitHub
17
+
link: https://github.com/objectstack-ai/objectql
21
18
22
19
features:
23
-
- icon: 🛡️
24
-
title: No Hallucinations
25
-
details: Schema-first architecture ensures LLMs generate valid queries against a strict contract, eliminating phantom columns and tables.
26
-
- icon: 📉
27
-
title: Token Efficient
28
-
details: Compact YAML/JSON metadata and declarative logic reduce context window usage compared to verbose ORM code generation.
29
-
- icon: 🧩
30
-
title: Metadata-Driven
31
-
details: All logic (Schema, Validation, Permissions) is defined in declarative files. Perfect for RAG and Long-term Agent Memory.
32
-
- icon: 🌍
33
-
title: Universal Runtime
34
-
details: Write once, run anywhere. The core protocol abstracts PostgreSQL, MongoDB, and SQLite, running in Node.js, Browser, or Edge.
20
+
- icon: 🔒
21
+
title: Zero-Overhead Security
22
+
details: RBAC and ACL rules are compiled directly into SQL WHERE clauses at query time, not checked in application memory. Security breaches from forgotten permission checks are impossible.
23
+
- icon: 🌐
24
+
title: Database Agnostic
25
+
details: Write your schema once. Switch from local SQLite in development to production PostgreSQL, MySQL, or TiDB without changing a single line of code. The compiler handles dialect translation.
26
+
- icon: ⚡
27
+
title: Virtual Columns
28
+
details: Define computed fields in your schema that compile to efficient database expressions. No N+1 queries, no manual JOIN management—just declare the intent and let the compiler optimize.
35
29
---
36
30
37
-
## The Protocol in Action
38
-
39
-
ObjectQL bridges the gap between AI generation and reliable execution.
40
-
41
-
### 1. Declarative Modeling
31
+
## Show Code: From Schema to SQL
42
32
43
-
Define your data model in simple, human and machine-readable YAML.
33
+
You define the intent in declarative YAML. ObjectQL compiles it into optimized, database-specific SQL.
44
34
45
35
::: code-group
46
36
47
-
```yaml [account.object.yml]
48
-
name: account
49
-
label: Account
37
+
```yaml [project.object.yml]
38
+
name: project
39
+
label: Project
50
40
fields:
51
-
name: { type: text, required: true }
52
-
industry:
41
+
name:
42
+
type: text
43
+
required: true
44
+
status:
53
45
type: select
54
-
options: [tech, finance, retail]
55
-
revenue: currency
56
-
status: { type: select, options: [active, vip] }
46
+
options: [planning, active, completed]
47
+
default: planning
48
+
owner:
49
+
type: lookup
50
+
reference_to: users
51
+
required: true
52
+
# Virtual column: computed at query time
53
+
task_count:
54
+
type: number
55
+
formula: "COUNT(tasks.id)"
56
+
virtual: true
57
57
```
58
58
59
-
```yaml [account.validation.yml]
60
-
# Cross-field logic without writing code
61
-
rules:
62
-
vip_revenue_check:
63
-
when: "status == 'vip'"
64
-
expect: "revenue > 1000000"
65
-
message: "VIP accounts require >1M revenue"
59
+
```sql [Compiled SQL (PostgreSQL)]
60
+
-- Query: Find active projects with task counts
61
+
SELECT
62
+
p.id,
63
+
p.name,
64
+
p.status,
65
+
u.name AS owner_name,
66
+
(SELECT COUNT(*)
67
+
FROM tasks t
68
+
WHERE t.project_id = p.id) AS task_count
69
+
FROM projects p
70
+
LEFT JOIN users u ON p.owner = u.id
71
+
WHERE p.status = 'active'
72
+
AND p.tenant_id = $1 -- RBAC injected automatically
73
+
ORDER BY p.created_at DESC;
66
74
```
67
75
68
76
:::
69
77
70
-
### 2. Hallucination-Free Querying
78
+
**You define the intent. We compile the optimized SQL.**
71
79
72
-
LLMs generate structured JSON queries instead of error-prone SQL strings.
80
+
## Why ObjectQL?
73
81
74
-
::: code-group
82
+
### Architected for Enterprise Backends
83
+
84
+
ObjectQL is not a runtime wrapper around your database. It's a **compiler** that transforms high-level metadata into production-grade database operations.
85
+
86
+
**🔒 Security by Design**
75
87
76
-
```json [Request (JSON Protocol)]
77
-
{
78
-
"fields": ["name", "revenue", "owner.name"],
79
-
"filters": [
80
-
["industry", "=", "tech"],
81
-
"and",
82
-
["revenue", ">", 500000]
83
-
]
84
-
}
88
+
Traditional ORMs rely on developers remembering to add permission checks:
-**Production**: MySQL 8.0+ or TiDB (horizontal scaling)
115
+
-**Enterprise**: Oracle or SQL Server (legacy integration)
103
116
104
-
Traditional ORMs are designed for *human ergonomics*. They use complex fluent APIs, generic types, and string templates. For an LLM, these are "fuzzy" targets that lead to:
105
-
***Hallucinations**: Inventing methods that don't exist.
106
-
***Context Window Bloat**: Needing huge type definition files to understand the schema.
107
-
***Injection Risks**: Generating unsafe raw SQL strings.
117
+
The compiler generates dialect-specific SQL automatically. No vendor lock-in.
108
118
109
-
### The ObjectQL Advantage
119
+
**⚡ Virtual Columns Without the Pain**
120
+
121
+
Define computed fields that compile to efficient SQL:
122
+
123
+
```yaml
124
+
# In your schema
125
+
revenue_total:
126
+
type: currency
127
+
formula: "SUM(line_items.amount)"
128
+
virtual: true
129
+
```
110
130
111
-
ObjectQL abstracts the entire backend into a **Standardized Protocol**:
131
+
ObjectQL compiles this to a subquery or JOIN based on the query context. No N+1 problems, no manual optimization needed.
112
132
113
-
1.**Schema is Data**: `user.object.yml` is easier for AI to read/write than `class User extends Entity`.
114
-
2.**Logic is Data**: Queries are ASTs like `{ op: 'find', filters: [['age', '>', 18]] }`. 100% deterministic.
115
-
3.**Self-Describing**: The runtime can introspect any ObjectQL endpoint and explain it to an Agent instantly.
133
+
## Compiler vs. Traditional ORM
134
+
135
+
| Feature | ObjectQL (Compiler) | Traditional ORM (Runtime) |
0 commit comments