Skip to content

Fix provider-aware configuration validation for SQLite #26

@cursor

Description

@cursor

Problem

Documentation states SQLite only requires the Database key (file path), but DbConfiguration always requires Host, Uid, Password, and Port.

Relevant code: DBTools/Core/DbConfiguration.cs (both constructors validate all keys unconditionally).

The README SQLite example works around this by supplying dummy values:

{
  "Provider": "SQLite",
  "Host": "localhost",
  "Database": "myapp.db",
  "Uid": "unused",
  "Password": "unused",
  "Port": "0"
}

Proposed solution

Make validation provider-aware:

Provider Required keys
SQLite Database
Others Host, Database, Uid, Password, Port

Apply the same logic in both DbConfiguration() and DbConfiguration(IConfiguration).

Acceptance criteria

  • SQLite config with only Provider + Database loads successfully
  • Non-SQLite providers still require full connection settings
  • Unit tests cover SQLite-minimal and SQL Server-full validation
  • README SQLite example updated to remove dummy fields

Related

Docs: README.md, docs/QUICKSTART.md, docs/API_REFERENCE.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions