Appearance
Database Tables
Database tables define where your app's data is stored. WP-Nexus supports three storage backends, each with different strengths.
Creating a Table
Navigate to your app and click the Tables tab. Click Create Table and fill in:
- Name -- display name (e.g., "Products", "Events")
- Slug -- auto-generated identifier (same rules as app slugs: lowercase, letters/digits/underscores, must start with a letter)
- Storage Type -- choose one of the three options below
Storage Types
Custom Table (custom_table)
Creates a dedicated SQL table in your WordPress database (named {wp_prefix}nexus_app_{appId}_{slug}, e.g., wp_nexus_app_1_products). Best for:
- High-performance queries on structured data
- Large datasets where WordPress post queries would be slow
- Data that does not need WordPress admin UI (post editor, categories, etc.)
Custom Post Type (custom_post_type)
Stores data as WordPress posts with a custom post type. Best for:
- Content that benefits from the WordPress editor
- Data you want to expose to themes, other plugins, or the REST API
- Leveraging WordPress built-in features (revisions, status, author, featured image)
When you select CPT storage, a configuration panel appears where you can set the post type label, menu icon, and supported features.
Taxonomy (taxonomy)
Stores data as WordPress taxonomy terms. Best for:
- Categorization and tagging systems
- Hierarchical data (parent/child relationships)
- Shared vocabularies across post types
When you select Taxonomy storage, a configuration panel lets you specify the taxonomy slug, labels, and whether it is hierarchical.
Defining Columns
After creating a table, click it to open the Schema Editor. Click + Add Column to define each field.
Column Properties
| Property | Description |
|---|---|
| Name | The column identifier (e.g., title, price, email). Must be a valid column name. |
| Type | The data type. See the list below. |
| Nullable | Whether the column allows empty values. |
| Default | The default value when no value is provided. |
| Indexed | Adds a database index for faster queries on this column. |
| Unique | Adds a unique constraint -- no two rows can share the same value. |
Column Types
Types are organized into categories in the type dropdown.
Generic
| Type | Label | Use Case |
|---|---|---|
string | Short Text | Names, titles, short text (default type for new columns) |
text | Long Text | Descriptions, paragraphs, longer content |
integer | Number (Integer) | Counts, quantities, IDs |
float | Number (Decimal) | Prices, percentages, measurements |
bool | Yes / No | Flags, toggles, active/inactive |
Specialized
| Type | Label | Use Case |
|---|---|---|
email | Email addresses with validation | |
url | URL | Web addresses and links |
phone | Phone | Phone numbers |
color | Color | Color values (hex codes, etc.) |
image | Image URL | Image URLs and media references |
Date / Time
| Type | Label | Use Case |
|---|---|---|
date | Date | Birth dates, deadlines |
datetime | Date & Time | Timestamps, event start times |
Advanced
| Type | Label | Use Case |
|---|---|---|
json | JSON | Flexible structured data, arrays, nested objects |
richtext | Rich Text | HTML content, formatted articles |
reference | Reference | Foreign key to another table, post type, or taxonomy |
Reference Columns
When you set a column type to reference, a Target dropdown appears. You can reference:
- Another app table -- e.g.,
table:products - WordPress posts --
post_type:post - WordPress pages --
post_type:page - WordPress categories --
term:category - WordPress tags --
term:post_tag
Reference columns store the target row's ID. Use the Relation Picker widget and Lookup node to work with relationships in the UI and pipelines.
Schema Migration
When you modify columns and click Save, WP-Nexus applies the schema changes to the underlying database:
- New columns are added via
ALTER TABLE. - Removed columns are dropped.
- Type changes are applied in place where possible.
- Index and uniqueness changes are applied automatically.
WARNING
Removing a column permanently deletes all data in that column. Changing a column type may cause data loss if the existing data is incompatible with the new type.
Best Practices
- Index columns that you filter or sort by frequently -- it significantly improves query speed.
- Use
referencefor relationships instead of manually storing IDs inintegercolumns -- it enables the Relation Picker widget and the Lookup node. - Use
textfor longer content -- choose Short Text (string) for names and titles, Long Text (text) for paragraphs and descriptions. - Use
jsonsparingly -- it is flexible but harder to query and index than flat columns.