SingleStore DB Driver for Laravel
This package provides SingleStore specific schema options, currently supporting keys & shard keys, alongside setting rowstore and clusterstore tables. In addition, tables are automatically deleted one-by-one when db:wipe
is ran, as Laravel traditionally deletes all at once - which isn't compatible with SingleStore.
A huge thanks to Fathom Analytics for the motivation to build this package, as I never knew about SingleStore until their blog post.
Support us
If this package helped you, feel free to donate to my PayPal, every donation regardless of amount is appreciated for my time.
Installation
You can install the package via composer:
composer require heychazza/singlestore-driver
Then, within your database.php
file, edit the driver
property and set it to singlestore
:
"mysql" => [
"driver" => "singlestore",
// ... other options ... //
]
Example Usage
Schema::create("example_table", function (Blueprint $table) {
// ... other options ... //
$table->id();
// Creating a basic KEY
$table->key('nickname');
// Or, creating a SHARD KEY
$table->key('nickname')->sharded();
// Or, SHARD with ROWSTORE.
$table->key("nickname")->sharded()->storeType(StoreType::ROWSTORE);
// Or, KEY with COLUMNSTORE.
$table->key("nickname")->sharded()->storeType(StoreType::COLUMNSTORE);
});
Features
- Ability to set a
KEY
andSHARD KEY
. - Ability to specify
ROWSTORE
andCOLUMNSTORE
tables. - Ability to use
php artisan db:wipe
that is compatible with SingleStore.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- heychazza (Developed it)
- Jack Ellis (For the inspiration to build this)
- All Contributors
License
The MIT License (MIT). Please see License File for more information.