CrateDB DBAL¶
DBAL is a PHP database abstraction layer that comes with database schema
introspection, schema management, and PDO support.
The crate/crate-dbal package implements this specification,
wrapping access to CrateDB’s HTTP interface.
Install
composer require crate/crate-dbal
Synopsis
<?php
require 'vendor/autoload.php';
$params = array(
'driverClass' => 'Crate\DBAL\Driver\PDOCrate\Driver',
'user' => 'admin',
'password' => '<PASSWORD>',
'host' => '<name-of-your-cluster>.cratedb.net',
'port' => 4200
);
$connection = \Doctrine\DBAL\DriverManager::getConnection($params);
$sql = "SELECT * FROM sys.summits ORDER BY height DESC LIMIT 3";
$result = $connection->query($sql)->fetch();
print_r($result);
?>
See also
Documentation
The full documentation for crate/crate-dbal.