Reading and writing to a flat sqlite3 table
vonstorm
Member Posts: 66
Been away a bit and now see that EE uses sqlite3 natively. I looked for some in-depth notes on how this is done but can't seem to find any. I did read that it converts get/set campaign var to sqlite3 but can't see how this breaks down into table name etc, or if it supports SQL queries. Can anyone point me in the right direction?
0
Comments
First, create a database by running that command in a module, yes it's a little weird that you have to run (just F9 to test the module) the module first but that seems to be the way to do it. After that you can edit the database file in an external tool like SQLiteStudio to create and populate your own tables.
Then you can issue sql commands against it in nwscript.
Here is some ugly sample code. Image an sqlite3 file with a recipes table in it with multiple string columns such as Name, Description and an integer column numberOfItems.