sqlite_open
From Liberty Unleashed Wiki
Note: This function requires the external module lu_sqlite.
This function opens an SQLite database or creates a new one.
Syntax
UserPointer sqlite_open( string filename )
Arguments
- filename - This is the filename of the previously saved database or filename for the new database
Example
For a larger example, check the general SQLite database example from the wiki tutorials.
Example 2.
This example shows how to open to a database with a single command. The command loads a previously saved database from 'database.db', or if the file doesn't exist, creates a new database.
function onConsoleInput( cmd, text ) { if ( cmd == "connectsql" ) { local db = sqlite_open( "database.db" ); print( "Opening an SQLite database..." ); } return 1; }
Notes
The call onConsoleInput was used in in this example. More info about it in corresponding page.
Related Functions
These functions are provided by the official module lu_sqlite.