36 lines
2.8 KiB
Markdown
36 lines
2.8 KiB
Markdown
|
|
---
|
||
|
|
source_files:
|
||
|
|
- Common/DTS.CommonCore/Enums/Database/DbType.cs
|
||
|
|
generated_at: "2026-04-16T02:42:49.967232+00:00"
|
||
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||
|
|
schema_version: 1
|
||
|
|
sha256: "c0a6812741ff89b5"
|
||
|
|
---
|
||
|
|
|
||
|
|
# Database
|
||
|
|
|
||
|
|
### 1. Purpose
|
||
|
|
This module defines the `DbType` enumeration, which categorizes database instances according to their deployment and access pattern—specifically distinguishing between databases that are exclusively remote, exclusively local, or a hybrid of both. It serves as a foundational type for configuring or routing data access logic within the DTS system, enabling consistent semantic interpretation of database type across the codebase.
|
||
|
|
|
||
|
|
### 2. Public Interface
|
||
|
|
The module exposes a single public type:
|
||
|
|
|
||
|
|
- **`DbType`** (`enum`)
|
||
|
|
- `RemoteOnly = 0`: Indicates the database is accessible only via a remote connection (e.g., cloud or remote server).
|
||
|
|
- `LocalOnly = 1`: Indicates the database is accessible only locally (e.g., embedded or on-disk instance on the same machine).
|
||
|
|
- `RemoteLocalHybrid = 2`: Indicates the database supports both remote and local access modes, likely with logic to switch or synchronize between them.
|
||
|
|
|
||
|
|
### 3. Invariants
|
||
|
|
- The enum values are explicitly assigned integer constants (`0`, `1`, `2`) and must not be changed without considering serialization or persistence compatibility.
|
||
|
|
- Only the three defined values are valid; no other values are permitted by the type definition itself (though runtime casting from `int` could bypass this at compile time).
|
||
|
|
- No additional validation or runtime checks are present in this file to enforce usage constraints.
|
||
|
|
|
||
|
|
### 4. Dependencies
|
||
|
|
- **No external dependencies**: This file contains only a self-contained `enum` definition with no `using` statements or references to other types.
|
||
|
|
- **Consumers**: Based on namespace (`DTS.Common.Enums.Database`) and naming conventions, this type is likely referenced by higher-level configuration, data access, or connection management modules (e.g., `DTS.CommonCore.Data`, `DTS.Server.Database`, or similar), though such consumers are not visible in this source file.
|
||
|
|
|
||
|
|
### 5. Gotchas
|
||
|
|
- **No validation or parsing logic**: The enum does not include helper methods (e.g., `TryParse`, `IsValid`) or attributes (e.g., `[Flags]`), so callers must manually handle invalid values or parsing if needed.
|
||
|
|
- **No documentation comments**: The source lacks XML doc comments (e.g., `/// <summary>`), so semantic intent beyond the field names is not explicitly stated—e.g., it is unclear whether `RemoteLocalHybrid` implies active synchronization, fallback behavior, or dual-mode selection.
|
||
|
|
- **Potential for misuse via casting**: Since enums in C# allow casting from any `int`, invalid values (e.g., `(DbType)99`) are possible at runtime unless guarded elsewhere.
|
||
|
|
- **None identified from source alone.**
|