D2BS
Public Member Functions | Public Attributes

SQLite Class Reference

Class for dealing with an SQLite database. More...

List of all members.

Public Member Functions

 SQLite (String path=":memory:", bool autoOpen=true)
 Create a database object which can be used to open SQLite databases and execute queries.
bool execute (String queryString)
 Execute a query on the database.
DBStatement query (String sql,...)
 Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3_bind_ functions on the remaining parameters.
bool open ()
 Open the database.
bool close ()
 Close the database.

Public Attributes

String path
 Get the path used to open the database.
DBStatement[] statements
 Get all the statements that have been queried.
bool isOpen
 Whether or not the database is open.
int lastRowId
 Get the row id of the last inserted row.
double changes
 Get the number of rows modified/inserted/deleted by the last statement.

Detailed Description

Class for dealing with an SQLite database.


Constructor & Destructor Documentation

SQLite::SQLite ( String  path = ":memory:",
bool  autoOpen = true 
)

Create a database object which can be used to open SQLite databases and execute queries.

Parameters:
pathThe path to the database to open.
autoOpenWhether to open the database immediately or not.

Member Function Documentation

bool SQLite::close ( )

Close the database.

Returns:
true
bool SQLite::execute ( String  queryString)

Execute a query on the database.

Parameters:
queryStringThe query string to execute.
Returns:
true
bool SQLite::open ( )

Open the database.

Returns:
true
DBStatement SQLite::query ( String  sql,
  ... 
)

Do a sqlite3_prepare_v2 on the database with sql, then call the appropriate sqlite3_bind_ functions on the remaining parameters.

Parameters:
sqlThe query to pass to sqlite3_prepare v2.
Todo:
Determine what this function does (better documenation).
Returns:
The resulting DBStatement.