SQLite data types in Xojo

I created a database with a DB Browser for SQLite and then imported it to Xojo. Now I’m little confused, because Xojo shows different data types which I defined in SQLite browser. Here is screenshots of both programs. So the question. Does it matter if Xojo shows different types?

SQLite browser
SQLite browser

Xojo
Xojo db browser

How do you display the Xojo Types in Xojo ?

Search list of Type here:
http://documentation.xojo.com/api/databases/sqlitedatabase.html

and:
https://sqlite.org/index.html

I created a database with a DB Browser for SQLite
You can do that in Xojo, with Xojo code.

and then imported it to Xojo

do not use the xojo ide build in database editor …
you can use your created database in resource folder as template database.
or just open your database somewhere in xojo by filename in a accessible folder.
https://documentation.xojo.com/api/files/specialfolder.html
https://documentation.xojo.com/api/databases/sqlitedatabase.html#sqlitedatabase-constructor(dbfile_as_folderitem)

1 Like

I know i can do, but when i do the database in specialiced software i know what i’m doing.

Now i found solution. I copied it to build settings files and select resource folder and now it is where i want it to be. I programming as my hobby and when you to do it every know and you could forget something. Especially when i have recently developed to iOS and now trying to develope desktop.
Thank you for your help. This forum is very fast to respond.

You can create a window (or a specific project) that display your (all) SQLite Data Base contents too.
All you have to do is to follow the nstructions / provided examples to display the TABLES, and TABLE contents.

Look at:
http://documentation.xojo.com/api/databases/database.html#database-tablecolumns

for more details.

An example s provided.

Once you have the list of available TABLES (dsplayed n asnge Column ListBox), you can display the Tables contents in another ListBox and so you will know what you wrote in your .sqlite file.

You then learn a lot and no more need a specialized software to know what you’ve done.

Just a suggestion, of course.

Are-you sure you have write permissions there ?

No, because it’s an SQLite database. SQLite doesn’t really have types - you can write any value in any column. See:

https://www.sqlite.org/datatype3.html

You are right, it doesn’t work, but this does. You can learn some finnish.

App.DB = New SQLiteDatabase
App.DB.DatabaseFile = New FolderItem(“kulutusseuranta.sqlite”)

Try
If App.DB.Connect Then
EtusivuWindow.TulosField.Text = “Tietokantayhteys”
End If
Catch e as DatabaseException
MessageBox("Ei onnistunut. Virhe: " + e.Message)
Return
End try

I know that SQLite has no really types, but they are for me that i know what i’m going to do. Xojo apparently pull these types out of its hat.

Yes. I don’t know how Xojo does this mapping. Usually I just use the SQLite types but sometimes I use .BooleanValue too.