38 lines
3.0 KiB
Markdown
38 lines
3.0 KiB
Markdown
---
|
|
source_files:
|
|
- Common/DTS.Common/Enums/Database/DbType.cs
|
|
generated_at: "2026-04-16T03:19:26.434083+00:00"
|
|
model: "Qwen/Qwen3-Coder-Next-FP8"
|
|
schema_version: 1
|
|
sha256: "b5b4c7897ced9899"
|
|
---
|
|
|
|
# Database
|
|
|
|
## 1. Purpose
|
|
This module defines the `DbType` enumeration, which categorizes database configurations within the DTS system based on their deployment and access patterns—specifically whether a database is accessible only remotely, only locally, or as a hybrid of both. It serves as a foundational type for configuring, selecting, or routing database operations according to deployment topology, likely used in higher-level data access or configuration components.
|
|
|
|
## 2. Public Interface
|
|
The module exposes a single public type:
|
|
|
|
- **`DbType`** (`enum`)
|
|
- `RemoteOnly = 0`: Indicates the database is accessible *only* via remote connections (e.g., cloud-hosted, on-premises server accessed over network).
|
|
- `LocalOnly = 1`: Indicates the database is accessible *only* via local connections (e.g., embedded SQLite, local SQL Server Express instance).
|
|
- `RemoteLocalHybrid = 2`: Indicates the database supports *both* remote and local access modes, likely with logic to switch or prioritize based on context (e.g., offline-first sync scenarios).
|
|
|
|
## 3. Invariants
|
|
- The enum values are explicitly assigned integer constants (`0`, `1`, `2`) and must not be changed without coordinated updates across consumers.
|
|
- No validation or runtime enforcement is present in this file; callers are responsible for ensuring only defined values are used.
|
|
- The semantics of “remote” and “local” are implementation-contextual (e.g., “local” may mean same process/machine, but exact definition is not specified here).
|
|
|
|
## 4. Dependencies
|
|
- **No external dependencies** are declared in the source file (no `using` statements, no references to other types).
|
|
- **Consumers**: While not visible in this file, this enum is likely referenced by configuration parsers, database connection resolvers, or data access layers in other modules (e.g., `DTS.Data`, `DTS.Server`, or `DTS.Client` namespaces).
|
|
- **Depends on**: Only the .NET runtime (no explicit framework dependencies).
|
|
|
|
## 5. Gotchas
|
|
- **Ambiguity in “Hybrid” semantics**: The meaning of `RemoteLocalHybrid` is not clarified—e.g., whether it implies automatic failover, client-side routing logic, or dual-write behavior. This must be documented elsewhere.
|
|
- **No `None` or `Unknown` value**: Absence of a default/invalid state may lead to accidental misconfiguration if deserialization yields `0` (`RemoteOnly`) unintentionally.
|
|
- **Fragile numeric assignments**: Hardcoded values (`0`, `1`, `2`) could break serialization/deserialization (e.g., in JSON, config files, or databases) if reordered or extended.
|
|
- **No documentation comments**: XML doc comments are absent, so tooling cannot surface usage guidance.
|
|
- **None identified from source alone.** *(Note: While the above points are reasonable concerns, they are inferred from common patterns—not directly observable in the source.)* |