sql_records 0.6.0
sql_records: ^0.6.0 copied to clipboard
A minimal, functional wrapper for SQL databases using Dart 3 records.
0.6.0 #
- BREAKING: Replaced
SQL(value)with constantSQL.NULL. - BREAKING: Dynamic commands now validate identifiers and throw
ArgumentErrorwhen names do not match[A-Za-z_][A-Za-z0-9_]*. Command.returning(...)now validates RETURNING identifiers with the same rule.- Clarified docs/specs/tests around identifier safety boundaries: dynamic command identifier handling is guarded; manual SQL string interpolation remains caller responsibility.
0.5.0 #
- BREAKING: Renamed
SafeRowtoRowandSafeResultSettoRowSet. - BREAKING: Removed
RowDatainternal interface; dialects now extendRowdirectly. - Added support for
RETURNINGclauses inInsertCommand,UpdateCommand, andDeleteCommand. - Added
command.returning(schema)method toCommand, converting a mutation into aQuery(columns are automatically inferred from the schema). - Added
DeleteCommandfor dynamic deletes by primary key. - Improved
UpdateCommandto returnNoOpCommandwhen no fields are provided, skipping DB execution. InsertCommandnow usesINSERT INTO table DEFAULT VALUESwhen all provided columns are null.- Updated
UpdateCommandandInsertCommandto hard-codeNULLwhen using theSQLwrapper to improve SQL readability and minimize parameter bindings.
0.4.0 #
- Renamed package to
sql_records. - Fixed PostgreSQL transaction implementation to correctly use
runTx. - Renamed PowerSync internal classes to avoid confusion with generic SQLite implementations.
- Removed deprecated
SqliteRecordsandSqliteRecordsReadonlytype aliases. - Cleaned up unused imports and internal fields across the package.
- Improved type safety for PostgreSQL session execution by using
SessionExecutor. - Added support for PostgreSQL via the
postgrespackage. - Added support for synchronous SQLite via the
sqlite3package. - Restructured package with engine-specific entry points:
package:sql_records/powersync.dartpackage:sql_records/sqlite.dartpackage:sql_records/postgres.dart
- Generalized
SqliteRecordstoSqlRecordsto support multiple database engines. SqliteRecordsandSqliteRecordsReadonlyare now type aliases for backward compatibility.- Introduced
MutationResultto provide a unified result forexecuteacross engines. - Internal refactoring of
SafeRowandSafeResultSetto be database-agnostic. - Improved internal structure to avoid leaking private helpers into the public API.
0.3.1 #
- Updated
parseDateTimeto support both ISO-8601 strings and epoch integers. - Added documentation for the "Inline Definition" pattern in the README.
0.3.0 #
- Added support for map literal parameters in
QueryandCommandto simplify inline definitions. - Renamed
.emptyfactory to.staticinQueryandCommandto better describe static SQL usage. - Refined README and documentation with more examples for patching and dynamic commands.
0.2.0 #
- Added
UpdateCommandfor dynamic "patch" updates that skip null parameters. - Added
InsertCommandfor dynamic inserts that only include non-null parameters. - Added
SQLwrapper to distinguish between skipping a field and explicitly setting it toNULL. - Optimized
executeBatchto support dynamic SQL generation. - Improved documentation with
llms.txtand more comprehensive README examples. - Refactored
Queryconstructor to ensure consistency (schema now follows params).
0.1.0 #
- Initial release.
- Type-safe parameters using Dart 3 records.
- Schema-aware results with
SafeRowandSafeResultSet. - Reactive query support with
watch. - Read-only and read-write transaction support.
- Convenient parsing for enums and DateTime.