mysql.database

Undocumented in source.

Public Imports

std.variant
public import std.variant;
Undocumented in source.

Members

Classes

DatabaseException
class DatabaseException
Undocumented in source.
SelectBuilder
class SelectBuilder

WARNING: this is as susceptible to SQL injections as you would be writing it out by hand

SqlBuilder
class SqlBuilder
Undocumented in source.

Enums

UpdateOrInsertMode
enum UpdateOrInsertMode
Undocumented in source.

Functions

escapedVariants
string escapedVariants(Database db, string sql, Variant[string] t)
Undocumented in source. Be warned that the author may not have intended to support it.
escapedVariants
string escapedVariants(Database db, string sql, Variant[] t)

Note: ?n params are zero based!

fixupSqlForDataObjectUse
string fixupSqlForDataObjectUse(string sql, string[string] keyMapping)
Undocumented in source. Be warned that the author may not have intended to support it.
getCreateTable
string getCreateTable(string sql, string tableName)
Undocumented in source. Be warned that the author may not have intended to support it.
readWord
string readWord(string src)
Undocumented in source. Be warned that the author may not have intended to support it.
toSql
string toSql(Database db, Variant a)
Undocumented in source. Be warned that the author may not have intended to support it.
toSql
string toSql(string s, Database db)
Undocumented in source. Be warned that the author may not have intended to support it.
toSql
string toSql(long s, Database db)
Undocumented in source. Be warned that the author may not have intended to support it.
typeinfoBugWorkaround
void typeinfoBugWorkaround()
Undocumented in source. Be warned that the author may not have intended to support it.
updateOrInsert
int updateOrInsert(Database db, string table, string[string] values, string where, UpdateOrInsertMode mode, string key)
Undocumented in source. Be warned that the author may not have intended to support it.

Interfaces

Database
interface Database
Undocumented in source.
ResultSet
interface ResultSet
Undocumented in source.

Structs

Query
struct Query
Undocumented in source.
Row
struct Row
Undocumented in source.
StructFromCreateTable
struct StructFromCreateTable(string sql, string tableName)

Given some SQL, it finds the CREATE TABLE instruction for the given tableName. (this is so it can find one entry from a file with several SQL commands. But it may break on a complex file, so try to only feed it simple sql files.)

Templates

DataObjectFromSqlCreateTable
template DataObjectFromSqlCreateTable(string sql, string tableName)

Combines StructFromCreateTable and SimpleDataObject into a one-stop template. alias DataObjectFromSqlCreateTable(import("file.sql"), "my_table") MyTable;

Meta