Skip to content

Commit

Permalink
clarify the docs as to which set types are currently implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Apr 14, 2023
1 parent 72ddd37 commit 1eb977b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 0 additions & 2 deletions pages/background.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Callout } from "nextra-theme-docs";

# Background

We want applications:
Expand Down
8 changes: 5 additions & 3 deletions pages/cr-sqlite/crdts/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

The big idea is that you define a table then say which CRDTs should be used to model it.

Notional example (as a [custom syntax for crdts](/cr-sqlite/custom-syntax)):

```sql
CREATE CLSet post (
id INTEGER PRIMARY KEY,
Expand All @@ -19,9 +21,9 @@ Tables can be thought of as a set of rows where the identity of each row is its

cr-sqlite supports modeling tables as:

1. Delete Wins Sets
2. Causal Length Sets
3. Grow Only Sets
1. Delete Wins Sets (✅ implemented)
2. Causal Length Sets (🦺 coming soon)
3. Grow Only Sets (🦺 coming soon)

See [Table CRDTs](./table-crdts).

Expand Down
10 changes: 8 additions & 2 deletions pages/cr-sqlite/custom-syntax.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { Callout } from "nextra-theme-docs";

# Custom Syntax

A current eye-sore of CR-SQLite is the use of `SELECT` statements to invoke functions which do some sort of modification of the database schema. Another eye-sore is the requirement to wrap alterations of `crr`s with [crsql_begin_alter](/cr-sqlite/api-methods/crsql_begin_alter) and [crsql_commit_alter](/cr-sqlite/api-methods/crsql_commit_alter).
A current eye-sore of CR-SQLite is the use of `SELECT` statements to invoke functions which do some sort of modification of the database schema. E.g., converting a table to a crdt requires running: `SELECT crsql_as_crr('table_name')`.

Another eye-sore is the requirement to wrap alterations of `crr`s with [crsql_begin_alter](/cr-sqlite/api-methods/crsql_begin_alter) and [crsql_commit_alter](/cr-sqlite/api-methods/crsql_commit_alter).

Luckily, we're partnering with the folks over at the [libsql](https://libsql.org/) project to add a dedicated syntax for CRR creation and modification.

Luckily, we're partnering with the folks over at the [libsql](https://libsql.org/) project to add a dedicated syntax for CRR creation and modification.
> Note: we're also converting `crsql_as_crr` to a virtual table to simplify syntax: https://github.com/vlcn-io/cr-sqlite/issues/181
```sql
CREATE TABLE post (
Expand Down

1 comment on commit 1eb977b

@tantaman
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.