Update documentation content

This commit is contained in:
2026-03-15 05:32:05 +01:00
parent 7d10f030f3
commit c0b92596ec
30 changed files with 1840 additions and 29 deletions
@@ -0,0 +1,55 @@
---
title: Add an Entry | Datasquirel docs
description: Insert a new row into a Datasquirel table
page_title: Add an Entry
page_description: Insert a new row into a table using the web admin panel.
---
## Overview
An **entry** is a single row in a table. Once you have a table with fields defined, you can start inserting entries through the admin panel or via the API.
## Steps
### 1. Open the Table
Navigate to your database and click on the table you want to add an entry to.
<DocsImg
alt="Table Page"
srcLight="/images/screenshots/table-page-screenshot-light.webp"
srcDark="/images/screenshots/table-page-screenshot-dark.webp"
/>
### 2. Click Add New Table Entry
Click the **Add New Table Entry** button at the top of the table page.
### 3. Fill in the Fields
A form will appear with an input for each field in your table. Fill in the values:
- Fields marked **Required** must have a value — the form will not submit without them.
- Fields with a **Default Value** are pre-filled — you can leave them or override the default.
- **Rich fields** (HTML, Markdown, JSON, code) open in their dedicated editors.
### 4. Save the Entry
Click **Add Entry**. The new row is inserted into the table and will appear in the table view immediately.
## Editing an Entry
To edit an existing entry, click on the row in the table view to open the edit form. Change the values and click **Update Entry**.
## Deleting an Entry
To delete an entry, open the edit form and click **Delete Entry**, or use the delete action in the table row controls. Deleted entries are permanently removed from the database.
## Adding Entries via the API
Entries can also be inserted programmatically using the REST API or the npm package. See [API Reference → POST](/docs/api-reference/crud/post) for details.
## What's Next
- [API Reference → CRUD](/docs/api-reference/crud) — manage entries programmatically
- [Media](/docs/gui-reference/media) — upload and attach files to your entries
@@ -0,0 +1,43 @@
---
title: Create a Database | Datasquirel docs
description: Create a new database from the Datasquirel web GUI
page_title: Create a Database
page_description: Add a new database to your Datasquirel account using the web admin panel.
---
## Overview
A **database** is a named container that holds one or more tables. Each Datasquirel account can have multiple databases, and each database is isolated from the others — API keys can be scoped to specific databases.
## Steps
### 1. Open the Databases Page
Log in to your admin panel and navigate to **Databases** in the sidebar, or go to [/admin/databases](/admin/databases).
### 2. Click Add Database
Click the **Add Database** button at the top of the databases list.
<DocsImg
alt="Databases List"
srcLight="/images/screenshots/databases-light.webp"
srcDark="/images/screenshots/databases-dark.webp"
/>
### 3. Fill in the Database Details
A form will appear. Fill in the required fields:
- **Database Name** — a unique name for the database. Use lowercase letters, numbers, and underscores (e.g. `social_network`).
- **Description** *(optional)* — a short description of the database.
- **Image** *(optional)* — an image to display on the database card.
### 4. Create the Database
Click **Create Database**. You will be taken to the new database page where you can start creating tables or import an existing database from an SQL file.
## What's Next
- [Create a Table](/docs/gui-reference/databases/create-table) — add your first table to the database
- [Create Table Fields](/docs/gui-reference/databases/create-table-fields) — define the columns for your table
@@ -2,9 +2,65 @@
title: Create Database Table Fields
description: Learn how to create fields/columns in your tables
page_title: Create Table Fields
page_description: Learn how to create fields/columns in your tables
page_description: Define the columns and data types for your Datasquirel tables.
---
## Create Database Table Fields
## Overview
Fields (or Columns) define the structure of your SQL tables. Datasquirel Helps you define these structures and even extend them.
**Fields** (also called columns) define the structure of a SQL table. Every row in the table must conform to the field definitions. Datasquirel provides a visual field editor that maps directly to MariaDB column definitions — what you define is what gets created in the database.
## Adding a Field
Open a table in your admin panel and click **Add Field** (or access the field editor during table creation). For each field you need to provide:
### Field Name
The name of the column. Use lowercase letters, numbers, and underscores. This name is used in API responses and SQL queries (e.g. `first_name`, `created_at`).
### Data Type
The SQL data type for the column. Common types include:
| Type | Description |
|------|-------------|
| `VARCHAR` | Variable-length text, up to a defined maximum length (e.g. `VARCHAR(255)`) |
| `INT` | 32-bit integer |
| `BIGINT` | 64-bit integer — use for IDs that may exceed 2 billion |
| `TEXT` | Unlimited-length text |
| `LONGTEXT` | Very large text content (e.g. HTML, Markdown, JSON) |
| `DATETIME` | Date and time value |
| `DATE` | Date only |
| `BOOLEAN` | True/false stored as `TINYINT(1)` |
| `FLOAT` | Floating-point number |
| `JSON` | Structured JSON data |
| `ENUM` | A value from a predefined list |
See the full list in the [Database Reference → Data Types](/docs/database-reference/data-types).
### Required
Check this option to add a `NOT NULL` constraint — the field must have a value on every insert. Leave it unchecked to allow `NULL`.
### Default Value
A value to use when no value is provided on insert. For example:
- `0` for numeric fields
- `""` for empty text
- `CURRENT_TIMESTAMP` for datetime fields that should auto-populate
### More Options
Click **More** on any field to access additional options:
- **Unique** — adds a UNIQUE constraint so no two rows can have the same value for this field.
- **Encryption** — encrypts the value before storing it. Useful for sensitive data like tokens.
- **Foreign Key** — links this field to a column in another table, enforcing referential integrity.
## Editing and Removing Fields
To edit an existing field, open the table schema editor and click on the field. To remove a field, click the delete icon next to it. Removing a field drops the column from the underlying MariaDB table — all data in that column will be lost.
## What's Next
- [Create Table Indexes](/docs/gui-reference/databases/create-table-indexes) — add indexes to speed up queries on specific fields
- [Add an Entry](/docs/gui-reference/databases/add-entry) — start inserting rows
@@ -0,0 +1,56 @@
---
title: Create Table Indexes | Datasquirel docs
description: Add indexes to your database tables to improve query performance
page_title: Create Table Indexes
page_description: Add indexes to your tables to speed up queries on frequently searched fields.
---
## Overview
An **index** is a data structure that MariaDB maintains alongside your table to make certain queries faster. Without an index, a query that filters by a column must scan every row in the table. With an index on that column, MariaDB can jump directly to the matching rows.
Adding indexes is especially important on:
- Fields used in `WHERE` clauses (e.g. `WHERE slug = ?`)
- Fields used in `ORDER BY` or `GROUP BY`
- Foreign key fields
## Index Types
Datasquirel supports the following MariaDB index types:
| Type | Description |
|------|-------------|
| **INDEX** | A standard non-unique index. Use this to speed up queries on any column that is not required to be unique. |
| **UNIQUE** | Like INDEX, but also enforces that no two rows can have the same value for the indexed column. |
| **FULLTEXT** | A full-text index used for text search with `MATCH ... AGAINST`. Applies to `TEXT` and `VARCHAR` columns. |
## Adding an Index
### From the Field Settings
The simplest way to index a field is directly in the field editor. When creating or editing a field, click **More** and enable the **Unique** option — this creates a UNIQUE index on the field.
### From the Table Schema Editor
1. Open the table in your admin panel.
2. Navigate to the **Schema** or **Indexes** tab.
3. Click **Add Index**.
4. Select the index type and choose the field(s) to include.
5. Save the index.
<DocsImg
alt="SQL Field Settings"
srcLight="/images/screenshots/sql-field-settings-light.webp"
srcDark="/images/screenshots/sql-field-settings-dark.webp"
/>
## Notes
- Every table automatically has a PRIMARY KEY on the `id` column. This index is created by Datasquirel and cannot be removed.
- Adding an index on a large table may take a moment as MariaDB rebuilds the index structure.
- Indexes speed up reads but add a small overhead to writes (INSERT, UPDATE, DELETE). Only index fields you actually query on.
## What's Next
- [Create Table Fields](/docs/gui-reference/databases/create-table-fields) — understand field types and constraints
- [API Reference → GET](/docs/api-reference/crud/get) — use query parameters to filter and sort data
@@ -0,0 +1,52 @@
---
title: Create a Table | Datasquirel docs
description: Create a new table inside a Datasquirel database
page_title: Create a Table
page_description: Add a new table to an existing database using the web admin panel.
---
## Overview
A **table** is a structured set of rows, where every row has the same columns (fields). Before you can add data, you need to create at least one table in your database and define its fields.
## Steps
### 1. Open a Database
Navigate to the database you want to add a table to. Click on the database from the [Databases](/admin/databases) list.
### 2. Click Add Table
On the database page, click the **Add Table** button.
<DocsImg
alt="Tables List"
srcLight="/images/screenshots/tables-list-white.webp"
srcDark="/images/screenshots/tables-list-dark.webp"
/>
### 3. Name the Table
Enter a name for the table. Table names should use lowercase letters, numbers, and underscores (e.g. `blog_posts`).
### 4. Add Fields
The table creation form includes a field editor. Add at least one field to define the structure of the table. For each field, provide:
- **Field Name** — the column name (e.g. `title`, `created_at`).
- **Data Type** — the SQL data type for the column. See [Data Types](/docs/database-reference/data-types) for the full list.
- **Required** — whether the field must have a value (NOT NULL constraint).
- **Default Value** — a default value used when no value is provided.
- **More** — additional options including encryption and foreign key relationships.
See [Create Table Fields](/docs/gui-reference/databases/create-table-fields) for a detailed breakdown of each field option.
### 5. Save the Table
Click **Add Table** to create the table. It will appear in the table list for the database.
## What's Next
- [Create Table Fields](/docs/gui-reference/databases/create-table-fields) — learn more about field types and options
- [Add an Entry](/docs/gui-reference/databases/add-entry) — insert your first row
- [Create Table Indexes](/docs/gui-reference/databases/create-table-indexes) — add indexes to improve query speed
+27 -19
View File
@@ -7,22 +7,30 @@ page_description: Create and manage databases via the web GUI
## Quick Links
<br />
<DocsCard
title="Create a New Database"
description="Create a new Database from the web GUI"
href="/docs/gui-reference/databases/create-database"
/>
<br />
<DocsCard
title="Create a New Table"
description="Create a table in your Database"
href="/docs/gui-reference/databases/create-table"
/>
<br />
<DocsCard
title="Create Table Fields"
description="Create fields/columns in your tables"
href="/docs/gui-reference/databases/create-table-fields"
/>
<div className="w-full grid grid-cols-1 gap-4 items-stretch">
<DocsCard
title="Create a New Database"
description="Create a new database from the web GUI."
href="/docs/gui-reference/databases/create-database"
/>
<DocsCard
title="Create a New Table"
description="Create a table inside your database."
href="/docs/gui-reference/databases/create-table"
/>
<DocsCard
title="Create Table Fields"
description="Define the columns and data types for your table."
href="/docs/gui-reference/databases/create-table-fields"
/>
<DocsCard
title="Add an Entry"
description="Insert a new row into a table."
href="/docs/gui-reference/databases/add-entry"
/>
<DocsCard
title="Create Table Indexes"
description="Add indexes to improve query performance."
href="/docs/gui-reference/databases/create-table-indexes"
/>
</div>