aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-29 21:12:47 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-07-29 21:12:47 +0300
commit08bd8bac1498b6aa3bd264e5c466dd65a4386fd2 (patch)
tree1fb311c11e4975663957aa218ab818beb90528ac /Software/Visual_Studio/FSE/Tango.FSE.Common/SQL
parentbdf7e5a2abc2c9d3b7889d2d71754c33ea3efbf6 (diff)
downloadTango-08bd8bac1498b6aa3bd264e5c466dd65a4386fd2.tar.gz
Tango-08bd8bac1498b6aa3bd264e5c466dd65a4386fd2.zip
Procedures SQL, Resources, Variables.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common/SQL')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs16
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs20
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs27
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs27
4 files changed, 90 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs
new file mode 100644
index 000000000..d3b6660bf
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/IRemoteSqlProvider.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.PPC.Shared.SQL;
+
+namespace Tango.FSE.Common.SQL
+{
+ public interface IRemoteSqlProvider
+ {
+ Task<RemoteSqlCommandResult> ExecuteSqlCommandAsync(RemoteSqlCommand command);
+
+ RemoteSqlCommandResult ExecuteSqlCommand(RemoteSqlCommand command);
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs
new file mode 100644
index 000000000..95f94ad08
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommand.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.FSE.Common.SQL
+{
+ public class RemoteSqlCommand
+ {
+ public RemoteSqlCommandMode Mode { get; set; }
+ public String SQL { get; set; }
+ public int Timeout { get; set; }
+
+ public RemoteSqlCommand()
+ {
+ Timeout = 30;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs
new file mode 100644
index 000000000..1b05e8e86
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandMode.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.FSE.Common.SQL
+{
+ /// <summary>
+ /// Represents an SQL command mode.
+ /// </summary>
+ public enum RemoteSqlCommandMode
+ {
+ /// <summary>
+ /// Executes the command against the connected local database.
+ /// </summary>
+ Local,
+ /// <summary>
+ /// Executes the command against the global Twine's database.
+ /// </summary>
+ Global,
+ /// <summary>
+ /// Executes the command against the connected machine and the global databases.
+ /// </summary>
+ Both
+ }
+}
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs
new file mode 100644
index 000000000..b4714c1aa
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/SQL/RemoteSqlCommandResult.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.FSE.Common.SQL
+{
+ public class RemoteSqlCommandResult
+ {
+ public int LocalAffectedRecords { get; set; }
+ public List<Dictionary<String, Object>> LocalRows { get; set; }
+ public bool HasLocalError { get; set; }
+ public String LocalError { get; set; }
+
+ public int GlobalAffectedRecords { get; set; }
+ public List<Dictionary<String, Object>> GlobalRows { get; set; }
+ public bool HasGlobalError { get; set; }
+ public String GlobalError { get; set; }
+
+ public RemoteSqlCommandResult()
+ {
+ LocalRows = new List<Dictionary<string, object>>();
+ GlobalRows = new List<Dictionary<string, object>>();
+ }
+ }
+}