Data Model
Tables store your application data. When you describe what you need, the system creates table definitions automatically in tables.bas.
What Is a Table?
A table organizes related data into rows and columns, similar to a spreadsheet.
| id | name | phone | |
|---|---|---|---|
| 1 | John Smith | 555-1234 | john@email.com |
| 2 | Maria Garcia | 555-5678 | maria@email.com |
Creating Tables
Describe what data you need to store.
Adding Fields
Add new fields to existing tables through conversation.
Field Types
| Type | Use For | Example |
|---|---|---|
STRING | Short text | Names, phones |
TEXT | Long text | Notes, descriptions |
INTEGER | Whole numbers | Age, quantity |
DECIMAL | Numbers with decimals | Price, weight |
BOOLEAN | Yes/No values | Active, completed |
DATE | Dates only | Birth date |
DATETIME | Date and time | Appointment time |
Searching Data
Use natural language to find records.
Linking Tables
Create relationships between tables.
Shared Data
All applications within a bot share the same tables. Change data in one app, and it updates everywhere.
| Concept | Description |
|---|---|
| One bot = one database | All apps share tables |
| Schema in tables.bas | Single source of truth |
| Auto-sync | Changes deploy automatically |
TABLE Keyword
Tables are defined in .gbdialog/tables.bas using the TABLE keyword:
| Syntax | Description |
|---|---|
TABLE name | Start table definition |
field AS TYPE | Define a field |
END TABLE | End table definition |
FIND Keyword
Query data using the FIND keyword:
| Syntax | Description |
|---|---|
FIND * IN table | Get all records |
FIND * IN table WHERE condition | Filter records |
FIND field1, field2 IN table | Select specific fields |
Next Steps
- Designer Guide — Modify tables through conversation
- Examples — Real-world data models