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

Laravel Tarantool Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  • The package service provider and database connection registration.
  • The custom query grammar class that overrides wrapUnion.
  • Your config/database.php Tarantool connection entry.
  • Existing query-builder or Eloquent code that uses 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.

Implementation Patterns

Use the package primarily through Laravel’s normal database APIs while keeping Tarantool-specific SQL behavior isolated.

  • Use the Tarantool connection explicitly for union queries so the package grammar is applied:
$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.

Gotchas and Tips

  • 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.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel