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
fix(docs): correct Array SQL function names, type OIDs, and WAL header layout
Rename all NDARRAY_* SQL functions to ARRAY_* to match the implemented
DDL surface (ARRAY_SLICE, ARRAY_PROJECT, ARRAY_AGG, ARRAY_ELEMENTWISE,
ARRAY_FLUSH, ARRAY_COMPACT, ALTER ARRAY, DROP ARRAY).
Correct pgwire type-OID table: split TIMESTAMP (1114, tz-naive) from
TIMESTAMPTZ (1184, UTC-normalised), add INTERVAL (1186) and VECTOR
(float4[], 1021), add usage guidance on which to prefer.
Update WAL segment header diagram to match current layout: record_type
widened to 4 bytes, tenant_id to 8 bytes, vshard_id to 4 bytes, 16-byte
reserved field added; total header 54 bytes. Document encryption flag
(bit 14 of record_type) and byte offsets.
Remove unimplemented SHOW/ALTER CONFLICT POLICY SQL from CRDT docs and
replace with accurate status note. Remove unimplemented CREATE SYNONYM
GROUP from FTS docs. Correct vector-search syntax from SEARCH...USING
VECTOR() to ORDER BY vector_distance(...) LIMIT k. Update SQL overview
vector-search operator list.
Copy file name to clipboardExpand all lines: docs/reference/type-oids.rdx
+18-13Lines changed: 18 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,22 @@ description: PostgreSQL type OID mappings for pgwire protocol compatibility.
7
7
8
8
NodeDB maps its types to PostgreSQL OIDs for pgwire compatibility.
9
9
10
-
| NodeDB Type | PostgreSQL Type | OID |
11
-
| ----------- | --------------- | ---- |
12
-
| STRING | text | 25 |
13
-
| INT | int8 | 20 |
14
-
| FLOAT | float8 | 701 |
15
-
| BOOL | bool | 16 |
16
-
| TIMESTAMP | timestamptz | 1184 |
17
-
| UUID | uuid | 2950 |
18
-
| DECIMAL | numeric | 1700 |
19
-
| ARRAY | jsonb | 3802 |
20
-
| OBJECT | jsonb | 3802 |
21
-
| GEOMETRY | bytea | 17 |
10
+
| NodeDB Type | PostgreSQL Type | OID |
11
+
| ------------ | --------------- | ---- |
12
+
| STRING | text | 25 |
13
+
| INT | int8 | 20 |
14
+
| FLOAT | float8 | 701 |
15
+
| BOOL | bool | 16 |
16
+
| TIMESTAMP | timestamp | 1114 |
17
+
| TIMESTAMPTZ | timestamptz | 1184 |
18
+
| INTERVAL | interval | 1186 |
19
+
| UUID | uuid | 2950 |
20
+
| DECIMAL | numeric | 1700 |
21
+
| ARRAY | jsonb | 3802 |
22
+
| OBJECT | jsonb | 3802 |
23
+
| GEOMETRY | bytea | 17 |
24
+
| VECTOR | float4[] | 1021 |
22
25
23
-
Complex types (ARRAY, OBJECT) are serialized as JSONB over pgwire. GEOMETRY is serialized as WKB (bytea).
26
+
`TIMESTAMP` (OID 1114) is timezone-naive. `TIMESTAMPTZ` (OID 1184) is UTC-normalised. Use `TIMESTAMPTZ` for wall-clock event times; `TIMESTAMP` for values that are inherently local (e.g. a schedule expressed in the user's timezone before conversion).
27
+
28
+
Complex types (ARRAY, OBJECT) are serialized as JSONB over pgwire. GEOMETRY is serialized as WKB (bytea). VECTOR is serialized as a float4 array.
Copy file name to clipboardExpand all lines: docs/sql/crdt-operations.rdx
+1-10Lines changed: 1 addition & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,4 @@ Applies a Loro CRDT delta to the document. On Origin, the delta goes through Raf
23
23
24
24
## Conflict Policies
25
25
26
-
```sql
27
-
-- View current policy
28
-
SHOW CONFLICT POLICY ON notes;
29
-
30
-
-- Set policy
31
-
ALTER COLLECTION notes SET conflict_policy = 'lww';
32
-
ALTER COLLECTION profiles SET conflict_policy = 'field_merge';
33
-
```
34
-
35
-
See [CRDT Sync](/docs/crdt-sync/overview) for full sync protocol details.
26
+
Conflict policies (last-writer-wins, field-merge, custom) are configured per-collection at create time and via the native NodeDB protocol's `ALTER POLICY` command. SQL DDL for inspecting and updating conflict policies — `SHOW CONFLICT POLICY ON <collection>` and `ALTER COLLECTION ... SET ON CONFLICT ...` — is wired in the v0.1.0 release alongside the rest of the SQL surface. See the protocol reference for the native-protocol form, and [CRDT Sync](/docs/crdt-sync/overview) for full sync protocol details.
SEARCH articles USING VECTOR(embedding, ARRAY[0.1, 0.3, -0.2, ...], 10);
11
+
SELECT id, vector_distance(embedding, ARRAY[0.1, 0.3, -0.2, ...]) AS dist
12
+
FROM articles
13
+
ORDER BY dist LIMIT 10;
12
14
```
13
15
14
-
Returns the 10 nearest neighbors by the metric configured on the index (l2, cosine, inner_product, manhattan, chebyshev, hamming, jaccard, or pearson).
16
+
Returns the 10 nearest neighbors by the metric configured on the index (l2, cosine, inner_product, manhattan, chebyshev, hamming, jaccard, or pearson). The planner detects `ORDER BY vector_distance(...) LIMIT k` and rewrites it into an ANN top-k plan; no special `SEARCH` keyword is required.
15
17
16
18
## Filtered Vector Search
17
19
18
20
```sql
19
21
SELECT title, vector_distance(embedding, ARRAY[0.1, 0.3, ...]) AS score
20
22
FROM articles
21
23
WHERE category = 'machine-learning'
22
-
AND id IN (SEARCH articles USING VECTOR(embedding, ARRAY[0.1, 0.3, ...], 10));
24
+
ORDER BY score LIMIT 10;
23
25
```
24
26
25
27
The engine builds a Roaring Bitmap of matching IDs and selects the optimal strategy: pre-filter (selective filters), post-filter (broad filters), or brute-force (very selective).
0 commit comments