Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rowcast Laravel Package

ascetic-soft/rowcast

Rowcast is a lightweight PDO DataMapper for PHP 8.4+. It maps DB rows to DTOs via reflection with auto/explicit mapping and type conversion, plus a fluent query builder with dialect-aware UPSERT.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Justify buying this lightweight package over building a custom DataMapper/QueryBuilder for PHP 8.4+ projects, especially when:

    • Your team needs DTO hydration with type casting (e.g., converting DB 0/1 to PHP bool, JSON to array, or string timestamps to DateTime).
    • You require fluent query-building with dialect-aware features (e.g., PostgreSQL ILIKE, SQLite chunking for batch operations).
    • You want to avoid reinventing auto-mapping between snake_case DB columns and camelCase DTO properties.
    • Your roadmap includes UPSERT/merge operations or batch CRUD with parameter binding optimizations.
  • Feature Prioritization:

    • Accelerate MVP development by reducing boilerplate for CRUD operations (e.g., findOne(), batchInsert()).
    • Improve data integrity with built-in type conversion (e.g., Enum support, DateTime parsing).
    • Future-proof for multi-database support (MySQL, PostgreSQL, SQLite) with dialect-specific optimizations.
    • Enable complex queries (e.g., OR conditions, BETWEEN, LIKE) without raw SQL vulnerabilities.
  • Use Cases:

    • Internal tools: Rapidly prototype admin panels or CLI tools with typed DTOs.
    • Microservices: Standardize data access layers across services with consistent query-building.
    • Legacy modernization: Gradually replace raw PDO queries with a type-safe abstraction.
    • Testing: Use in-memory SQLite for unit tests with real query-building logic.

When to Consider This Package

  • Adopt if:

    • Your stack uses PHP 8.4+ and requires PDO (no ORM like Eloquent).
    • You need lightweight (<50KB) but feature-rich alternatives to Doctrine DBAL or raw PDO.
    • Your team prefers DTOs over active records (e.g., immutable data objects).
    • You want explicit control over SQL generation (e.g., custom WHERE clauses, JOINs via QueryBuilder).
    • Your database schema uses non-standard naming (e.g., prefixed columns like usr_email) and you need custom NameConverters.
  • Look elsewhere if:

    • You’re using PHP < 8.4 (e.g., LTS 8.1/8.2).
    • You need full ORM features (e.g., relationships, eager loading) → Use Doctrine ORM or Laravel Eloquent.
    • Your project requires active record pattern (e.g., $user->save()) → Avoid this package.
    • You need NoSQL support (e.g., MongoDB) → Use a dedicated driver.
    • Your team lacks PHP 8.4+ expertise (e.g., named arguments, enums, attributes).
    • You prioritize community adoption over a niche package (0 stars, 0 dependents as of 2026).
  • Alternatives to Evaluate:

    • Doctrine DBAL: More mature but heavier; lacks auto-mapping.
    • Cycle ORM: Lightweight but focuses on hydration, not query-building.
    • Custom PDO wrapper: If you need unique SQL logic not covered by Rowcast’s QueryBuilder.

How to Pitch It (Stakeholders)

For Executives:

*"Rowcast is a low-risk, high-reward PHP package that lets us:

  • Ship CRUD features 30% faster by reducing boilerplate for DTO mapping and queries.
  • Cut bugs with type-safe data conversion (e.g., string timestamps → DateTime objects).
  • Support multiple databases (MySQL, PostgreSQL, SQLite) with dialect-specific optimizations—without vendor lock-in.
  • Avoid technical debt by using a maintained, lightweight alternative to building our own DataMapper.

It’s not an ORM (so no bloat), but it gives us 90% of the safety and convenience of one for internal tools and microservices. The team can prototype it in a week and roll it out incrementally. Given its PHP 8.4+ focus, it aligns with our long-term stack modernization."*

For Engineers:

*"Rowcast solves three key pain points:

  1. DTO Hydration: Automatically maps DB rows to typed objects (e.g., snake_case columns → camelCase properties) with customizable type conversion (e.g., JSONarray, bool0/1).
  2. Query Safety: Fluent QueryBuilder with parameterized queries and dialect-aware SQL (e.g., PostgreSQL ILIKE, SQLite chunking for batch inserts).
  3. CRUD Simplicity: Methods like batchUpsert(), save(), and iterateAll() handle edge cases (e.g., parameter binding limits, transactions) out of the box.

Why not build it?

  • Zero maintenance overhead: It’s a single package with no external dependencies beyond PDO.
  • Tested rigorously: SQLite-backed tests cover 90% of edge cases (e.g., nested transactions, chunked batch operations).
  • Extensible: Need custom type conversion? Implement TypeConverterInterface. Non-standard column names? Use NameConverterInterface.

Migration path:

  • Start with DataMapper for simple CRUD (e.g., findOne(), insert()).
  • Adopt QueryBuilder for complex queries (e.g., OR conditions, BETWEEN).
  • Replace raw PDO in internal tools first; evaluate for APIs/services later.

Risk mitigation:

  • The package is new but stable (PHPStan level 9, CI-gated releases).
  • We can fork it if needed—it’s a single repo with clear separation of concerns (Connection → QueryBuilder → DataMapper)."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
symfony/ai-symfony-mate-extension
aashan/pimcore-mcp-bundle
solution-forest/ai-kit-core
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php