Repository navigation
Thunder.Dbf 0.1.0
The first public release.
Engine (Thunder.Dbf)
- Tables: read and write dBASE III, dBASE IV, FoxPro 2 and Visual FoxPro tables, including Visual FoxPro integer, currency, double and datetime fields, null flags and autoincrement counters.
- Memos: dBASE III and IV
.dbtand FoxPro.fptfiles, preserving dBASE IV free-block chains and FoxPro block types. - dBASE IV
.mdxindexes: read and seek, and kept exact on every append, update, delete and recall (unique tags,FORfilters, node splits, free pages), plusRebuildIndex(). - Other indexes:
- Read and seek dBASE III
.ndx, Clipper.ntxand FoxPro.cdx/.idx, all throughIDbfIndexTag. - Keep
.ndxand.ntxup to date on every write,.ntxunder Clipper's own index lock. - FoxPro
.cdx/.idxmaintenance is an opt-in preview (MaintainFoxProIndexes).
- Read and seek dBASE III
- Which indexes are kept:
- An index is kept only when it is surely the table's: the header names it, or it's named after the table, or
MaintainIndex(path)names it. - National sort orders, Clipper custom/changes-only indexes and over-wide numeric keys are refused rather than guessed at.
- After a failed index update, writes stop until
RebuildIndex().
- An index is kept only when it is surely the table's: the header names it, or it's named after the table, or
- FoxPro 2 tables that share dBASE's version byte are recognized by their
.cdx. - Expressions: a dBASE evaluator for key and
FORexpressions (UPPER,SUBSTR,DTOS,STR,VAL,IIF,DELETED()and more), with three-valued.NULL.logic. - Locking: record, header, append and table locks at dBASE, Clipper or Visual FoxPro offsets (
LockScheme), shared across every table opened in one process;LockRecord/LockTable;Refresh()to see other programs' changes. UpdateFields: changes only the named fields, re-reading the record under its lock, so concurrent edits to other fields survive.- Typed records and LINQ:
ReadAll<T>,Read<T>,AppendRecordandUpdateRecordmap records to plain C# classes.AsQueryable<T>()turns an equality on an indexed field into a seek, but only when the seek must give the same answer as a scan.Explain()shows which plan a query uses.
INDEX ONandPACK:CreateIndexTagadds.mdxtags, creating the file when needed, laid out as dBASE software writes them.Packremoves deleted records and rebuilds every index, keeping a safety copy until it's done.
- Connecting: one-line
DbfDatabase.Openfrom a folder or a connection string, read-only by default; aCheck()handshake; links and path tricks refused. - Errors:
DbfExceptionwith codes, safe messages, hints, HTTP statuses, and diagnostics kept separate for logs. - CSV: import with the column shape worked out from the data, streamed in two passes; spreadsheet-safe export.
- ADO.NET provider:
DbfConnection,DbfCommand,DbfDataReader, with index-assisted lookups,CommandTimeoutandCancel(), top-N sorts, and limits on statement size and nesting. - Code pages: over 60, including Mazovia.
- Durability: crash-safe commit order, and an
AppendRangebulk load.
SQL (Thunder.Dbf.Sql)
DbfMigrator: copies tables to SQLite, SQL Server or PostgreSQL.DbfBridge: live two-way sync with conflict policies, in one serializable SQL transaction. Deletes follow the conflict policy, a retry after a failed commit doesn't append rows twice, and a packed table is refused rather than paired up wrongly.
Web service (Thunder.Dbf.Server)
- A JSON API with hashed API keys, per-table and per-field permissions, schema validation, a two-line (intent, then done) write journal, consistent backups taken under the table lock, per-address and per-key rate limits, response-size budgets and OpenAPI.
- OpenID Connect sign-in beside API keys: bearer tokens from Entra ID, Auth0, Keycloak or any provider, checked by JwtBearer against the provider's keys and the configured audience. Roles, groups or any claim map, first match wins, to access profiles shaped like an API key's permissions; a token that maps to none gets 403. Users show up as
oidc:<sub>in the journal, logs and rate limits. Sending a key and a token together is a 400. - An OpenAPI schema per table:
GET /tables/{name}/openapiandGET /openapi/tables.jsonadd aTable_<NAME>component schema, typed from the DBF header, for each table the caller may read, without hidden fields./openapi/v1.jsonstays generic and names no tables.
Tools
thunder-dbfcommand line:check,info,import,export,migrate.- Samples, documentation, and a publish gate (editorial check, history check, CI on three operating systems, CodeQL, Dependabot, weekly maintenance).
Packages and releases
- NuGet packages
Thunder.DbfandThunder.Dbf.Sql, with XML docs for every public member, Source Link, deterministic builds and.snupkgsymbols;thunder-dbfas a .NET global tool (dotnet tool install -g thunder-dbf). - The web service as self-contained zips for Windows (x64), Linux (x64) and macOS (Apple silicon) on each GitHub release.
- A release workflow triggered by
vX.Y.Ztags: checks the tag against the version and changelog, tests, packs, publishes to nuget.org with trusted publishing (no stored API key) and creates the GitHub release with checksums. CI packs and checks the packages on every pull request.