summaryrefslogtreecommitdiff
path: root/libmysqlpp/embeddedmy-connection.cpp
blob: f0bb24d9aff54314da86dfbeb3444e0c673ad25f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "embeddedmy-connection.h"

NAMEDFACTORY("embeddedmysql", MySQL::Embedded::Connection, DB::ConnectionFactory);

namespace MySQL {
	namespace Embedded {
		Connection::Connection(const std::string &)
		{
			mysql_init(&conn);
			mysql_options(&conn, MYSQL_OPT_USE_EMBEDDED_CONNECTION, NULL);
			if (mysql_real_connect(&conn, NULL, NULL, NULL, "database1", 0, NULL, 0)) {
				throw MySQL::Error(&conn);
			}
		}
	}
}