Skip to main content

topspeed 0.3.0 copy "topspeed: ^0.3.0" to clipboard
topspeed: ^0.3.0 copied to clipboard

Pure Dart reader and writer for Clarion TopSpeed (.tps) database files: tables, keys, MEMO/BLOB, code pages and encrypted files. No native code.

0.3.0 #

  • Read rows by key, like Clarion's SET/NEXT/PREVIOUS/GET, from both TpsFile and TpsReader tables: byKey (forward or reverse), seek, range, matching and get. Key values may give only the leading parts of a key; NOCASE and descending parts work as in Clarion, and raw field bytes (Uint8List) can be passed for values no Dart value reproduces. With TpsReader, a lookup reads only a few pages.
  • TpsTableDefinition.index(name) finds a key by name or label.
  • New field types: PDECIMAL (read as String, sign nibbles as the Clarion runtime writes them), BFLOAT4 and BFLOAT8 (Microsoft Binary Format, read as double). They can be written too.
  • TpsRow.toJson() returns values jsonEncode accepts.
  • Dates and times as text: formatClarionDate and formatClarionTime (patterns such as dd-MM-yyyy or h:mm a, with English or Spanish names) and formatClarionPicture (Clarion pictures @D1-@D16 and @T1-@T6). They take Clarion standard dates and times from LONG fields as well as DATE and TIME values.
  • package:topspeed/topspeed_io.dart: openTps(path) opens a reader, and readTps(path, read) reads a file a Clarion program is writing to, reading again when the file changes meanwhile. No locks are taken.
  • TpsFile.parse repairs trees that hold records out of order, keeping the copy in tree order of any record stored twice, and marks the file recovered (read-only).
  • Tools: tps_check gains --recursive and --passwords, names every skipped file, compares TpsReader with TpsFile, checks key order and key lookups, counts stale key entries and stale row counts, and lists the field types and key kinds it saw. New tps_export writes a table as CSV or JSON Lines. tps_dump reports a wrong password cleanly.

0.2.0 #

  • TpsReader reads large files a few pages at a time instead of loading them into memory. It finds rows through the page tree, so index entries are never read. It offers rowCount (from metadata), rows() (lazy, with fromRecord), row(n), MEMO and BLOB values, encrypted files and changedOnDisk. It is read-only.
  • TpsByteSource is the bytes behind a reader. TpsMemorySource works on every platform. The new library package:topspeed/topspeed_io.dart adds TpsFileSource, which reads a file on disk.
  • On a 52 MB real file with 100,960 rows and 28 keys, a full scan takes under a second with about 50 MB peak memory, against about 580 MB for TpsFile.parse. One row lookup takes about 0.1 ms.
  • Breaking: TpsRow.table is now a TpsTableInfo (number, name and definition), so rows from TpsFile and TpsReader share one type. Code that called row.table.insert(...) must keep its own TpsTable.
  • New tool: tool/tps_stream_bench.dart.

0.1.0 #

First public release.

  • Read Clarion TopSpeed (.tps) files: header, B+tree pages, RLE page compression, several tables per file, multi-block table definitions.
  • Field types BYTE, SHORT, USHORT, LONG, ULONG, SREAL, REAL, DECIMAL, DATE, TIME, STRING, CSTRING, PSTRING, PICTURE, GROUP, and DIM arrays. Unknown type codes are returned as raw bytes and do not stop the file from loading.
  • MEMO and BLOB values, assembled from their blocks.
  • Code pages: windows1252 (default), cp850, cp437, or any Encoding.
  • Encrypted files (OWNER password): read, and written back encrypted.
  • Write support: insert, update, delete, with key rebuilding (DUP, OPT, NOCASE, descending parts), unique key checks and metadata counts. indexesVerified tells whether writing a given file is safe.
  • Recovery mode: a damaged page tree is read by scanning leaf pages (read-only).
  • Helpers for Clarion standard dates and times kept in LONG fields.
2
likes
160
points
879
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Pure Dart reader and writer for Clarion TopSpeed (.tps) database files: tables, keys, MEMO/BLOB, code pages and encrypted files. No native code.

Repository (GitHub)
View/report issues

Topics

#clarion #topspeed #database #file-format #parser

License

MIT (license)

More

Packages that depend on topspeed