chocofamilyme/laravel-tarantool
Laravel integration for Tarantool that lets you use the in-memory database with Eloquent-style models, a query builder, migrations, and queue support, making it easy to add fast Tarantool storage to your existing Laravel application.
This assessment covers the Tarantool Laravel database integration as of release 1.1.2. The release is a query-grammar compatibility fix: it overrides Laravel’s default wrapUnion behavior and removes parentheses around union subqueries, matching how Tarantool expects UNION queries to be written.
Start by reviewing:
wrapUnion.config/database.php Tarantool connection entry.union() or unionAll().Minimal first use case: configure a Tarantool connection, run a simple select, then run a query-builder union and inspect the generated SQL.
DB::connection('tarantool')->table('users')->select('id', 'name')->get();
$query = DB::connection('tarantool')
->table('users')
->select('id', 'name')
->union(DB::connection('tarantool')->table('archived_users')->select('id', 'name'));
dump($query->toSql());
Confirm that the union SQL does not wrap the union subquery in parentheses. That is the main behavior introduced by 1.1.2.
Use the package primarily through Laravel’s normal database APIs while keeping Tarantool-specific SQL behavior isolated.
$connection = DB::connection('tarantool');
$results = $connection
->table('active_users')
->select('id', 'name')
->unionAll(
$connection->table('archived_users')->select('id', 'name')
)
->get();
Inspect generated SQL before shipping union-heavy code. Because 1.1.2 changes how union subqueries are wrapped, use toSql() in tests or local debugging to verify Tarantool-compatible output.
Keep complex union queries in repositories or query objects. This makes it easier to adjust for Tarantool’s SQL dialect without scattering driver-specific assumptions through controllers or models.
Prefer query-builder unions over hand-written SQL where practical. The package’s grammar override is specifically there to make Laravel’s query builder produce Tarantool-compatible union SQL.
Test nested and combined unions carefully. If you combine union, orderBy, limit, or nested union queries, verify the final SQL against Tarantool. Removing parentheses can change how a query reads, even when it is valid for Tarantool.
Use DB::listen() or query logging when validating integration behavior, especially after upgrading to 1.1.2.
1.1.2 changes generated SQL for unions. Any tests or snapshots that assert exact union SQL may need updating. The change removes parentheses around union subqueries to match Tarantool’s syntax.
Do not assume MySQL/PostgreSQL union syntax applies. Tarantool’s UNION handling differs; the package override exists because Laravel’s default parenthesized union output is not appropriate here.
Check the connection grammar. If union queries still include parentheses, confirm the query is running through the Tarantool connection and that the package grammar override is active.
Watch union precedence. Parentheses are often used to control precedence in complex unions. Since 1.1.2 removes them around union subqueries, test queries that mix unions with ordering, limits, or nested selects.
Use toSql() first when debugging. It is the fastest way to see whether the package’s wrapUnion override is producing the SQL you expect.
Clear cached config after changing connection settings. Laravel may cache database configuration, which can make grammar or connection changes appear ineffective.
Extension point: if you need different union wrapping for a custom connection or query grammar, subclass the package grammar rather than patching vendor code. Keep custom grammar behavior scoped to the Tarantool connection.
Upgrade note: 1.1.2 is best treated as a compatibility fix rather than a new feature. The main review task is ensuring existing union queries and SQL assertions still behave correctly under Tarantool’s parenthesis-free union syntax.
How can I help you explore Laravel packages today?