Page 1 of 1

Internal SQLite commands

Posted: Tue Oct 07, 2008 12:09 pm
by yabune
I would like to use the internal SQLite but I'm not sure of the right syntax to create tables.

The SQLite uses the following datatypes: INTEGER, REAL, TEXT and BLOB

But in the help example of purebasic (UseSQLiteDatabase) the datatype used is: VARCHAR

What datatypes shall I use?

One more question, can I create VIEWS with internal PB SQLite? Are there any performance advantages in using VIEWS or it's just for helping in creating the select statements?

Thank you!

Posted: Tue Oct 07, 2008 1:27 pm
by Foz
With SQLite, TEXT, CHAR and VARCHAR all act the same.

Posted: Tue Oct 07, 2008 2:54 pm
by pdwyer
For the second part of the question, it doesn't have much to do with PB, the SQLite engine determines how well optimised views are compared to select statements. They would a atleast a little quicker because the select statement is compiled to a certain degree, it can also make SQL code neater and more simpler.

Since SQLite doesn't really have granular permissioning you don't get the ability to create a view for access control purposes though.

Views are all worked with in SQL though so PB's internals don't really come into the equation here.

PB internals get more involved with the I/O, data type retrieval etc and use of other SQLite APIs