Skip to content

Commit 3e77887

Browse files
committed
new docs
1 parent ff4f8d9 commit 3e77887

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

docs/images/constraint-section.gif

559 Bytes
Loading

docs/pages/programming/bitemporal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ create table t1 {
176176
BUSINESS(bus_start, bus_end)
177177
}
178178
constraints {
179-
"PK" -> no_overlap<bus_start:bus_end>
179+
no_overlap "PK" -> bus_start : bus_end
180180
}
181181
}
182182
```
@@ -337,7 +337,7 @@ create table t1 {
337337
SYSTEM(sys_start, sys_end)
338338
}
339339
constraints {
340-
"PK" -> no_overlap<bus_start:bus_end>
340+
no_overlap "PK" -> bus_start : bus_end
341341
}
342342
}
343343
```

docs/pages/programming/table_schema.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,13 @@ inclusive-exclusive (close-open) approach for the range. The `start` and `end` c
333333
"greater than all". Comdb2 also generates implicit constraint to enforce that `start` is strictly less than `end`
334334
for every row in the table.
335335

336+
`no_overlap` constraints can also be used together with indexes on expressions. Simply set `start` and `end` to be
337+
the one of the key fields defined in the key section of the schema.
338+
339+
Here is an example:
340+
341+
342+
336343
Once a `no_overlap` constraint is defined on a key, Comdb2 enforces that there cannot be more than one rows
337344
with identical values in all key fields (other than `start` and `end`) in any interval range `[start, end)`.
338345

docs/src/sqlitegen/bubble-generator-data.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,10 @@ set all_graphs {
503503
}
504504

505505
constraint-section {
506-
loop {line /keyname ->
506+
loop {line {opt {line /no_overlap}}
507+
/keyname ->
507508
{or {line /table-name : /keyname}
508-
{line /no_overlap /start : /end}
509+
{line /start : /end}
509510
}
510511
}
511512
}

0 commit comments

Comments
 (0)