Boolean transforming to integers / number in Wappler and not refering to boolean type in wappler

Wappler Version : 3.8.3 onwards including 3.9.1
Operating System : OSX 11.2.3
Server Model: NodeJs
Database Type: MYSQL8
Hosting Type: Docker (on local machine)

Expected behavior

What do you think should happen?

When creating a boolean field type it should be saved as a boolean field type and shoule be rpresented in queries and a boolean field type.

Actual behavior

What actually happens?

Wappler chnages the Boolean filed to type to “Integer” and in query manager shows the field type as number. However, when looking at the filed type in Navicat it shows the filed type as tinyint.

This has started to occur from wappler 3.8.3 and onward and is still present in the current version 3.9.1

How to reproduce

I only noticed this starting after refreshing the schema while using 3.8.3.

Attached below is the video of it occurring while creating a new boolean field in Wappler 3.9.1 it shows all the # Integer fields which used to be Boolean and creating a new boolean field.

The following images is an example showing a query created before version 3.8.3 and it is correctly showing the field type as they were before the change - Boolean.

The screen image below shows the query shown when creating in version 3.8.3+ and shows the same fields now changing to “Number”

The following image shows how they are represented in Navicat vs Wappler

I have tried reconnecting refreshing and reinstalling and it still occurs I can not create a Boolean or change Integer Fields back to Boolean in Wappler.

Looking at Navicat it looks like it is creating the fields correctly but is not being referenced correctly in Wappler.

As MySQL doesn’t have a built-in Boolean type I thought a workaround would be to use TinyInt but this is not available in list of types in Database Manager

TinyInt columns I created outside Wappler (using Navicat) are show as Boolean in Database Manager. I think if you choose Boolean as the type, a TinyInt column will be created.

Update: I just tried this out of curiosity. A TinyInt column is created. However, it shows in Wappler as type: Integer. Strangely, other TinyInt columns in the same table now show as Integer, not Boolean. Other tables still display the tick symbol (indicating Boolean), for such fields. I must have updated something by trying it out. I don’t use Database Manager to making changes usually.

I can’t swear to it but I thought that TinyInt used to be a type option in Database Manager. Now that it is no longer available (for MySQL at least) I guess Integer becomes the catch all option. It does look like a bug in Database Manager though. I’ll just have to check there are no consequences in my server actions. I’m not sure if it’s the same issue but I have seen other threads where something similar appears to have affected actions.

This is the issue reported in this bug report :grinning:

So it is :slightly_smiling_face:. It’s one of those topics that’s going round in circles. I think I intially raised the issue, or a closely-related one here, and it’s been mentioned here too. It’s quite confusing. I think it’s progressed since the initial bug report and actually now works fine (for me anyway) - if you don’t use Database Manager (or perhaps even if you do, if a tinyint field is what you want anyway).

1 Like

This will be solved in the next update. Now we will correctly recognize the MySQL tinyint(1) as boolean and regular tinyint as integer in the Database Manager

4 Likes

This was fixed in Wappler 3.9.2

1 Like