ascetic-soft/rowcast
Lightweight PDO DataMapper for PHP 8.4+ that maps DB rows to DTOs and back via reflection. Supports auto or explicit mappings, type conversion, and a fluent query builder with dialect-aware UPSERT.
ConnectionInterface — abstract contract for database connections, enabling custom implementations and easier testing.Connection::getDriverName() — returns the PDO driver name without accessing PDO directly.Persistence\ValueConverterInterface — extensible contract for converting PHP values to DB format (the write-side counterpart of TypeCasterInterface).Persistence\ValueConverterRegistry — chain-of-responsibility registry for value converters.Persistence\BoolValueConverter — converts bool to int (0/1).Persistence\EnumValueConverter — converts BackedEnum to its backing value.Persistence\DateTimeValueConverter — converts DateTimeInterface to a formatted string (customizable format).Persistence\DtoExtractor — extracts column/value pairs from DTO objects via Reflection.QueryBuilder\Compiler\SqlCompilerInterface — contract for SQL generation strategies.QueryBuilder\Compiler\SelectCompiler — generates SELECT SQL.QueryBuilder\Compiler\InsertCompiler — generates INSERT SQL.QueryBuilder\Compiler\UpdateCompiler — generates UPDATE SQL.QueryBuilder\Compiler\DeleteCompiler — generates DELETE SQL.DataMapper now depends on ConnectionInterface instead of the concrete Connection class.DataMapper now delegates DTO extraction to DtoExtractor and value conversion to ValueConverterInterface.DataMapper constructor accepts optional DtoExtractor and ValueConverterInterface parameters.QueryBuilder now depends on ConnectionInterface instead of the concrete Connection class.QueryBuilder::getSQL() delegates to dedicated compiler classes instead of private methods.DataMapper::extractData() — replaced by Persistence\DtoExtractor::extract().DataMapper::convertValueForDb() — replaced by Persistence\ValueConverterRegistry.QueryBuilder::getSelectSQL(), getInsertSQL(), getUpdateSQL(), getDeleteSQL() — replaced by compiler classes.How can I help you explore Laravel packages today?