mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Empty registration of the MySQL statement and result set.
This commit is contained in:
parent
525148ccd1
commit
201a6e0016
@ -44,7 +44,7 @@ CSStr Connection::ToString() const
|
||||
ToStringF("%s:%s@%s:%u", m_Handle->mUser.c_str(), m_Handle->mPass.c_str(),
|
||||
m_Handle->mHost.c_str(), m_Handle->mPort);
|
||||
}
|
||||
// Default to an epty string
|
||||
// Default to an empty string
|
||||
return _SC("");
|
||||
}
|
||||
|
||||
|
@ -248,6 +248,32 @@ void RegisterAPI(HSQUIRRELVM vm)
|
||||
.Func(_SC("Transaction"), &Connection::GetTransaction)
|
||||
);
|
||||
|
||||
sqlns.Bind(_SC("Statement"), Class< Statement >(vm, _SC("SqMySQLStatement"))
|
||||
// Constructors
|
||||
.Ctor()
|
||||
// Core Meta-methods
|
||||
.Func(_SC("_cmp"), &Statement::Cmp)
|
||||
.SquirrelFunc(_SC("_typename"), &Statement::Typename)
|
||||
.Func(_SC("_tostring"), &Statement::ToString)
|
||||
// Properties
|
||||
//.Prop(_SC("Connected"), &Statement::Connected)
|
||||
// Member Methods
|
||||
//.Func(_SC("Disconnect"), &Statement::Disconnect)
|
||||
);
|
||||
|
||||
sqlns.Bind(_SC("ResultSet"), Class< ResultSet >(vm, _SC("SqMySQLResultSet"))
|
||||
// Constructors
|
||||
.Ctor()
|
||||
// Core Meta-methods
|
||||
.Func(_SC("_cmp"), &ResultSet::Cmp)
|
||||
.SquirrelFunc(_SC("_typename"), &ResultSet::Typename)
|
||||
.Func(_SC("_tostring"), &ResultSet::ToString)
|
||||
// Properties
|
||||
//.Prop(_SC("Connected"), &ResultSet::Connected)
|
||||
// Member Methods
|
||||
//.Func(_SC("Disconnect"), &ResultSet::Disconnect)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
} // Namespace:: SqMod
|
||||
|
@ -29,6 +29,18 @@ Int32 ResultSet::Cmp(const ResultSet & o) const
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSStr ResultSet::ToString() const
|
||||
{
|
||||
// Do we have a valid handle?
|
||||
if (m_Handle)
|
||||
{
|
||||
ToStrF("%u", m_Handle->mFieldCount);
|
||||
}
|
||||
// Default to an empty string
|
||||
return _SC("");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SQInteger ResultSet::GetInt8(Uint32 idx) const
|
||||
{
|
||||
|
@ -33,6 +33,18 @@ Int32 Statement::Cmp(const Statement & o) const
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
CSStr Statement::ToString() const
|
||||
{
|
||||
// Do we have a valid handle?
|
||||
if (m_Handle)
|
||||
{
|
||||
m_Handle->mQuery.c_str();
|
||||
}
|
||||
// Default to an empty string
|
||||
return _SC("");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Statement::Statement()
|
||||
: m_Handle()
|
||||
|
Loading…
Reference in New Issue
Block a user