summaryrefslogtreecommitdiff
path: root/kurier/MySQL.cs
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-13 10:47:27 +0200
committeremkael <emkael@tlen.pl>2018-10-13 10:47:27 +0200
commita1fe3a079bc5186b212cd484b527a9b01f2d0920 (patch)
tree11bfbe9e35cadc020ffd96e60724c0e40547201a /kurier/MySQL.cs
parent51d31a9451c6ecdda114dd0c4a0a556bebedc19a (diff)
Using MysqlBackup.NET to dump the database
Diffstat (limited to 'kurier/MySQL.cs')
-rw-r--r--kurier/MySQL.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/kurier/MySQL.cs b/kurier/MySQL.cs
index 81a3a0b..88b4fbf 100644
--- a/kurier/MySQL.cs
+++ b/kurier/MySQL.cs
@@ -8,6 +8,7 @@ namespace kurier
public class MySQL
{
private MySqlConnection conn;
+ private MySqlCommand cmd;
private string database;
public MySQL(string database)
@@ -72,5 +73,14 @@ namespace kurier
public static string getPass() { return Properties.Settings.Default.PASS; }
public static string getPort() { return Properties.Settings.Default.PORT; }
public static bool getConfigured() { return Properties.Settings.Default.CONFIGURED; }
+
+ internal void backup(string filePath)
+ {
+ cmd = new MySqlCommand();
+ cmd.Connection = conn;
+ MySqlBackup backup = new MySqlBackup(cmd);
+ backup.ExportInfo.AddCreateDatabase = true;
+ backup.ExportToFile(filePath);
+ }
}
}