Skip to content

Commit e973d09

Browse files
committed
Allow config to enable compression
1 parent 6de2ee0 commit e973d09

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

docs/intro/config-file.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The InterceptDB Config file
1616
password: lulz
1717
database: production
1818
port: 3306 #optional
19+
opt_compress: false #set the MYSQL_OPT_COMPRESS option
1920
2021
statements:
2122
insertStuff: INSERT INTO table (a,b,c) VALUES (?,?,?)

src/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void Config::reloadConfig() {
7272
auto acc = mariadb::account::create(ip, user, password, database, port);
7373
acc->set_connect_option(MYSQL_SET_CHARSET_NAME, r_string("utf8mb4"sv));
7474
acc->set_connect_option(MYSQL_OPT_RECONNECT, true);
75+
if (value["opt_compress"].as<bool>(false))
76+
acc->set_connect_option(MYSQL_OPT_COMPRESS, true);
7577
//acc->set_connect_option(MARIADB_OPT_MULTI_STATEMENTS, true);
7678
//acc->set_connect_option(MARIADB_OPT_MULTI_RESULTS, true);
7779
//acc->set_auto_commit(false);

0 commit comments

Comments
 (0)