Skip to main content

Tables in Rocket

Tables are the cornerstone of your Rocket database, defining your data's structure and the specific operations it supports. This documentation will guide you through effective table management.

Creating a New Table

For detailed instructions on creating a new table, please refer to the Creating Tables section in the documentation.

Managing Existing Tables

Once you've created tables and defined attributes, you can efficiently manage them:

  • Editing Table Attributes: To modify an existing table's structure or properties, navigate to the "Tables" section, select the table you want to modify, and click the "Edit" button.

  • Deleting a Table: If you no longer need a table, you can delete it. However, exercise caution as this action is irreversible. Navigate to the "Tables" section, select the table you wish to delete, and click the "Delete" button.

Data Types

Rocket supports various data types, allowing you to tailor your database to your specific needs. Here is a list of the supported data types in Rocket:

Data TypeDescriptionLength Constraints
IntegerThis data type is designed for storing numbers and supports both negative and positive integers, as well as numbers with decimal points.
BooleanYou can store Boolean values, representing both "true" and "false."
StringStore simple text strings, with optional length constraints.Min Length: 0, Max Length: 255
Large-TextStore lengthy text, with optional length constraints.Min Length: 0, Max Length: 4096

Supported Operations

Rocket provides support for various operations on attributes:

Unique

Marking an attribute as unique designates its data as unique. This means it will not allow any duplicate values.

Indexable

Designating an attribute as indexable enables Rocket to automatically generate APIs for retrieving data based on that attribute. If the attribute is not unique, it may retrieve multiple rows of data.

When the "id" attribute of a table is marked as indexable, Rocket generates an API endpoint in the format "/{databaseId}/{tableId}/{attributeName}/{attributeValue}."

Searchable

Indicating that an attribute is searchable results in Rocket generating APIs for searching data using that attribute.

For instance, selecting the "name" attribute leads to the creation of an API endpoint in the format "/{databaseId}/{tableId}/search/{attributeName}?query={attributeValue}." This allows for data searches based on the specified attribute and query value.

Sortable

Marking an attribute as sortable indicates that it can be used for sorting data. If an attribute is sortable, it will update all the GET APIs and add an optional sorting query parameter.

Editable

This attribute determines if it can be used to identify data for updating. If the attribute is not unique, it may update multiple rows of data.

An API in this format is created: "PUT /{databaseId}/{tableId}/{attributeName}/{attributeValue}."

Deletable

This attribute indicates if it can be used to identify data for deletion. If the attribute is not unique, it may delete multiple rows of data.

An API in this format is created: "DELETE /{databaseId}/{tableId}/{attributeName}/{attributeValue}."

Field Validations

FieldData TypeMin LengthMax LengthOptionsDefaultExtra Details
nameString225---
subtitleString5255---
attribute.nameString225--
  • attribute.name cannot have duplicate values.
  • attribute.name cannot be 'search'.
  • attribute.name can only contains alpha-numeric characters.
  • attribute.name cannot start with any digits.
attribute.dataTypeEnum--'string', 'number', 'boolean', 'large-text'--
attribute.descriptionString5255---
attribute.uniqueBoolean--true, false--
attribute.indexableBoolean--true, false--
attribute.searchableBoolean--true, false--
attribute.sortableBoolean--true, false--
attribute.editableBoolean--true, false--
attribute.deletableBoolean--true, false--