|
LifeLua 21-08-2025
Documentation for LifeLua, a Lua interpreter for the PS Vita
|
SQLite databases. More...
Every function that takes a database as its first parameter can also be called as a method, e.g. db:query(sql) and db:close(). Databases are also closed automatically when they're no longer used.
Functions | |
| sqlite3 | sqlite3.open (string path, number mode) |
| table | sqlite3.query (sqlite3 db, string sql) |
| nil | sqlite3.close (sqlite3 db) |
Open modes | |
Used with sqlite3.open(). Combine several of them by adding them together. | |
| number | SQLITE_OPEN_READONLY |
| Open the database for reading only. | |
| number | SQLITE_OPEN_READWRITE |
| Open the database for reading and writing. | |
| number | SQLITE_OPEN_CREATE |
| Create the database if it doesn't exist (use together with SQLITE_OPEN_READWRITE) | |
| number | SQLITE_OPEN_URI |
Allow the path to be a file: URI. | |
| number | SQLITE_OPEN_NOMUTEX |
| Multi-thread mode. | |
| number | SQLITE_OPEN_FULLMUTEX |
| Serialized mode (safe to use from several threads) | |
| nil sqlite3.close | ( | sqlite3 | db | ) |
Closes a database
Method form: db:close()
| db | The database |
| sqlite3 sqlite3.open | ( | string | path, |
| number | mode ) |
Opens a database file
| path | Path to the database file |
| mode | How to open it, one or more of the open mode constants added together (optional, default: SQLITE_OPEN_READWRITE + SQLITE_OPEN_CREATE) |
| table sqlite3.query | ( | sqlite3 | db, |
| string | sql ) |
Runs one or more SQL statements
Method form: db:query(sql)
| db | The database |
| sql | The SQL to run |
tonumber() for numbers), and SQL NULL values are nil. Raises an error if the SQL fails.