PHP code example of singlestore / singlestore-laravel
1. Go to this page and download the library: Download singlestore/singlestore-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
singlestore / singlestore-laravel example snippets
Schema::create('table', function (Blueprint $table) {
$table->string('name');
$table->sortKey('name')->with(['columnstore_segment_rows' => 100000]);
});
Schema::create('table', function (Blueprint $table) {
$table->string('name')->sortKey()->with(['columnstore_segment_rows' => 100000]);
});
Schema::create('table', function (Blueprint $table) {
$table->string('name');
$table->sortKey()->with(['columnstore_segment_rows' => 100000]);
});
Schema::create('table', function (Blueprint $table) {
$table->string('key');
$table->string('val');
$table->shardKey('key');
$table->unique(['key', 'val']);
});
Schema::create('table', function (Blueprint $table) {
$table->reference();
$table->string('name')->unique();
});
Schema::create('table', function (Blueprint $table) {
$table->string('name');
$table->index('name', 'name_idx', 'hash');
});
Schema::create('table', function (Blueprint $table) {
$table->datetime('created_at')->seriesTimestamp();
// Or make it sparse
$table->datetime('deleted_at')->nullable()->seriesTimestamp()->sparse();
});