init
This commit is contained in:
43
DataPRO/DbAPI/Database/IDatabase.cs
Normal file
43
DataPRO/DbAPI/Database/IDatabase.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user