Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Poggicek committed Nov 4, 2023
1 parent fa82c37 commit 60e8a36
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,7 @@ MySQLMM is a simple non-blocking MySQL connector for MetaMod.
# Interface

MySQLMM will expose an interface in `OnMetamodQuery` which can then be queried with `(IMySQLClient*)g_SMAPI->MetaFactory(MYSQLMM_INTERFACE, &ret, NULL);` by other plugins.

```cpp
struct MySQLConnectionInfo
{
const char* host;
const char* user;
const char* pass;
const char* database;
int port = 3306;
int timeout = 60;
};

class IMySQLConnection
{
public:
virtual void Connect(ConnectCallbackFunc callback) = 0;
virtual void Query(char* query, QueryCallbackFunc callback) = 0;
virtual void Query(const char* query, QueryCallbackFunc callback) = 0;
virtual void Destroy() = 0;
};

class IMySQLClient
{
public:
virtual IMySQLConnection* CreateMySQLConnection(MySQLConnectionInfo info) = 0;
};
```
Interface definition can be found in `src/public`.

## Compilation

Expand Down

0 comments on commit 60e8a36

Please sign in to comment.