dpgsql 1.0.2
dpgsql: ^1.0.2 copied to clipboard
High Performance PostgreSQL Driver for Dart
Changelog #
1.0.2 #
- Fixed decoding of the system-catalog string types
name(OID 19) and the internal single-byte"char"(OID 18): they were returned as raw bytes (Uint8List) instead ofString. For exampleSELECT datname FROM pg_databasenow returnsStringvalues. Also registered a textArrayHandlerforname[](OID 1003). Application string types (text,varchar,char(n)) were already handled correctly.
1.0.1 #
- Added
Use Extended Query For Unparameterized Commands, allowing ORM/query-builder workloads to use extended protocol and binary result decoding for repeated single-statement queries without parameters. - Added auto-prepare support for unparameterized
executeMaps()when extended query mode is enabled, reusing cachedRowDescriptionmetadata. - Optimized prepared
executeMaps()with cached map metadata and a specialized raw message reader for the hot path. - Added buffered backend-message draining via
PostgresMessageReader.tryReadMessage(), reducing awaits when the socket already delivered multiple PostgreSQL messages. - Reduced fixed query overhead in pooled ORM workloads with a no-reset pool fast path and synchronous safe return of pooled connections.
- Reduced per-execution overhead for unparameterized
DpgsqlCommandcalls by bypassing execution-plan allocation when no rewrite is needed. - Removed temporary
ByteData.sublistViewallocations from primitive binary input/output paths. - Improved Eloquent/SALI performance: larger AOT benchmark samples now show
dpgsqlmatching or beatingpostgresql-forkon measured real SALI queries under pool concurrency, while still trailing on theSELECT 1microcase. - Re-ran driver comparison benchmarks against
postgres_fork,postgres, PHPext-pgsql, PHPPDO_PGSQL,voryx/PgAsync, andamphp/postgres;dpgsql_aotremains ahead of Dart drivers on most result-set scenarios and wins application typed class + JSON serialization against measured PHP drivers. - Added focused tests covering the extended unparameterized query option and auto-prepared unparameterized
executeMaps().
1.0.0 #
- Added PostgreSQL real integration coverage for pipeline, COPY, pooling, encodings, notifications, error recovery, and common type decoding.
- Added GitHub Actions workflow with PostgreSQL 14, 15, 16, and 17.
- Added README documentation with installation, pooling, prepared statements, batch/pipeline, COPY, notifications, encodings, tests, and benchmarks.
- Added benchmark comparison against
postgres_fork,postgres, PHPext-pgsql, PHPPDO_PGSQL,voryx/PgAsync, andamphp/postgres. - Added application-level typed class + JSON benchmark to force PHP and Dart type conversion, object hydration, and serialization work.
- Added bundled codecs for PostgreSQL client encoding support.
- Implemented robust connection pooling with checkout wait queue, warmup, idle lifetime, connection lifetime, and pool metrics.
- Implemented lazy row decoding and fast paths for common scalar result types.
- Added typed data reader getters and optimized DataRow parsing/message reads for result-set hot paths.
- Added materialized
executeRows()and lazyexecutePgRows()result-set APIs. - Added
executeMaps(),DpgsqlDataReader.toMap(), andDpgsqlDataReader.readAllMaps()for ORM-style map rows. - Added
PgResultMode.rawTextfor PHP-styleString/nullresult access and raw text map benchmarks. - Added
DpgsqlCommand.forEachPgRow()for streaming transient lazy row views without result-list materialization. - Added configurable
TimeZoneSettingsfor UTC/default and local timestamp/date decoding, including pooled session restore forTimeZoneandclient_encoding. - Added opt-in vendored PostgreSQL/IANA timezone support for named
timestamptzdecoding without adding external runtime dependencies, withlatest_allas the robust default andIANA Time Zone Database Scope=latest_10yas the compact runtime option. - Added nullable PostgreSQL date/time infinity handling by default, with
Throw On DateTime Infinity=truefor strict behavior. - Added a pure Dart IANA timezone generator that parses
Rule,Zone, andLinkrecords withoutzic.c,package:timezone, or external reference directories; bothlatest_alland compactlatest_10ygenerated databases are supported, and the runtime-facinglatest.tzfdefault filename was removed. - Moved Dart package-driver benchmark dependencies to
benchmarks/pubspec.yamlso the main package stays free of benchmark transitive dependencies. - Added
result_sets_mapsbenchmark coverage forMap<String, dynamic>row materialization. - Added PHP associative-map benchmark coverage and 3000-row result-set scenarios.
- Added
DpgsqlCommand.forEachPgRowSync()and cached command execution plans to reduce per-row and per-execution overhead in hot paths. - Optimized repeated unprepared command planning by replacing per-execution string signatures with structural cache checks.
- Added default PostgreSQL type inference for untyped string parameters (
Infer String Parameters As Unknown=true), improving ORM compatibility for ISO timestamp strings and other context-typed columns while preserving explicitDpgsqlDbType.text/varcharbehavior. - Documented and validated Laravel/Eloquent-style
DateTimebindings: ORMs may formatDateTimeasyyyy-MM-dd HH:mm:ss, anddpgsqlkeeps those untyped strings as PostgreSQL-inferred parameters by default sotimestamp without time zonecolumns preserve wall-clock time. - Added
Decode Uuid As String=truedefault for ORM/PDO compatibility, withDecode Uuid As String=falsepreserving Npgsql-likeDpgsqlUuiddecoding. - Added parsed
json/jsonbdecoding by default for ORM/PDO compatibility with nested model maps/lists, withDecode Json As String=truepreserving raw JSON string decoding. - Added non-string configuration entry points via
DpgsqlConnection.fromConnectionStringBuilder()andDpgsqlDataSource.fromConnectionStringBuilder(), allowing integrations to pass configured settings directly instead of serializing a connection string. - Applied configured session settings (
Search Path,Application Name,Statement Timeout,Lock Timeout, andIdle In Transaction Session Timeout) directly fromDpgsqlConnectionStringBuilderfor both standalone connections and pooled data sources. - Optimized binary date/timestamp/timestamptz conversion by avoiding
Durationallocation in hot paths. - Implemented text parsing for PostgreSQL
byteaandnumeric. - Implemented text parsing for PostgreSQL range types.
- Fixed protocol recovery after
ErrorResponseduring reader initialization. - Hardened auto-prepare fallback when no safe prepared statement slot is available.
- Implemented simple and extended PostgreSQL query protocol support.
- Added parameters, prepared statements, auto-prepare cache, batch execution, and pipeline mode.
- Added binary COPY import/export support.
- Added SSL modes, SCRAM-SHA-256 authentication, cancellation, and notifications.
- Added handlers for scalar types, arrays, JSON/JSONB, geometric types, ranges, timestamps, intervals, numeric, money, and bytea.
- Added large object and logical replication scaffolding.