PHP code example of karlomikus / rqlite

1. Go to this page and download the library: Download karlomikus/rqlite 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/ */

    

karlomikus / rqlite example snippets




use Kami\Rqlite\Rqlite;
use Kami\Rqlite\Adapters\Curl;

// Create a http adapter and point it to your rqlite server
// You can create your own adapter by implementing the Adapter interface
$curlAdapter = new Curl('http://localhost:4001');

// Create a Rqlite client instance and pass the adapter as a constructor argument
$rqlite = new Rqlite($curlAdapter);

// Run your SQL queries
// Supports status(), query() and execute() endpoints
$result = $rqlite->query([
    'SELECT * FROM foo',
]);

// Get the results
// By default the results from query endpoint are fetch as associative arrays
var_dump($result);