Refresh Database and Table Schema

Hi,
I’m not sure whether this is a bug or a feature, but I’m confused by the differences in behaviour of the options “Refresh Schema” clicked at the database level and the option “Refresh Schema” clicked at the Table Level. I know that bugs have been reported in the past about these functions but I thought they were solved.

I am using mySQL, Windows 10, and NodeJS.

I use Heidi, not Wappler’s database manager function, to manage my database.

WHAT I OBSERVE:

  1. Using Heidi, I added more options to an ENUM column of an existing table. The table was updated successfully.

  2. I then clicked on Wappler’s DB Manager Refresh Schema at the database level.

  3. I looked at the GIT “show changes” and see that the json file that keeps my database info (the one kept in the .wappler/targets/Development/databases folder and named after my database connection) had the section that originally defined the table I changed removed (red highlight) and that a complete new section for the same table was added later in that file (green highlight).

  4. The interesting thing is that although the table was “recreated” in that config file, it still had the old options in my enum field. So, Wappler detected that a change happened in that table (I had not dropped it and recreated it, I only changed a column as said above) but did not put it in the new database config file.

  5. It was only after I refreshed the table in Wappler’s database manager that the change I made was picked up and shown by the GIT show changes function.

I believe that this may be a bug, or a rather odd behaviour at least.

WHAT I WOULD LIKE TO SEE:
Irrespective of that, I would like to ask why having two refresh functions. If I make many changes to a database not using Wappler’s DB Manager, I don’t think it’s safe to force me to remember all the tables I touched and manually refresh each table one by one so Wappler can have an updated schema. This is not only error prone but also rather inconvenient.

IN ADDITION, TWO ENHANCEMENT REQUESTS
Please help me understand the purpose of the two refresh functions, but with my limited understanding today, I would like to request two enhancements

A) Have just one refresh option, probably placed at the database level, which when executed will pick up EVERY update made to the database.

B) That this function can be configured to execute automatically every time Wappler starts up. This is because I can’t see a reason for not having the database schema up to date at all time.

Many thanks,

Alex

Hi Alex,

I use Navicat to build and edit my databases. I simply use the database level refresh when I add a new table and the table level refresh when I make a change to a table. No issues at all.

A) I have over 100 tables in my database. Refreshing schema on all of these is totally unnecessary when I make a change to a table.

B) Please don’t do things automatically. At least have an option. Especially since I use a third party app to administer my database, I like to make sure my changes are working before I do anything drastic in Wappler. Many times I don’t want my changes to the schema pushed live until I am done.

Thx Brad,

I still think that the two refresh functions are not necessary. The difference in the number of seconds that may take Wappler to update the DB schema is worth the annoyance of not finding the fields you need when constructing a query. If you make many changes to your 100 table database, refreshing one by one is going to take you a lot longer than the time it would take Wappler to refresh the full schema. (And that’s assuming that you did not forget to refresh one or more of those tables.)

On the second point of making the refresh automatic at start up, I suggested to make it a configurable feature.

Wappler 5.8.2 release notes:

As Brad has noted, I don’t see any value in auto-refreshing the DB schema when any project is opened. Even if configurable in settings. It should be a manual on-demand task.

2 Likes

I missed the release notes that announced that functionality. Thx Sid for bringing it up.
I am fine if Wappler does not refresh the db schema at startup. The bigger ticket for me was to have a function to refresh everything and 5.8.2 seems to have it now.

Thx!

1 Like