Skip to content

document SuperSQL statements and bring back the database section. - #7700

Merged
mccanne merged 4 commits into
mainfrom
ddl
Nov 22, 2026
Merged

mccanne merged 4 commits into
mainfrom
ddl

Conversation

@mccanne

@mccanne mccanne commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

New statements pages under SuperSQL: scripts and status records, CREATE TABLE, CREATE SUPER TABLE, DROP TABLE, and INSERT, with tested examples.

Show the Database section again, with the intro rewritten for current behavior, an API reference updated from a live server (adds create branch, compact, vacate, stats, describe, compile, events), and format docs updated (UUIDv7 IDs, snapshots). super db docs: add create -type and links to the statements.

The /compile docs depend on #7699, so merge that first.

New Statements pages under SuperSQL: scripts and status records,
CREATE TABLE, CREATE SUPER TABLE, DROP TABLE, and INSERT, with tested examples.

Show the Database section again, with the intro rewritten for current behavior,
an API reference updated from a live server (adds create branch, compact,
vacate, stats, describe, compile, events), and format docs updated (UUIDv7
IDs, snapshots).  super db docs: add create -type and links to the statements.

The /compile docs depend on #<post-compile PR>, so merge that first.
Comment thread book/src/database/api.md
| name | string | body | **Required.** Name of the table. Must be unique. |
| layout.order | string | body | Order of storage by sort key(s) in table. Possible values: desc, asc. Default: asc. |
| layout.keys | [[string]] | body | Sort key(s) of table. The element of each inner string array should reflect the hierarchical ordering of named fields within indexed records. Default: [[ts]]. |
| sort_keys | [{order:string,path:[string]}] | body | Sort key of the table, where `order` is `asc` or `desc` and `path` is a field path, e.g., `["ts"]` or `["product","serial_number"]`. Default: unsorted. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We may not have to make a big deal out of it since I know we'll address it before too long, but this extends a gap that's been there for a long time: The API presents as if multiple sort keys are supported, but we're still only supporting one in the actual DB at the moment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes this is intentional. Need to get it working internally.

Comment thread book/src/database/api.md Outdated
"commit": "0x0000000000000000000000000000000000000000"
}
}
{"table":{"ts":"2026-11-21T14:28:00.818576616Z","name":"inventory","id":"01a1fe81-c8b2-793a-aab3-383076bc5d23","sortkeys":[{"order":"asc","path":["product"]}],"objectcap":1048576,"framecap":20000,"type":"0x","sql":false},"branch":{"ts":"2026-11-21T14:28:00.818741489Z","name":"main","commit":"00000000-0000-0000-0000-000000000000"}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you have a preference for these being in a single line rather than pretty-printed as they were previously? I see it as a trade off because the single line makes the page vertically tighter (which is nice) but it also means if a user wants to actually see the example response they have to "scroll right" and it's harder to see the hierarchy and pick out individual fields. Just want to make sure the change came from preference and wasn't just an AI authoring thing that slipped by unnoticed.

Comment thread book/src/database/intro.md Outdated
A table can be referred to by either and can be
[renamed](../command/db.md#super-db-rename) while its ID stays the same.

Unlike a relational table, a table need not have a schema. There are

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Unlike a relational table, a table need not have a schema. There are
Unlike a relational table in traditional SQL, a table in SuperDB need not have a schema. There are

Not sure if this is how you'd word it, but I feel like the original statement needs some clarity between those two uses of "table".

Comment thread book/src/database/intro.md Outdated

* A table created by [`CREATE TABLE`](../super-sql/statements/create-table.md)
with columns has a record type and behaves like a SQL table:
values are cast to the columns' types and missing nullable columns are null.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should that be "missing values in nullable columns are null"?


`CREATE SUPER TABLE` creates a table called `<name>` whose values all have
the super-structured type `<type>`, which may be any
[SuperSQL type](../types/intro.md), not just a record of columns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is "record of columns" correct here?

@mccanne
mccanne merged commit 4f6cdb6 into main Nov 22, 2026
4 checks passed
@mccanne
mccanne deleted the ddl branch November 22, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants