SQLite3 Functions

<< Click to Display Table of Contents >>

Navigation:  Multi-Protocol MasterOPC Server > Lua 5.1 Reference Manual > LuaSQLite3 Reference Manual >

SQLite3 Functions

SQLite3 Functions

mbul_mail sqlite3.complete

mbul_mail sqlite3.open

mbul_mail sqlite3.open_memory

mbul_mail sqlite3.temp_directory

mbul_mail sqlite3.version

sqlite3.complete

sqlite3.complete(sql)

Returns TRUE if the string sql comprises one or more complete SQL statements and FALSE otherwise.

sqlite3.open

sqlite3.open(filename)

Opens (or creates if it does not exist) an SQLite database with name filename and returns its handle as userdata (the returned object should be used for all further method calls in connection with this specific database, see Database Methods ). Example:

myDB=sqlite3.open('MyDatabase.sqlite3') -- open

-- do some database calls...

myDB:close() -- close

In case of an error, the function returns nil, an error code and an error message.

sqlite3.open_memory

sqlite3.open_memory()

Opens an SQLite database in memory and returns its handle as userdata. In case of an error, the function returns nil, an error code and an error message. (In-memory databases are volatile as they are never stored on disk.)

sqlite3.temp_directory

sqlite3.temp_directory([temp])

Sets or queries the directory used by SQLite for temporary files. If string temp is a directory name or nil, the temporary directory is set accordingly and the old value is returned. If temp is missing, the function simply returns the current temporary directory.

sqlite3.version

sqlite3.version()

Returns a string with SQLite version information, in the form ’x.y[.z]’.