Skip to main content

logd_sqlite 0.1.8 copy "logd_sqlite: ^0.1.8" to clipboard
logd_sqlite: ^0.1.8 copied to clipboard

High-performance SQLite log sink for logd featuring WAL mode, prepared statements, atomic transaction batching, retention policies, and full-text search.

0.1.8 #

  • Documentation: Added official high-DPI hero branding and SQLite WAL query showcase asset.

0.1.7 #

  • Security & SQL Injection Prevention:
    • Enforced strict table name validation using regex ^[a-zA-Z_][a-zA-Z0-9_]*$, preventing SQL identifier injection via untrusted table names across DDL, index creation, DML, and query statements.
  • Memory Safety & Backpressure Protection:
    • Introduced configurable maxBufferSize (defaulting to 10,000 entries) in SqliteSink and SqliteHandler. Evicts oldest buffered log entries when write backpressure or disk latency saturates memory, preventing OutOfMemory errors during crash storms.
    • Added positive validation checks for maxEntries and maxBufferSize.
  • Concurrency & Reentrancy Hardening:
    • Replaced unawaited microtask flush() invocations across synchronous query and utility APIs (queryLogs(), fetchLevelCounts(), fetchDistinctLoggerNames(), count(), vacuum()) with synchronous FFI transaction execution (_flushSync()), guaranteeing zero race conditions and eliminating stale query reads.
    • Added _inTransaction reentrancy lock preventing transaction collisions (cannot start a transaction within a transaction) during concurrent flushes.
    • Added PRAGMA busy_timeout = 5000; on database initialization to gracefully wait out transient SQLite locks.
  • Isolate Lifecycle & Startup Queue:
    • Implemented an internal startup buffer in SqliteIsolateHandler so entries logged while the worker isolate is spawning are preserved and drained cleanly, resolving a critical issue where early logs were dropped upon disposal.
    • Implemented handshake protocol and startup error propagation between worker isolate and parent isolate, preventing infinite hangs on worker spawn failure.
  • Serialization & Error Resilience:
    • Added safe JSON serialization with toEncodable: (o) => o.toString() for LogEntry.context, preventing crashes from non-primitive or cyclic objects.
    • Made disposal idempotent with _ensureNotDisposed() guarding state and preventing use-after-free exceptions.
  • Dependency Alignment: Updated minimum logd dependency constraint to ^0.10.2.

0.1.6 #

  • Dependency Alignment: Updated logd dependency constraint to ^0.10.0.

0.1.5 #

  • logd v0.10.x Support: Widened dependency constraint to logd: '>=0.9.7 <0.11.0', enabling seamless compatibility with logd v0.10.0's pure semantic engine.
  • Documentation: Updated migration and usage guides for logd v0.10.0+ integration.

0.1.4 #

  • Async Isolate Support (SqliteHandler.async): Added SqliteHandler.async() static factory method allowing SQLite log persistence to run on background isolates without blocking main event loops.
  • Direct Formatter & Decorator Transfer: Supports direct transfer of @immutable LogFormatter and LogDecorator instances across isolates without JSON serialization overhead.
  • Lifecycle Hardening & Race-Free dispose(): Awaits isolate initialization before executing teardown, eliminating race conditions during immediate shutdown and preventing locked database file handles on Windows.
  • Sequential Queue Processing: Worker isolate processes incoming log entries sequentially via await for, guaranteeing all pending entries flush to SQLite before database connection closure.
  • Serialization Support: Added registerLogdSqliteSerializers() to register SqliteSink with LoggerSerializationRegistry for Logger.exportConfig() and Logger.importConfig().
  • Cross-Satellite Matrix Testing: Added end-to-end integration tests validating concurrent SqliteHandler.async logging with MarkdownFormatter, HtmlFormatter, and ToonFormatter.
  • Documentation: Added doc/architecture.md, doc/benchmarks.md, and doc/migration_guide.md.
  • Updated Dependencies: Updated logd dependency constraint to ^0.9.7.

0.1.3 #

  • Pub.dev Score & Lower-Bound Analysis Fixes:
    • Updated sqlite3 lower bound constraint to ^3.0.0 to resolve PreparedStatement.close() lower-bound compatibility under dart pub downgrade analysis.
    • Added explicit platforms section in pubspec.yaml for android, ios, linux, macos, and windows native OS targets.

0.1.2 #

  • ADR-006 {Target}Handler Alignment:
    • Introduced SqliteHandler convenience subclass extending Handler (SqliteHandler(), SqliteHandler.inMemory(), and SqliteHandler.database()).
    • Added direct sqliteSink getter on SqliteHandler for rich query engine access (queryLogs(), fetchLevelCounts(), fetchDistinctLoggerNames()).
    • Updated logd dependency constraint to ^0.9.3.
  • sqlite3 3.x & Native Assets Modernization:
    • Updated sqlite3 version constraint to '>=2.4.0 <4.0.0', fully supporting sqlite3 3.x releases.
    • Leveraged Dart Native Assets build hooks, removing obsolete manual dynamic library overrides (open.overrideFor).
    • Updated statement and database disposal lifecycle calls to .close().

0.1.1 #

  • Pub.dev Maintenance & Score Fixes:
    • Added library-level documentation comment to logd_sqlite primary export.
    • Added example/example.dart standard example entrypoint for pub.dev automated score discovery.
    • Updated pubspec.yaml repository and homepage URLs to valid HTTP 200 endpoints.
    • Updated sqlite3 dependency version constraint to '>=2.4.0 <4.0.0' supporting both 2.x and 3.x releases.
    • Updated logd dependency constraint to ^0.9.2.

0.1.0 #

  • Initial release of logd_sqlite, a dedicated satellite package providing production-grade SQLite persistence logging for logd.
  • SqliteSink: High-performance LogSink<LogDocument> supporting:
    • Pre-compiled prepared statement reuse across all log writes.
    • Write-Ahead Logging (WAL mode) and synchronous pragma optimizations.
    • Atomic transaction batching (batchSize, flushInterval).
    • Full entry field fidelity (timestamp, level, logger_name, origin, message, error, stack_trace, context_json).
    • Auto-pruning retention policies (maxEntries, maxAge).
    • Rich query engine (queryLogs) supporting level filtering, logger namespace matching, full-text search, and pagination.
    • Inspection helpers fetchLevelCounts() and fetchDistinctLoggerNames().
    • Database utilities count(), clear(), vacuum(), and flush().
  • Examples & Showcase:
    • example.dart: Standard usage entrypoint for log write, query engine, and level breakdown.
    • sqlite_sink_showcase.dart: Top-to-bottom telemetry simulation and query engine proof-of-concept.
    • sqlite_interactive_dashboard.dart: Interactive REPL CLI dashboard with level counts, discovered namespaces, and throughput benchmarking.
4
likes
0
points
896
downloads

Documentation

Documentation

Publisher

verified publisherpccria.dev

Weekly Downloads

High-performance SQLite log sink for logd featuring WAL mode, prepared statements, atomic transaction batching, retention policies, and full-text search.

Repository (GitHub)
View/report issues

Topics

#logging #sqlite #persistence #database #structured-logging

License

unknown (license)

Dependencies

logd, meta, sqlite3

More

Packages that depend on logd_sqlite