aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 21:51:38 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 21:51:38 +0200
commitdf2f9b27b12356d6e92c64a72049f0fc4e6b86c0 (patch)
tree049ced63087ef30986cc998f8546071e5894e37e /Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs
parent7060dc80c707fc0441ff69fe4f899107cb3f6fc1 (diff)
downloadTango-df2f9b27b12356d6e92c64a72049f0fc4e6b86c0.tar.gz
Tango-df2f9b27b12356d6e92c64a72049f0fc4e6b86c0.zip
Started Remote <=> Local Synchronization... /;
Diffstat (limited to 'Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs')
-rw-r--r--Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs93
1 files changed, 93 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs b/Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs
new file mode 100644
index 000000000..7e53aeb1c
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Synchronization/Local/ILocalDataBase.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Synchronization.Local
+{
+ /// <summary>
+ /// Represents an SQL data base adapter used by <see cref="LocalDBComparer"/>.
+ /// </summary>
+ /// <seealso cref="System.IDisposable" />
+ public interface ILocalDataBase : IDisposable
+ {
+ /// <summary>
+ /// Gets the database source URL/File.
+ /// </summary>
+ String Source { get; }
+
+ /// <summary>
+ /// Gets the database tables collection.
+ /// </summary>
+ List<DataTable> Tables { get; }
+
+ /// <summary>
+ /// Loads the tables (Must be done before any synchronization).
+ /// </summary>
+ void LoadTables();
+
+ /// <summary>
+ /// Clones a table from another database into this database.
+ /// </summary>
+ /// <param name="otherDB">The other database.</param>
+ /// <param name="otherTable">The other table.</param>
+ /// <returns></returns>
+ DataTable CloneTableFrom(ILocalDataBase otherDB, DataTable otherTable);
+
+ /// <summary>
+ /// Gets the SQL command for <see cref="CloneTableFrom(ILocalDataBase, DataTable)"/>.
+ /// </summary>
+ /// <param name="otherDB">The other database.</param>
+ /// <param name="otherTable">The other table.</param>
+ /// <returns></returns>
+ String GetCloneTableFromCommand(ILocalDataBase otherDB, DataTable otherTable);
+
+ /// <summary>
+ /// Adds the specified column to the specified table.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="column">The column.</param>
+ /// <returns></returns>
+ DataColumn AddColumn(DataTable table, DataColumn column);
+
+ /// <summary>
+ /// Gets the SQL command for <see cref="AddColumn(DataTable, DataColumn)"/>.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="column">The column.</param>
+ /// <returns></returns>
+ String GetAddColumnCommand(DataTable table, DataColumn column);
+
+ /// <summary>
+ /// Adds the specified row to the specified table.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="row">The row.</param>
+ void AddRow(DataTable table, DataRow row);
+
+ /// <summary>
+ /// Gets the SQL command for <see cref="AddRow(DataTable, DataRow)"/>.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="row">The row.</param>
+ /// <returns></returns>
+ String GetAddRowCommand(DataTable table, DataRow row);
+
+ /// <summary>
+ /// Updates the matching row by the row GUID.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="row">The row.</param>
+ void UpdateRow(DataTable table, DataRow row);
+
+ /// <summary>
+ /// Gets the SQL command for <see cref="UpdateRow(DataTable, DataRow)"/>.
+ /// </summary>
+ /// <param name="table">The table.</param>
+ /// <param name="row">The row.</param>
+ /// <returns></returns>
+ String GetUpdateRowCommand(DataTable table, DataRow row);
+ }
+}