- this
this(string host, string user, string pwd, string db, ushort port, SvrCapFlags capFlags)
this(MySQLSocketType socketType, string host, string user, string pwd, string db, ushort port, SvrCapFlags capFlags)
this(OpenSocketCallbackPhobos openSocket, string host, string user, string pwd, string db, ushort port, SvrCapFlags capFlags)
this(OpenSocketCallbackVibeD openSocket, string host, string user, string pwd, string db, ushort port, SvrCapFlags capFlags)
this(string cs, SvrCapFlags capFlags)
this(MySQLSocketType socketType, string cs, SvrCapFlags capFlags)
this(OpenSocketCallbackPhobos openSocket, string cs, SvrCapFlags capFlags)
this(OpenSocketCallbackVibeD openSocket, string cs, SvrCapFlags capFlags)
Construct opened connection.
- acquire
void acquire()
Used by Vibe.d's ConnectionPool, ignore this.
- acquire
void acquire()
- amOwner
bool amOwner()
Used by Vibe.d's ConnectionPool, ignore this.
- authenticate
void authenticate(ubyte[] greeting)
Undocumented in source.
- autoPurge
void autoPurge()
Called whenever mysql-native needs to send a command to the server
and be sure there aren't any pending results (which would prevent
a new command from being sent).
- buildAuthPacket
ubyte[] buildAuthPacket(ubyte[] token)
Undocumented in source.
- bumpPacket
void bumpPacket()
Undocumented in source. Be warned that the author may not have intended to support it.
- close
void close()
Explicitly close the connection.
- connect
void connect(SvrCapFlags clientCapabilities)
Undocumented in source.
- consumeServerInfo
void consumeServerInfo(ubyte[] packet)
Undocumented in source. Be warned that the author may not have intended to support it.
- enableMultiStatements
void enableMultiStatements(bool on)
Enable multiple statement commands
- getCmdResponse
OKErrorPacket getCmdResponse(bool asString)
Undocumented in source. Be warned that the author may not have intended to support it.
- getCommonCapabilities
SvrCapFlags getCommonCapabilities(SvrCapFlags server, SvrCapFlags client)
Undocumented in source. Be warned that the author may not have intended to support it.
- getNextRow
Row getNextRow()
Get the next Row of a pending result set.
- getPacket
ubyte[] getPacket()
Undocumented in source. Be warned that the author may not have intended to support it.
- initConnection
void initConnection()
Undocumented in source. Be warned that the author may not have intended to support it.
- isOwner
bool isOwner()
Used by Vibe.d's ConnectionPool, ignore this.
- kill
void kill()
Forcefully close the socket without sending the quit command.
Needed in case an error leaves communatations in an undefined or non-recoverable state.
- makeToken
ubyte[] makeToken(ubyte[] authBuf)
Undocumented in source. Be warned that the author may not have intended to support it.
- parseGreeting
ubyte[] parseGreeting()
Undocumented in source. Be warned that the author may not have intended to support it.
- pingServer
OKErrorPacket pingServer()
- purgeResult
ulong purgeResult()
Flush any outstanding result set elements.
- reconnect
void reconnect()
void reconnect(SvrCapFlags clientCapabilities)
Reconnects to the server using the same connection settings originally
used to create the Connection.
- refreshServer
OKErrorPacket refreshServer(RefreshFlags flags)
Refresh some feature(s) of the server.
- release
void release()
Used by Vibe.d's ConnectionPool, ignore this.
- resetPacket
void resetPacket()
Undocumented in source. Be warned that the author may not have intended to support it.
- selectDB
void selectDB(string dbName)
Select a current database.
- send
void send(const(ubyte)[] packet)
Undocumented in source.
- send
void send(const(ubyte)[] header, const(ubyte)[] data)
Undocumented in source.
- sendCmd
void sendCmd(CommandType cmd, const(T)[] data)
Undocumented in source.
- serverStats
string serverStats()
Get a textual report on the server status.
- setClientFlags
void setClientFlags(SvrCapFlags capFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
- charSet
ubyte charSet [@property getter]
- closed
bool closed [@property getter]
Check whether this Connection is still connected to the server, or if
the connection has been closed.
- currentDB
string currentDB [@property getter]
- hasPending
bool hasPending [@property getter]
Gets whether anything (rows, headers or binary) is pending.
New commands cannot be sent on a conncection while anything is pending.
- lastCommandID
ulong lastCommandID [@property getter]
This gets incremented every time a command is issued or results are purged,
so a ResultRange can tell whether it's been invalidated.
- lastInsertID
ulong lastInsertID [@property getter]
After a command that inserted a row into a table with an auto-increment
ID column, this method allows you to retrieve the last insert ID.
- pktNumber
ubyte pktNumber [@property getter]
ordering. First packet should have 0
- protocol
ubyte protocol [@property getter]
Return the in-force protocol number
- resultFieldDescriptions
FieldDescription[] resultFieldDescriptions [@property getter]
Gets the result header's field descriptions.
- rowsPending
bool rowsPending [@property getter]
Gets whether rows are pending
- serverCapabilities
uint serverCapabilities [@property getter]
- serverStatus
ushort serverStatus [@property getter]
- serverVersion
string serverVersion [@property getter]
- socketType
MySQLSocketType socketType [@property getter]
A class representing a database connection.
If you are using Vibe.d, consider using mysql.pool.MySQLPool instead of creating a new Connection directly. That will provide certain benefits, such as reusing old connections and automatic cleanup (no need to close the connection when done).