SqlDatabase

Generic SQL database. It is possible to execute queries and select queries. See specific implementations for more complex operations.

Members

Functions

alterTableAddColumn
void alterTableAddColumn(string table, InitInfo.Field field)
Undocumented in source. Be warned that the author may not have intended to support it.
alterTableColumn
void alterTableColumn(string table, InitInfo.Field field, bool typeChanged, bool nullableChanged)
Undocumented in source.
alterTableDropColumn
void alterTableDropColumn(string table, string column)
Undocumented in source. Be warned that the author may not have intended to support it.
createTable
void createTable(string table, string[] fields)
Undocumented in source. Be warned that the author may not have intended to support it.
deleteImpl
void deleteImpl(string table, Clause.Where where)
Undocumented in source. Be warned that the author may not have intended to support it.
drop
void drop(string table)
Undocumented in source. Be warned that the author may not have intended to support it.
dropIfExists
void dropIfExists(string table)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeDate
string escapeDate(std.datetime.Date value)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeDateTime
string escapeDateTime(std.datetime.DateTime value)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeString
string escapeString(string value)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeTime
string escapeTime(std.datetime.TimeOfDay value)
Undocumented in source. Be warned that the author may not have intended to support it.
generateField
string generateField(InitInfo.Field field)
Undocumented in source.
getTableInfo
TableInfo[string] getTableInfo(string table)
glueToString
string glueToString(Clause.Where.Glue glue)
Undocumented in source. Be warned that the author may not have intended to support it.
initImpl
void initImpl(InitInfo initInfo)
Undocumented in source. Be warned that the author may not have intended to support it.
insertImpl
Result insertImpl(InsertInfo insertInfo)
Undocumented in source. Be warned that the author may not have intended to support it.
insertInto
Result insertInto(string table, string[] names, string[] fields, string[] primaryKeys)
Undocumented in source.
operatorToString
string operatorToString(Clause.Where.Operator operator)
Undocumented in source. Be warned that the author may not have intended to support it.
query
void query(string )

Runs a query without receiving anything back. Note that running just this method may break some implementations.

querySelect
Result querySelect(string )

Runs a select query and returns the result. This method does not break the flow of the protocol like query does. This method is intended for usage with complex queries.

selectImpl
Result selectImpl(SelectInfo selectInfo, Select select)
Undocumented in source. Be warned that the author may not have intended to support it.
stringifyStatements
string stringifyStatements(Clause.Where.GenericStatement statement)
Undocumented in source. Be warned that the author may not have intended to support it.
updateImpl
void updateImpl(UpdateInfo updateInfo, Clause.Where where)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

randomFunction
string randomFunction [@property getter]
Undocumented in source.

Structs

Prepared
struct Prepared

Utilities for prepared statements.

TableInfo
struct TableInfo
Undocumented in source.

Inherited Members

From Database

connect
void connect(string db, string user, string password)
void connect(string password)

Performs authentication and connect to a database. It is possible to reconnect using the same object by calling close and then connect again.

connectImpl
void connectImpl(string db, string user, string password)
Undocumented in source.
db
string db [@property getter]

Indicates the name of the database opened or null if the database isn't connected.

close
void close()

Closes the connection with the database. Should only be called after connect.

closeImpl
void closeImpl()
Undocumented in source.
init
void init()

Initializes an entity, either by creating it or updating its fields when it already exists.

initImpl
void initImpl(InitInfo )
Undocumented in source.
InitInfo
struct InitInfo
Undocumented in source.
Select
struct Select

Clauses for select. It is possible to instantiate the struct with the parameters in any order.

select
T[] select(Select select)

Selects entities from the database using the optional given clauses. The name of the fields should correspond to the name of the entity's fields in the database, not to the ones in the D program.

selectOne
T selectOne(Select select)

Selects one entity from the database.

selectId
T selectId(T entity, Select select)

Selects an entity from its primary key(s).

selectImpl
Result selectImpl(SelectInfo , Select )
Undocumented in source.
SelectInfo
struct SelectInfo
Undocumented in source.
insert
void insert(T entity, bool updateId)

Inserts a new entity into the database. This method does not alter the entity: to update it after an insert use select.

insertImpl
Result insertImpl(InsertInfo )
Undocumented in source.
InsertInfo
struct InsertInfo
Undocumented in source.
update
void update(T entity, Clause.Where where)

Updates one or more table fields. The given fields should correspond to the ones in the entity class, not to the ones in the database.

update
void update(T entity)

Updates a single row of a table searching by the entity's primary key(s).

updateImpl
void updateImpl(UpdateInfo , Clause.Where )
Undocumented in source.
UpdateInfo
struct UpdateInfo
Undocumented in source.
del
void del(string table, Clause.Where where)

Deletes row from a table.

del
void del(T entity)

Deletes zero or one row using the entity's primary key(s).

deleteImpl
void deleteImpl(string , Clause.Where )
Undocumented in source.
dropIfExists
void dropIfExists(string table)

Deletes a table if exists.

drop
void drop(string table)

Deletes a table. May throw an exception if the table does not exist.

Result
struct Result

Result of a select query.

Type
enum Type
Undocumented in source.
escape
string escape(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
escapeString
string escapeString(string )
Undocumented in source.
escapeBinary
string escapeBinary(ubyte[] )
Undocumented in source.
escapeDate
string escapeDate(std.datetime.Date )
Undocumented in source.
escapeDateTime
string escapeDateTime(std.datetime.DateTime )
Undocumented in source.
escapeTime
string escapeTime(std.datetime.TimeOfDay )
Undocumented in source.

Meta