PHP code example of clearsoft / easysql-connectors-sqlite

1. Go to this page and download the library: Download clearsoft/easysql-connectors-sqlite 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/ */

    

clearsoft / easysql-connectors-sqlite example snippets


use Clearsoft\EasySQL\Connectors\SQLite\ConnectionConfig;
use Clearsoft\EasySQL\Connectors\SQLite\Connector;

$connector = new Connector(new ConnectionConfig(
    path: '/var/data/shop.db', // or ':memory:' (default)
    readOnly: true,            // default false
    timeout: 10.0,             // seconds, default
));
$connector->connect();

try {
    $raw = $connector->introspect();          // raw shape for the schema-generation package
    $result = $connector->execute('SELECT * FROM users LIMIT 10');
} finally {
    $connector->close();
}