This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
using DbAPI.Connections;
using DbAPI.User;
using DTS.Common.Interface.Database;
using System;
namespace DbAPI.Database
{
/// <summary>
/// Database related functions (InsertVersion, GetDatabaseVersion)
/// </summary>
public interface IDatabase
{
int GetSQLVersion(IConnectionDetails connection);
/// <summary>
/// retrieves the highest database version for a given database
/// User must be logged into database
/// </summary>
/// <param name="user">DataPRO user retrieving information</param>
/// <param name="connection">Database connection info</param>
/// <param name="version"></param>
/// <returns>0 (ERROR_SUCCESS) on success, all other values are errors
/// returns ERROR_ACCESS_DENIED if user is not logged in</returns>
ulong GetDatabaseVersion(IUserDbRecord user, IConnectionDetails connection, out int version);
/// <summary>
/// inserts a database version record into a given database
/// User must be logged into database
/// does not check if version is already in the database or the relation of the version
/// number to any versions in the database
/// </summary>
/// <param name="user">user inserting new record</param>
/// <param name="connection">database connection details</param>
/// <param name="version">version number to insert</param>
/// <param name="step">step number to insert</param>
/// <param name="date">DateTime to put on the inserted record</param>
/// <param name="remarks">Remarks to record with insert</param>
/// <param name="userField">What user to associate with the insert record (does not have to match any actual users)</param>
/// <returns>0 (ERROR_SUCCESS) on success, all other values are errors
/// returns ERROR_ACCESS_DENIED if user is not logged in</returns>
ulong InsertDatabaseVersion(IUserDbRecord user, IConnectionDetails connection,
int version, int step, DateTime date, string remarks, string userField);
}
}