Skip to content

Editing Database Data with the new Database Manager

Original guide · All levels · Database Manager

The new Database Manager in Wappler just got more great powers! Now you can edit directly your live table data! You can choose between saving the data directly in the database or as a "change" that wi

This way you can manage fully your database schema, but also make sure the right data is populated initially with the schema changes apply.

Also we have added a possibility to generate “Seeds” from the data of any database table. Seeds are used to do initial data import. So use them to save your database table data and then use it as import to a new database or database at a different target.

To edit the data of any database table, just click right on it to call the context menu and then choose View/Edit Data:
Editing Database Data

This will open a new dialog, showing empty initially.

Section titled “This will open a new dialog, showing empty initially.”

You can change the number of records to display, apply filters or just click on “Fetch Data” to get the database table record. Depending on your chaices you will see your table data

This grid works much like a spreadsheet, you just double click a column cell to edit its data.
Note columns containing the table ID are not editable.

So double click on the second column to go into inline edit mode:
Step 5

When you leave the field, you will see that the data has been changed:

Section titled “When you leave the field, you will see that the data has been changed:”

When you leave the field, you will see that the data has been changed:

You can choose to add complete new records or delete the selected:
Step 7

If you have too much columns to display, you can control which columns are displayed in the grid:
Step 8

If the table you are working on already exists in the database, you can save your edits directly, by clicking on the “Save” button

Saving directly to the Database

This will result in the live data being changed with your edits or record deletes.

Section titled “This will result in the live data being changed with your edits or record deletes.”

This is useful for initially populating your tables with some data, but in a live environment might be dangerous as you are editing the database directly.

Those edits are one time only and can’t be just repeated.

However there is another useful option “Save Changes” that won’t apply your edits directly to the database, but instead queue them as “changes” that you can save later as new Database Changes file!

Saving as Database Changes

You can close the dialog and you will see that the changes are queued for processing:
Step 13

This is particular handy when you want to make some database schema changes and then also add some initial data with them. This way you have and the database schema edits and the new data together in a single “change” file that can be applied to your current database or later to your remote live database to keep everything in sync.

Sometimes it is useful to take a copy from the data of any table and keep it as backup for later. Or to be applied as initial “seed” data on new databases. This is where “seeds” come in place.

To create a data seed - just right click on any table that you want to save its data and choose Create Seed:

Creating Data Seeds

A new dialog will popup to enter a description for your seed and choose the data dumping options.

Section titled “A new dialog will popup to enter a description for your seed and choose the data dumping options.”

A new dialog will popup to enter a description for your seed and choose the data dumping options.

the “Clear Previous Data” option means that when this data is imported to a database, any previous data from the table will be cleared first.

All your database seeds are saved under the “Seeds” branch in your Database Structure:

Applying / Importing the Seed Data

To run a specific seed, you can just right click on it, to get its context menu and then choose “Apply yhis Seed”

Step 19

If you are curious about how the seed file looks like, you can just choose the “Open In Editor” options:

Section titled “If you are curious about how the seed file looks like, you can just choose the “Open In Editor” options:”

This will apply the seed to the currently selected database. Note if you had the option “Clear Previous Data” on - then the table will be cleared first and the new data will be added after that. So be careful where you apply the seed or you might loose data!

If you are curious about how the seed file looks like, you can just choose the “Open In Editor” options:

If you are curious about how the seed file looks like, you can just choose the “Open In Editor” options:

Then the source code for this seed will be opened in Wappler’s editor:

Section titled “Then the source code for this seed will be opened in Wappler’s editor:”

As you can see live data manipulation in Wappler can be really easy with the new Database Manager.
With options to save your data changes together with schema changes, makes database migrations and upgrades really easy and save.
Seeds can be also very useful for data backup and initial import.