I am new to xojo 2020. I have a project in mind that uses a sql database. When creating the following fields for my table: id (Integer), startingDate (Date) and amount (Double), as I save the fields get saved as: id (Boolean), startingDate (Unknown) and amount (Time). Is this a known bug or am i missing something? I tried creating the table in xojo and also tried creating the table in DataGrip (DataGrip allows me to save the fields as integers, dates and double) but when i bring the table to xojo, it converts them to boolean, unknown and time. Any guidance is greatly appreciated.
TIA.
then when is saved and reloaded, it looks like this:
Sorry about startDate and startingDate, I had to recreate the db again because I didnât take a screen shot and changed the name the second time.
I guess all people using Xojo with SQLite db is not using that feature to create the database, they should be using code to create the table or other program to create the database. You can learn more with information from the docs, examples included with Xojo, YouTube videos and the blog.
Thank you All. And yes Tim u are correct and i am aware that Date type does not exist in SQLite but if you read the a little more down the page you can see SQLite will convert (Using Type Affinity) other sql common datatype to SQLite types. For example my understanding is that Date gets converted to ânumericâ but if you see, Xojo is reading or converting it to âunknownâ. Why not to ânumericâ. The other strange case is the integer type. SQLite does understand integerâŠyet the xojo ide converts it to âbooleanâ. That to me could be a possible bug?
Well I create all my SQLite databases in code, not using the IDE at all for that. If a user runs my app and is starting from scratch, the app will create 10 databases on disk. All in code.
It is a bug in that it purports to do something, but doesnât do it well. That applies to the database editor as a whole, not just the items youâre reporting. The IDE database editor has never really worked right. I strongly recommend not using it.
Best practices are
Do not use the built-in database editor.
Do not drag a database into your project and allow the framework to manage it.
Always connect to your database in code.
Create the database in code if you donât have a 3rd party tool handy.