PHPackages                             zteradb/zteradb-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. zteradb/zteradb-php

ActiveLibrary[Database &amp; ORM](/categories/database)

zteradb/zteradb-php
===================

ZTeraDB PHP client (ZQL, raw socket transport) - PHP 5.6+

v1.1.0(5mo ago)014proprietaryPHPPHP &gt;=5.6.40

Since Nov 24Pushed 5mo agoCompare

[ Source](https://github.com/zteradb/zteradb-php)[ Packagist](https://packagist.org/packages/zteradb/zteradb-php)[ RSS](/packages/zteradb-zteradb-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

ZTeraDB php 5.6+ Client library
===============================

[](#zteradb-php-56-client-library)

This is a PHP 5.6+ client library for interacting with **ZTeraDB**, a platform that allows you to connect to your existing databases and query them using **ZTeraDB Query Language (ZQL)**. The client provides an easy-to-use interface to send queries to ZTeraDB and retrieve results in a standardized format.

This package implements a ZQL-first PHP client for ZTeraDB using a raw TCP socket transport. It assumes the server uses 4-byte big-endian length-prefixed payloads that contain JSON payloads.

Table of Contents
-----------------

[](#table-of-contents)

1. [Features](#features)
2. [Requirements](#requirements)
3. [Installing](#install)
4. [Usage](#usage)
5. [Configuration](https://github.com/zteradb/zteradb-php/blob/main/docs/config.md)
6. [ZTeraDB Connection](https://github.com/zteradb/zteradb-php/blob/main/docs/zteradb-connection.md)
7. [Query](https://github.com/zteradb/zteradb-php/blob/main/docs/query.md)
8. [Filter Conditions](https://github.com/zteradb/zteradb-php/blob/main/docs/filter-condition.md)
9. [License](#license)

**Features**
------------

[](#features)

- **Connect to Multiple Databases**: Seamlessly interact with your existing databases through ZTeraDB.
- **ZTeraDB Query Language (ZQL)**: Use a unified query language to query data across different database systems.
- **Easy Integration**: Easily integrate ZTeraDB into your Node.js application.
- **Asynchronous Queries**: Support for async/await syntax to handle queries and results asynchronously.
- **Error Handling**: Comprehensive error handling to help debug and manage database queries.

Requirements
------------

[](#requirements)

- This is a php5.6+ module available through the Packagist (packagist.org) registry.
- Before installing, download and [install php](https://www.php.net/downloads.php). PHP 5.6.40 or higher is required.

**Install**
-----------

[](#install)

Run following command to install the ZTeraDB client for php.

```
# Using 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": "v1.0"
  }
}
```

Install the ZTeraDB Client for php.

```
composer require zteradb/zteradb-php:v1.0
```

**Usage**
---------

[](#usage)

```
require_once "vendor/autoload.php";

use ZTeraDB\Config\Options;
use ZTeraDB\Config\ConnectionPool;
use ZTeraDB\Config\ENVS;
use ZTeraDB\Config\ResponseDataTypes;
use ZTeraDB\Config\ZTeraDBConfig;
use ZTeraDB\Connection\ZTeraDBConnection;
use ZTeraDB\Query\ZTeraDBQuery;

# ZTeraDB host, port details from environment.
$host = getenv("ZTERADB_HOST");
$port = (int) getenv('PORT');

# ZTeraDB configuration details
$zteradb_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,
    ]);

# Connect to ZTeraDB server
$conn = new ZTeraDBConnection($host, $port, $zteradb_config);

# Schema name to get the result
$query = new ZTeraDBQuery("");

# Run the query
$rows = $conn->run($query);

# Iterate the query result
foreach($rows as $row) {
  print_r($row);
}

# Close all connections
$conn->close();
```

**License**
-----------

[](#license)

This project is licensed under the **ZTeraDB** License - see [LICENCE](https://github.com/zteradb/zteradb-php/blob/main/LICENCE.md) file for details.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance70

Regular maintenance activity

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

170d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46c872d94a65ce3a722e807dd0f2aa49e98b973b2445d8198ae6c401012fc3bf?d=identicon)[zteradb](/maintainers/zteradb)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zteradb-zteradb-php/health.svg)

```
[![Health](https://phpackages.com/badges/zteradb-zteradb-php/health.svg)](https://phpackages.com/packages/zteradb-zteradb-php)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
