hypervel / database
The Hypervel Database package.
0.4.x-dev
2026-10-26 10:49 UTC
Requires
- php: ^8.4
- ext-filter: *
- ext-pdo: *
- ext-swoole: ^6.3.0RC1
- brick/math: ^1.0
- hypervel/broadcasting: ^0.4
- hypervel/collections: ^0.4
- hypervel/conditionable: ^0.4
- hypervel/connection-pool: ^0.4
- hypervel/console: ^0.4
- hypervel/container: ^0.4
- hypervel/context: ^0.4
- hypervel/contracts: ^0.4
- hypervel/coordinator: ^0.4
- hypervel/core: ^0.4
- hypervel/coroutine: ^0.4
- hypervel/engine: ^0.4
- hypervel/events: ^0.4
- hypervel/filesystem: ^0.4
- hypervel/http: ^0.4
- hypervel/macroable: ^0.4
- hypervel/pagination: ^0.4
- hypervel/prompts: ^0.4
- hypervel/queue: ^0.4
- hypervel/support: ^0.4
- nesbot/carbon: ^3.13.1
- psr/log: ^3.0
- symfony/console: ^8.1.2
- symfony/finder: ^8.1
- symfony/polyfill-php86: ^1.36
- symfony/process: ^8.1
Requires (Dev)
- fakerphp/faker: ^1.24
- phpstan/phpstan: 2.3.1
Suggests
- fakerphp/faker: Required to use Eloquent model factories (^1.24).
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 07:30:58 UTC
README
Documentation: https://hypervel.org/docs/database
Differences From Laravel
- PDO connections require exception mode so failed statements cannot silently continue. Warning and silent options are rejected when connecting; custom connectors and supplied handles must honor the same requirement. See PDO error mode.
- Default retry and lost-connection detection recognizes PDO failures, not arbitrary exception text. Non-PDO drivers provide their own policies through the existing detector bindings; see detecting database failures.
DB::transaction()throws if its closure manually ends the transaction it owns. Lettransaction()manage completion, or use the manual transaction API separately. Balanced nested transactions remain supported; see database transactions.- Transaction records use the resolved connection's
getNameWithReadWriteType(), not its basegetName(), so distinct base, read and write sessions own separate callbacks. Extensions inspecting transaction records must compare against the resolved owner's full name. - SQLite requires 3.32.0 or later rather than Laravel's 3.26.0 minimum, so framework code assumes the newer default limit of 32,766 bindings per statement.
- Outgoing framework HTTP requests return idle database sessions to their pools. Code using temporary tables, session locks or retained raw PDOs across these calls must use
withPinnedSession(); ordinary queries and active transactions keep their behavior. See releasing and pinning connections. - MySQL and MariaDB connections require
strictormodesin their configuration instead of implicitly inheriting the server's SQL mode, so SQL literals can be escaped correctly. - Laravel's external database pooler support uses a
::directconnection suffix. Hypervel instead uses normal named connections for each endpoint andmigrations_connectionfor schema and migration paths. This keeps direct and pooled endpoints as normal configured connections with their own pool settings, so Hypervel does not support Laravel's::directsuffix. - Laravel exposes PDO methods on its base connection class. Hypervel's base
Connectionis driver-neutral, while PDO-backed drivers extendPdoConnection. Code that requires direct PDO access should accept or narrow toPdoConnection. When bringing in Laravel database updates, keep driver-neutral connection behavior onConnection, PDO mechanics onPdoConnection, and driver-specific behavior on the matching connection, grammar, schema builder, or processor. - Hypervel provides
BinaryParameterfor explicitly binding already-encoded binary strings in query builder operations and Eloquent key helpers. Laravel has no equivalent wrapper. - Laravel's
migrate:freshcommand wipes only its selected connection. Hypervel discovers the connection declared by each migration and wipes every resolved target before rebuilding the schema. - Laravel's deprecated database-inspection forwarding helpers are intentionally not ported. Extensions can call
ConnectionInterface::getDriverTitle()andthreadCount()directly. - Laravel's remaining directly deprecated Database compatibility forwarders are intentionally not ported. Use the current class-keyed factory resolver, schema blueprint and grammar APIs, and correctly named PostgreSQL truncation method instead.
- Laravel's
ConnectionResolveris a simple registry of connection instances. Hypervel'sConnectionResolveris the pooled resolver built by the container, so it has no array constructor oraddConnection()method. Tests that inject existing connections can mockConnectionResolverInterface, while tests that need real configured connections can use the Capsule manager. - Laravel's Capsule manager exposes a
setFetchMode()method that writes configuration its connections do not read. Hypervel omits this ineffective connection-wide setter; useQuery\Builder::fetchUsing()for each query that needs a custom row shape. make:migrationomits Laravel's deprecated--fullpathoption and obsolete Composer constructor dependency because migration creation no longer dumps autoload files.Blueprint::dropForeign()widens Laravel's method signature with an optional constraint name when columns are supplied, allowing explicitly named foreign keys to be dropped portably across SQLite and the server databases. CustomBlueprintsubclasses that override this method must accept the optional second argument.- Eloquent models that override
CREATED_ATorUPDATED_ATmust declare the compatible?stringconstant type, such aspublic const ?string UPDATED_AT = null;. Laravel's constants are untyped, but omitting the type from an override in Hypervel causes a fatal error. - Eloquent expression plucks use
Query\Builder::pluckWithColumn()to retain the returned field name for casts and accessors. Custom query builders overridingpluck()must also overridepluckWithColumn()to customize this path. String-based Eloquent plucks still callpluck(). - Eloquent's protected
refreshSavedAttributes()method receives the raw attribute values each write stored, so configured attributes are refreshed from the row that write changed. Models that override this method must accept thearray $attributesargument. - Eloquent
updateFrom()maintains the model'supdated_attimestamp, likeupdate(). Laravel forwards this method without adding a timestamp. BelongsToManyrecords pivot filters in an ordered$pivotConstraintslist instead of Laravel's$pivotWheres,$pivotWhereIns, and$pivotWhereNullsproperties. Relationship extensions should use thewherePivot*methods instead of accessing those arrays.
Ported from: https://github.com/laravel/framework