From 65c9dd7495b5cd50769463ce50207906312a2806 Mon Sep 17 00:00:00 2001 From: draphyz Date: Thu, 19 Jul 2018 14:32:40 +0200 Subject: [PATCH 1/2] Add .vs folder to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a70839d..eb2cdd9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ Rhino.Etl.nuspec *.nupkg /Rhino-Etl-Cmd.nuspec Tools/xUnit/Aggregate.* -Tools/xUnit/users.txt \ No newline at end of file +Tools/xUnit/users.txt +.vs From 3f2eeef4e098bf6af7b07c9c181e1dc32b413f8e Mon Sep 17 00:00:00 2001 From: draphyz Date: Thu, 19 Jul 2018 14:48:08 +0200 Subject: [PATCH 2/2] Add method PrepareDatabase to OutputCommandOperation --- Rhino.Etl.Core/Operations/OutputCommandOperation.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Rhino.Etl.Core/Operations/OutputCommandOperation.cs b/Rhino.Etl.Core/Operations/OutputCommandOperation.cs index 629a16f..a05455c 100644 --- a/Rhino.Etl.Core/Operations/OutputCommandOperation.cs +++ b/Rhino.Etl.Core/Operations/OutputCommandOperation.cs @@ -39,6 +39,7 @@ public override IEnumerable Execute(IEnumerable rows) using (IDbConnection connection = Use.Connection(ConnectionStringSettings)) using (IDbTransaction transaction = BeginTransaction(connection)) { + PrepareDatabase(connection, transaction); foreach (Row row in new SingleRowEventRaisingEnumerator(this, rows)) { using (IDbCommand cmd = connection.CreateCommand()) @@ -71,5 +72,14 @@ public override IEnumerable Execute(IEnumerable rows) /// The command. /// The row. protected abstract void PrepareCommand(IDbCommand cmd, Row row); + + /// + /// Prepares the database before loading rows. + /// + /// The connection. + /// The transaction. + protected virtual void PrepareDatabase(IDbConnection connection, IDbTransaction transaction) + { + } } }