Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace string with const(char)[] for sql string #55

Merged
merged 1 commit into from
Feb 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/mysql/protocol/commands.d
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct Command
{
package:
Connection _con;
string _sql;
const(char)[] _sql;
uint _hStmt;
ulong _insertID;
bool _rowsPending, _headersPending, _pendingBinary, _rebound;
Expand Down Expand Up @@ -409,7 +409,7 @@ public:
* Params: con = A Connection object to communicate with the server
* sql = SQL command string.
*/
this(Connection con, string sql)
this(Connection con, const(char)[] sql)
{
_sql = sql;
this(con);
Expand All @@ -418,7 +418,7 @@ public:
@property
{
/// Get the current SQL for the Command
string sql() pure const nothrow { return _sql; }
const(char)[] sql() pure const nothrow { return _sql; }

/**
* Set a new SQL command.
Expand All @@ -434,15 +434,15 @@ public:
*
* Params: sql = SQL command string.
*/
string sql(string sql)
const(char)[] sql(const(char)[] sql)
{
if (_hStmt)
{
purgeResult();
releaseStatement();
_con.resetPacket();
}
return _sql = sql;
return this._sql = sql;
}
}

Expand Down