Files
DP44/docs/ai/DataPRO/DbAPI.md
2026-04-17 14:55:32 -04:00

1.6 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/DbAPI/DbAPI.cs
2026-04-17T15:59:50.596613+00:00 zai-org/GLM-5-FP8 1 bc000aec064c94e0

DbAPI Documentation

1. Purpose

The DbAPI class serves as the primary facade and entry point for database operations within the DataPRO system. It provides centralized access to various domain-specific database interfaces (Connections, Database, DAS, Sensors, Channels, Groups, etc.) through static properties, implements a stored procedure versioning system to handle client/server database version compatibility, and manages logging initialization for database operations.

2. Public Interface

Static Methods

Method Signature Description
GetStoredProcedureToUse ulong GetStoredProcedureToUse(IConnectionDetails connection, string storedProcedure, int clientDbVersion, out int storedProcedureVersionToUse) Determines the appropriate stored procedure version by comparing client and server database versions, returning the minimum. Calls GetDatabaseVersion then GetStoredProcedureVersion.
GetStoredProcedureToUseCached ulong GetStoredProcedureToUseCached(IConnectionDetails connection, string storedProcedure, int clientDbVersion, out int storedProcedureVersionToUse) Same as GetStoredProcedureToUse but caches results in an internal dictionary keyed by stored procedure name, client version, and connection.ConnectionDbVersion.
GetDatabaseVersion ulong GetDatabaseVersion(IConnectionDetails connection, out int serverDbVersion) Executes sp_DbVersionGet stored procedure and returns the maximum version