SQLiter Tutorial
BlitzMax Forums/BlitzMax Tutorials/SQLiter Tutorial
| ||
SQLiter is an even more easier way to operate with SQLite databases. If you are afraid of pointers and callback functions in function calls then this one is for you. All the 'ugly' is stuff is made by SQLiter. SQLiter Tutorial I also recomend Assari's SQLite tutorial. It's very good and will give you good information about the bare bones. |
| ||
René!!! THANKS for this awesome tutorial and mod!!! You and Teamonkey have made my life way easier now! |
| ||
Your very welcome. |
| ||
Hey I have a question. Is it possible to enummerate all the column names of a table? I'm trying to create a copy of a table, and I want to cycle through all column names of the existing table, and manually create another table with the same column names. The MySQL Copy table function: CREATE TABLE new_table SELECT * FROM old_table; would be perfect, but it seems SQLite doesn't have the equivalent. Thanks for any help! |
| ||
There's an example in this tutorial on how to cycle thru the columns. See how the Callback function prints out all the column names. |
| ||
Thanks Assari! |
| ||
Ooops! I meant in SQLiter! I havent messed with the raw SQLite stuff. :) "If you are afraid of pointers and callback functions in function calls then this one is for you. All the 'ugly' is stuff is made by SQLiter." I am afraid of callbacks! Hehehehe! |
| ||
Booticus, give it a go. If you go thru the tutorial starting from Part 1, you'll be surprised how easy it is. |
| ||
*looks warily at SQLite mod* OOOKKKKKKKK, I'll see what I can come up with..... ;) |
| ||
Hey Booticus, sorry, I was out of office for some days. If you still want to try with SQLiter this would be very easy. Use TSQLiter.query_col_list. This list holds the name of every column involved in the last query. So to get all column names you should query something like "SELECT * FROM test_table". The asterisk ensures that all columns are involved. The following example works with the test table that comes with the SQLiter package. SuperStrict Import pyropixel.sqliter 'Create new SQLite Object Global db:TSQLiter = New TSQLiter 'Open Database File db.Open("test.db") 'A query db.Query("SELECT * FROM test_table") 'Print out all column name For Local c:String = EachIn TSQLiter.query_col_list DebugLog "Column:"+ c Next 'Close database db.Close() End |
| ||
Hi there, use version 1.02 of SQLiter. The new version offers some new methods to explore and read database schemes. Now it should be easy to read all infos from a database to copy it for example. |
| ||
EXCELLENT!! thank you!! |
| ||
I've extracted the rar in C:\Program Files\BlitzMax\mod but i'm getting error: Can't find interface for module 'pyropixel.sqliter' What have i done wrong? |
| ||
Sorry, on the website I did not mention,that you have to compile the module with BlitzMax' bmk tool. Do you now how to compile a module? Otherwise I could send you a compiled module. Which OS do you use? |
| ||
Ahhhh, ok. I'm sorted now. Thanks. :D |
| ||
My question is; Doesn't the end-user have to have MySQL installed for this to work? Does this framework automatically package mysql? |
| ||
No, SQLite does not need a server system. Everything is file based. SQLite does not use MySQL in any way. MySQL and SQLite are both database systems that use SQL as their query language. MySQL needs a server, SQLite does not. Therefore the SQL command set of SQLite does not support as many SQL commands as MySQL does. But that should be only a problem for very complicated database operations. |
| ||
"....SQLite does not need a server system. Everything is file based. SQLite does not use MySQL in any way." THATS why I was so pleased with SQLite as an option. The power and flexibility of SQL without the hassle of installing a "server" app on the local machine. René has been very helpful to me and my questions too. Anyone who hasn't tried SQLiter out yet is definitely missing out on a fun experience! |
| ||
Rene this looks fantastic... I just wish I could use it in B3D or B+!!! oh well anothe reason to upgrade. |
| ||
I missed this thread the first time around -- certainly looks like a very interesting module, especially since it seems to allow you to create a DB on the fly in RAM as well, and use it to organize data for your application. |