ZTeraDB Client Driver
Welcome!
This documentation will walk you through ZTeraDB step-by-step, using simple language and practical PHP examples.
๐ What Is ZTeraDB?
ZTeraDB helps you connect to your existing databases (PostgreSQL, MySQL, MSSQL, etc.) through a single unified platform.
You write one query language (ZQL) instead of switching between SQL dialects.
๐ง Architecture (Simple Explanation)
Your App โ ZTeraDB PHP Client โ ZTeraDB Server โ Your Databases
You never connect to the database directly.
ZTeraDB handles all connections, routing, and execution securely behind the scenes.
โญ Features
- ๐ Unified Query Language (ZQL)
- ๐ Easy integration with any PHP application
- โ๏ธ Auto-managed connections & retries
- ๐ Secure authentication using client keys
- ๐ฏ Clean query builder (insert, select, update, delete)
- ๐ Advanced logical & mathematical filters
- ๐งต Streamed results for large datasets
- ๐ฆ Composer-based installation
- ๐งฉ Works with frameworks like Laravel, Symfony, CodeIgniter
๐ Requirements
- PHP 5.6.40+ Click here to download and install php
- Composer Click here to doanload and install composer
- ZTeraDB account (clientKey, accessKey, secretKey)
- Basic knowledge of PHP arrays & objects
๐ฆ Install
Install via Composer:
composer require zteradb/zteradb-php
OR
Install from the ZTeraDB github repository. Create a composor.json file with following content.
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/zteradb/zteradb-php"
}
],
"require": {
"zteradb/zteradb-php": "<latest version>"
}
}
๐ Quick Start (Hello World)
<?php
require_once "vendor/autoload.php";
use ZTeraDB\Config\ZTeraDBConfig;
use ZTeraDB\Connection\ZTeraDBConnection;
use ZTeraDB\Query\ZTeraDBQuery;
use ZTeraDB\Config\ResponseDataTypes;
use ZTeraDB\Config\ENVS;
$config = new ZTeraDBConfig([
'client_key' => getenv('CLIENT_KEY'),
'access_key' => getenv('ACCESS_KEY'),
'secret_key' => getenv('SECRET_KEY'),
'database_id' => getenv('DATABASE_ID'),
'env' => ENVS::dev,
'response_data_type' => ResponseDataTypes::json,
]);
$db = new ZTeraDBConnection(
getenv("ZTERADB_HOST"),
getenv("ZTERADB_PORT"),
$config
);
$query = (new ZTeraDBQuery("user"))->select();
foreach ($db->run($query) as $row) {
print_r($row);
}
$db->close();
๐ Documentation Sections
- Configuration
- Connection
- Query Builder
- Filter Conditions
- Examples
- Troubleshooting Guide
- Quickstart Guide
- License