Table Management Overview
In Rocket, each database hosts multiple tables, where each table defining the structure of data and specifying operations to be executed. For example, in a blogging platform, tables such as 'Users' and 'Posts' are typical. The 'Users' table stores user information, while the 'Posts' table manages blog post data.
Within each table, various attributes (similar to columns in relational databases) can be defined, where each attribute defines the data type of the data, the needed operations on the data, and some other behaviors for the data.
For instance, in the 'Users' table, attributes like 'id', 'name', and 'bio' may exist. The 'id' attribute, for instance, can be designated as unique, indexable, editable, and deletable, enabling it to uniquely identify data, serve as an index for retrieval, deletion, and modification. Similarly, attributes like 'name' can be marked as searchable and sortable.
Rocket leverages these attributes and attribute configurations to automatically generate RESTful APIs and documentation.
Table Operations
In Rocket, several operations can be performed on Tables. Here is list of all operations on Table:
- Creating Tables: Refer to the Creating Tables documentation for detailed instructions.
- Editing Tables: Access guidance on Editing Tables to modify table configurations effectively.
- Deleting Tables: Follow the outlined instructions in Deleting Tables to remove tables from the database.
- Adding Attributes: Detailed instructions for adding attributes can be found in the Adding Attributes documentation.
- Editing Attributes: Learn about editing table attributes through the guidance provided in Editing Attributes.
- Deleting Attributes: Remove table attributes using the instructions outlined in Deleting Attributes.
Field Rules
The following table outlines the field rules for configuring tables:
Field | Description | Data Type | Minimum Length | Maximum Length | Valid Options | Default Value | Is Optional | Extra Details |
---|---|---|---|---|---|---|---|---|
Name | Table Name | string | 2 | 25 | - | - | No | Needed to be a valid entity name |
Description | Table Description | large-text | 2 | 255 | - | - | No | - |
Attribute.Basic Details.Name | Attribute Name | string | 2 | 25 | - | - | No |
|
Attribute.Basic Details.Description | Attribute Description | large-text | 2 | 255 | - | - | No | - |
Attribute.Data Type.Data Type | Attribute Data Type | string | - | - | 'string', 'number', 'boolean', 'large-text', 'array', 'enum', 'date', 'date-time' | string | No | - |
Attribute.Data Type.Enum Values | Enum Values for Enum Data Type | string[] | 2 | 25 | - | - | Yes | Minimum 1 enum value, maximum 5 enum values. Mandatory when data type is 'enum' |
Attribute.Data Type.Optional | Optional Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Indexing.Unique | Unique Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Indexing.Indexable | Indexable Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Searchable | Searchable Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Sortable | Sortable Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Less Than | Less Than Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Less Than Equal | Less Than Equal Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Greater Than | Greater Than Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Greater Than Equal | Greater Than Equal Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.Equal | Equal Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Get Operations.One Of | One Of Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Write Operations.Editable | Editable Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Write Operations.Deletable | Deletable Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Mean | Mean Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Maximum | Maximum Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Minimum | Minimum Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Count | Count Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Sum | Sum Field Indicator | boolean | - | - | true, false | false | No | - |
Attribute.Aggregation.Frequency | Frequency Field Indicator | boolean | - | - | true, false | false | No | - |
These field rules provide comprehensive guidelines for configuring tables and attributes within Rocket. For further information on attributes, refer to Understanding Attributes.