Weave 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
Agents
ascetic-soft/rowcast
claude-code
cursor
database
orm
php
pdo
datamapper
mapping
dto
hydration
query-builder
type-casting

Rowcast Agent Notes

Install
php artisan boost:add-skill ascetic-soft/rowcast

Save this content to: AGENTS.md

# Rowcast Agent Notes

## Runtime + Scope
- This is a single-package PHP library, not a workspace/monorepo.
- Requires PHP 8.4+ and `ext-pdo`.
- Main public surfaces live under `src/Connection.php`, `src/DataMapper.php`, `src/Mapping.php`, and `src/QueryBuilder/`.

## Commands
- Install deps: `make install` or `composer install`
- Run the standard local gate in CI order: `make ci`
- Individual checks:
  - `make cs-check`
  - `make phpstan`
  - `make test`
- Auto-fix style: `make cs-fix`
- Run one test file: `vendor/bin/phpunit tests/V2DataMapperTest.php`
- Run one test method: `vendor/bin/phpunit tests/V2DataMapperTest.php --filter testBatchUpsertSupportsChunkingOnSqlite`

## Verification Order
- Match CI order when verifying broad changes: `cs-check -> phpstan -> test`
- The pre-commit hook is not equivalent to CI: it runs `php-cs-fixer fix`, stages updates for already tracked files with `git add -u`, then runs PHPStan. It does not run PHPUnit.

## Code Layout
- `DataMapper` is the orchestration layer for hydrate/extract/query flow; it delegates naming, mapping, extraction, hydration, and WHERE-building rather than implementing those rules inline.
- `Connection` is the PDO wrapper and the factory for `QueryBuilder`; query-builder behavior should usually be changed in `src/QueryBuilder/`, not by adding SQL assembly to `Connection`.
- SQL dialect differences are centralized in `src/QueryBuilder/Dialect/`. `DialectFactory` maps only `mysql`, `pgsql`, and `sqlite`; everything else falls back to `GenericDialect`.

## Repo-Specific Behavior
- Passing a DTO class-string target to `DataMapper` uses `TargetResolver` table-name derivation from the DTO short class name: CamelCase -> snake_case plural (`UserDto` -> `user_dtos`).
- Explicit table names for writes/reads are supported by passing a plain string target; column/property overrides and opt-in explicit field lists go through `Mapping`.
- Batch insert/upsert/update behavior is dialect-aware. SQLite tests exercise chunking explicitly because the SQLite dialect bind-parameter limit is `999`.
- Nested transactions are opt-in via `new Connection($pdo, true)` or `Connection::create(..., nestTransactions: true)` and use savepoints.

## Testing Reality
- The test suite is fast and self-contained: tests use in-memory SQLite (`sqlite::memory:`) rather than external services.
- QueryBuilder and DataMapper changes should usually be covered by or updated alongside the SQLite-backed tests in `tests/QueryBuilder/` and `tests/V2DataMapperTest.php` / `tests/ConnectionEdgeCasesTest.php`.

## Artifacts
- `composer.lock` is gitignored in this library repo.
- Generated local artifacts to ignore/include carefully when reviewing changes: `vendor/`, `.phpunit.cache/`, `.php-cs-fixer.cache`, `coverage.xml`, `build/`.

Rowcast Agent Notes

Runtime + Scope

  • This is a single-package PHP library, not a workspace/monorepo.
  • Requires PHP 8.4+ and ext-pdo.
  • Main public surfaces live under src/Connection.php, src/DataMapper.php, src/Mapping.php, and src/QueryBuilder/.

Commands

  • Install deps: make install or composer install
  • Run the standard local gate in CI order: make ci
  • Individual checks:
    • make cs-check
    • make phpstan
    • make test
  • Auto-fix style: make cs-fix
  • Run one test file: vendor/bin/phpunit tests/V2DataMapperTest.php
  • Run one test method: vendor/bin/phpunit tests/V2DataMapperTest.php --filter testBatchUpsertSupportsChunkingOnSqlite

Verification Order

  • Match CI order when verifying broad changes: cs-check -> phpstan -> test
  • The pre-commit hook is not equivalent to CI: it runs php-cs-fixer fix, stages updates for already tracked files with git add -u, then runs PHPStan. It does not run PHPUnit.

Code Layout

  • DataMapper is the orchestration layer for hydrate/extract/query flow; it delegates naming, mapping, extraction, hydration, and WHERE-building rather than implementing those rules inline.
  • Connection is the PDO wrapper and the factory for QueryBuilder; query-builder behavior should usually be changed in src/QueryBuilder/, not by adding SQL assembly to Connection.
  • SQL dialect differences are centralized in src/QueryBuilder/Dialect/. DialectFactory maps only mysql, pgsql, and sqlite; everything else falls back to GenericDialect.

Repo-Specific Behavior

  • Passing a DTO class-string target to DataMapper uses TargetResolver table-name derivation from the DTO short class name: CamelCase -> snake_case plural (UserDto -> user_dtos).
  • Explicit table names for writes/reads are supported by passing a plain string target; column/property overrides and opt-in explicit field lists go through Mapping.
  • Batch insert/upsert/update behavior is dialect-aware. SQLite tests exercise chunking explicitly because the SQLite dialect bind-parameter limit is 999.
  • Nested transactions are opt-in via new Connection($pdo, true) or Connection::create(..., nestTransactions: true) and use savepoints.

Testing Reality

  • The test suite is fast and self-contained: tests use in-memory SQLite (sqlite::memory:) rather than external services.
  • QueryBuilder and DataMapper changes should usually be covered by or updated alongside the SQLite-backed tests in tests/QueryBuilder/ and tests/V2DataMapperTest.php / tests/ConnectionEdgeCasesTest.php.

Artifacts

  • composer.lock is gitignored in this library repo.
  • Generated local artifacts to ignore/include carefully when reviewing changes: vendor/, .phpunit.cache/, .php-cs-fixer.cache, coverage.xml, build/.
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.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table