Data Modeler translate booleans

I generated an Entities unit for an SQLITE database using Data Modeler. All the fields defined as Booleans by sqlite were exported as Strings by TMS Data Modeler.  This is causing an error because what is actually in the field is an integer with 0 = False and 1 = True.  I could go through and redefine those fields as Integers, and Data Modeler would put them out as integers.  I am wondering, though, if Data Modeler could translate sqlite Booleans (0, 1) into Pascal Booleans (True/False, Yes/No)?

Thank you so much.
-Jon G

Further research: I manually converted the generated entities.pas unit so that boolean field types were used and it worked great.  The grids knew that the field type was True/False and displayed correctly. 

I made a similar experience when usiing the Data Modeler with my MySQL database which uses tinyint(1) as a Boolean field (somebody used Access to alter the table structure and Access stores Booleans that way - MySQL itself doesn't have a Boolean field type). This can be easily modified in the TMS Aurelius Export Dialog. Simply switch to the Mappings Tab and change the Mapping to the desired Property Type for the field in the table. That will generate the unit file properly without the need to manually convert the field types in the unit file. The Mappings are stored in the project.

1 Like


How you defined the booleans? I have the same problem, 1 and 0 in the MySQL DB...

I believe he's referring to this "Property Type" field where you can manually define the Delphi type of the field/property being generated.

1 Like

But I'm searching for a way to have Delphi boolean and MySQL Field that is TinyInt and has 0 or 1 as velue.

So, just type "Boolean" in the "Property Type" field, isn't it?