- How do I install the SingleStoreDB Laravel driver?
- Run `composer require singlestoredb/singlestoredb-laravel` and update your Laravel `config/database.php` to use the `singlestoredb` connection driver instead of `mysql`. No additional setup is needed for basic functionality, though you may configure persistent connections or SSL for production.
- Does this driver support Laravel’s Eloquent ORM?
- Yes, it fully supports Eloquent and extends it with SingleStore-specific features like shard keys, sort keys, and columnstore/rowstore table types. You can define these in migrations or model events without breaking existing Eloquent workflows.
- Can I use this driver with Laravel 10 and PHP 8.2?
- The package is tested against a matrix of Laravel and PHP versions, including Laravel 10 and PHP 8.2. Check the [GitHub Actions workflow](https://github.com/singlestoredb-labs/singlestoredb-laravel-driver/actions) for the latest compatibility matrix before upgrading.
- How do I enable persistent connections for better performance?
- Add `'persistent' => true` to your SingleStoreDB connection configuration in `config/database.php`. This reduces connection overhead but may require tuning for high-concurrency apps or long-running queries.
- What SingleStore features are supported in Laravel migrations?
- The driver supports SingleStore-specific migration features like `shardKey()`, `sortKey()`, `columnstore()`, `sparse()`, and `temporary()` for global tables. See the [README’s Migrations section](https://github.com/singlestoredb-labs/singlestoredb-laravel-driver#migrations) for full details.
- Will my existing MySQL migrations work without changes?
- Most standard MySQL migrations will work, but SingleStore-specific features (e.g., shard keys, columnstore) require explicit syntax. Test migrations early, especially if using indexes, foreign keys, or complex data types like JSON.
- How does JSON column support differ from standard MySQL?
- The driver ensures JSON columns are handled natively by SingleStore, including proper indexing and query generation. Use `$table->json('column_name')` in migrations for full compatibility with SingleStore’s JSON functions.
- Are there any limitations with Laravel’s Query Builder?
- While Eloquent and Schema Builder are enhanced, some advanced analytical queries (e.g., `ORDER BY` in `DELETE/UPDATE`) are disabled by default due to SingleStore incompatibilities. Use raw SQL or enable them via configuration if needed.
- How do I connect to SingleStore Managed Service securely?
- For SingleStore Managed Service, configure SSL in your database connection with `'sslmode' => 'verify-full'` and specify the CA certificate path. Managed Service users must manually add SingleStore’s CA certificate to PHP’s trusted store.
- What alternatives exist for Laravel + SingleStoreDB integration?
- For basic MySQL compatibility, you could use Laravel’s native `mysql` driver, but it lacks SingleStore-specific optimizations like persistent connections, columnstore support, or JSON handling. This driver is the official, feature-rich solution for SingleStore.