SQLite3

SQLite3 database wrapper.

Constructors

this
this(string file)

Opens the given database file.

this
this(sqlite3* db)

Takes control of an existing database handle. The database will still be closed upon destruction.

Destructor

~this
~this()

Closes the database.

Members

Classes

Statement
class Statement

The database is accessed using statements.

Functions

begin
void begin()

Convenience functions for beginning, committing, or rolling back a transaction.

close
void close()

Closes the database.

commit
void commit()

Convenience functions for beginning, committing, or rolling back a transaction.

execute
uint execute(string sql, T args)

Like prepare, but ignores results and returns the number of changed rows.

open
void open(string file)

Opens or creates a database.

open
void open(sqlite3* db)

Takes control of an existing database handle. The database will still be closed upon destruction.

prepare
Statement prepare(string sql, T args)

Prepare SQL statement for multiple execution or for parameters binding.

rollback
void rollback()

Convenience functions for beginning, committing, or rolling back a transaction.

Properties

changes
uint changes [@property getter]

Returns the number of rows changed by the last statement.

handle
sqlite3* handle [@property getter]

Returns the internal handle to the SQLite3 database. This should only be used if this class does not provide the necessary functionality.

lastInsertId
ulong lastInsertId [@property getter]

Returns the ID of the last row that was inserted.

Meta