In this tutorial, you’ll learn how to modify data in your database using Deflatable’s no-code interface. We’ll add new records, edit existing ones, and explore relationships between tables.
What You’ll Learn¶
Adding new rows to a table
Editing existing records
Working with foreign key relationships
Understanding validation
Prerequisites¶
Completed the Getting Started tutorial
Have the grocery database from the previous tutorial
Starting Point¶
Launch Deflatable with the grocery database:
deflatable grocery.yamlYou should see the Aisle and Product tables.
Adding Your First Row¶
Let’s add a new aisle to the grocery store.
Step 1: Navigate to the Aisle Table¶
Make sure you’re on the “Aisle” tab. If not, press Tab or click on it.
Step 2: Press the Add Row Key¶
Press + (the plus key). You should see a modal window titled “Add Row to aisle”.
Step 3: Fill in the Fields¶
You’ll see input fields for each column:
Id: Shows “(auto)” - this will be automatically generated by the database
Length Feet: Enter
55.0Refrigerated: Enter
1(for yes/true)Has Endcaps: Enter
0(for no/false)
Note: The Id field shows “(auto)” because this table uses auto-increment for its primary key. Some tables may require you to provide the primary key value manually (like UUIDs or composite keys).
Step 4: Submit the Form¶
Click the “Add Row” button or press Tab to focus it, then Enter.
The modal closes and you should see your new aisle (ID 4) appear in the table!
Understanding What Happened¶
When you submitted the form:
Deflatable validated your input (checking that required fields were filled)
Generated a SQL INSERT statement behind the scenes
Executed it against your database
Refreshed the table to show the new data
You never had to write SQL - Deflatable handled it all.
Adding a Related Record¶
Now let’s add a product that references the aisle we just created. This demonstrates foreign key relationships.
Step 1: Switch to Product Table¶
Press Tab to switch to the “Product” tab.
Step 2: Open Add Row Form¶
Press + to open the add row modal.
Step 3: Notice the Foreign Key Field¶
Look at the “Aisle Id” field. Instead of a text input, you see a dropdown menu!
This dropdown shows:
(none)- for no relationshipAisle 1- the first aisleAisle 2- the second aisleAisle 3- the third aisleAisle 4- the aisle we just created
Deflatable automatically:
Detected that
aisle_idis a foreign keyQueried the referenced table
Populated a dropdown with meaningful names instead of just IDs
Step 4: Fill in Product Details¶
Id: (auto)
Name:
YogurtAisle Id: Select “Aisle 2” from the dropdown
Price:
4.49
Step 5: Submit¶
Click “Add Row” or tab to the button and press Enter.
Your new yogurt product appears in the table, and notice the “Aisle Id” column shows “Aisle 2” instead of just the number “2”.
Editing an Existing Row¶
Let’s say the price of milk changed. Here’s how to update it.
Step 1: Find the Milk Row¶
Use the arrow keys to navigate to the “Milk” row, or press / and search for “milk”.
Step 2: Open the Edit Form¶
With the cursor on the Milk row, press e (or double-click the row with your mouse).
A modal opens titled “Edit Row in product”.
Step 3: Notice the Differences¶
In edit mode:
The Id field shows the current value and is read-only (you can’t change primary keys)
All other fields are pre-filled with current values
The button says “Save Changes” instead of “Add Row”
Step 4: Change the Price¶
Tab to the “Price” field and change it from 3.49 to 3.99.
Step 5: Save Changes¶
Click “Save Changes” or press Enter.
The modal closes and the table updates to show the new price.
Working with Optional Fields¶
Some fields allow NULL values (they’re optional). Let’s see how this works.
Step 1: Add a Product Without an Aisle¶
Press + to add a new product:
Name:
Shopping BagAisle Id: Select
(none)from the dropdownPrice:
0.10
Step 2: Submit¶
The product is added successfully even though it has no aisle relationship.
In the table, the “Aisle Id” column for this row will be empty, indicating NULL.
Common Mistakes and How to Avoid Them¶
Forgetting Required Fields¶
Try adding a product without a name:
Press
+Leave “Name” empty
Set “Price” to
1.99Try to submit
You’ll get an error: “Missing required field: Name”
Required fields (marked NOT NULL in the database) must have values.
Invalid Data Types¶
Try entering text where a number is expected:
Press
+Enter “Name”:
TestEnter “Price”:
abcTry to submit
You’ll get an error about invalid data.
What You’ve Accomplished¶
Added a new row to a table
Edited an existing record
Worked with foreign key dropdowns
Understood required vs. optional fields
Handled validation errors
Key Takeaways¶
No SQL Required: You modified database records without writing a single SQL query.
Foreign Keys Are Easy: Deflatable automatically creates dropdowns for relationships, showing meaningful names.
Validation Helps: The form validates your input before touching the database.
Primary Keys Protected: You can’t accidentally change a primary key when editing.
Next Steps¶
Now that you can add and edit data, try:
Filtering and Sorting: Learn to find specific records quickly
Using Record Links: Display data from related tables inline
Understanding Views and State: Learn how Deflatable manages configurations
Practice Exercise¶
Try these on your own:
Add 3 more products in different aisles
Edit one of the aisles to change its length
Add a product with no aisle assignment
Find a product using search and update its price
The more you practice, the faster you’ll become at navigating and editing your databases!