Skip to documentation
OriginChainDB Docs
Ask AI
Queries
Console guide

Create tables and configure indexes

Use the current console guide for live instance workflows and availability. Screenshots below illustrate the demo workspace with sample data. In the signed-in console, actions operate on the selected instance when your role and its capabilities allow them.

Define native fields, inspect relationships, and configure indexes from Data Explorer.

Create a tableOriginChainDB console
New table dialog over the current Data Explorer, with the application header and sidebar visible behind it. New table dialog over the current Data Explorer, with the application header and sidebar visible behind it.
Demo illustration: the native field builder in the current console, using a versioned local datatype catalog.Current console · Dark theme · Local preview
Create a table
New table dialog over the current Data Explorer, with the application header and sidebar visible behind it. New table dialog over the current Data Explorer, with the application header and sidebar visible behind it.

Actual local console with sample data. No production database is connected.

1. Open Data Explorer

Select your instance, open Data Explorer, and choose a namespace. Data lists tables and records; Connections shows the schema map or record graph. Choose New table to start a table definition.

The current screenshots use a local catalog. Saving a preview table changes browser data; confirm the connection state before expecting a table to exist on a live instance.

2. Define native fields

  1. Choose the namespace and table name, then add an optional description.
  2. Add each field and choose its datatype from the loaded catalog.
  3. Set Required and Primary key where the selected type permits them.
  4. Complete type-specific settings, such as enum values or decimal parameters, when shown.
  5. Review validation messages and choose Create table.

The datatype picker follows the available catalog, rather than assuming every engine supports the same types. If it cannot load, keep the draft and use Retry; saving is disabled. In local preview, the catalog is explicitly labeled as a versioned local catalog.

Primary-key fields are required. Optional native values may be omitted. The editor permits up to 40 fields in the local preview; that is a UI preview limit, not an engine capacity claim.

3. Configure indexes separately

Inspect indexesOriginChainDB console
Current Data Explorer Indexes view with the application navigation and sample index catalog. Current Data Explorer Indexes view with the application navigation and sample index catalog.
Demo illustration: inspect index fields and configuration in the current console preview.Current console · Dark theme · Local preview
Inspect indexes
Current Data Explorer Indexes view with the application navigation and sample index catalog. Current Data Explorer Indexes view with the application navigation and sample index catalog.

Actual local console with sample data. No production database is connected.

Open the Indexes view and scope it to your table. Select an index to inspect its fields, mappings, and configuration. Relational, vector, full-text, and graph indexes have different settings; selecting a table modality alone does not create a working vector or search index.

Use the vector schema guide for dimensions, distance, and index family, or the full-text guide for searchable fields and analysis. A local configuration or requested job is not confirmation that a live engine index has been built.

4. Connect tables

In Connections, switch between Schema map and Record graph. Namespace and table filters narrow the view. Expand workspace fills the available page while keeping filtering, inspection, and canvas controls nearby.

Declare a relation before querying it through the graph API. Cross-namespace connections should use the fully qualified source and target table names required by the schema.

5. Inspect the table definition

Open a table in Data to inspect its records, structure, references, and manifest. The preview's exported catalog manifest is JSON; it is not the same document as the engine's canonical TOML schema manifest. Use the API reference when preparing a live schema registration.

6. Edit a structure carefully

Choose Edit structure from the table. Existing field names are fixed in the current editor, and populated field types remain unchanged. New fields and compatible parameter changes are validated against the stored preview records.

7. Remove dependencies before deletion

Delete a table from its Structure view. Referencing relationships and indexes must be removed first, and the confirmation requires the table name. A live table deletion can remove data permanently; read the connected instance's confirmation before proceeding.

Register an engine schema with TOML

The original manifest examples below define shop.orders. They remain API examples: the current native field editor does not have a TOML editing tab. See the schema reference for fields, secondary indexes, relations, foreign-key actions, and CHECK constraints.

Show the original TOML and registration examples
namespace   = "shop"
table       = "orders"
primary_key = ["id"]

[[columns]]
name = "id"
ty = "str"
required = true

[[columns]]
name = "customer"
ty = "str"
required = true

[[columns]]
name = "amount_cents"
ty = "i64"
required = true

[[columns]]
name = "status"
ty = "str"
required = true

[[columns]]
name = "notes"
ty = "str"

[[columns]]
name = "placed_ms"
ty = "u64"

[[indexes]]
name = "by_status"
columns = ["status"]

[[check_constraints]]
name = "amount_non_negative"
expression = "amount_cents >= 0"
[[relations]]
name = "placed_by"
from_col = "customer"
target = { namespace = "shop", table = "customers", pk = "id" }
bidirectional = true

Next, add and validate records, or follow the schema tutorial from an application.