Skip to main content

ZTeraDB Client Driver

Welcome!
This documentation will walk you through ZTeraDB step-by-step, using simple language and practical Python 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 Python Client → ZTeraDB Server → Your Databases

You never connect to databases directly.
ZTeraDB manages all connections, routing, security, and query execution behind the scenes.


⭐ Features

  • 🚀 Unified Query Language (ZQL)
  • 🐍 Clean & simple Python API
  • 🔌 Works with any Python app (FastAPI, Django, Flask, scripts, cron jobs)
  • ⚙️ Auto-managed connections & retries (async support)
  • 🔐 Secure authentication using client keys
  • 🎯 Powerful query builder (insert, select, update, delete)
  • 🔍 Advanced logical & mathematical filter conditions
  • 📡 Async execution for high throughput
  • 📚 Pydantic response formatting (JSON output)

🛠 Requirements

  • Python 3.8+
    👉 Download: https://www.python.org/downloads/
  • pip (comes with Python)
  • ZTeraDB account (clientKey, accessKey, secretKey)
  • Basic knowledge of Python dictionaries & async functions

📦 Install

Install using pip:

pip install zteradb

OR install directly from GitHub:

pip install git+https://github.com/zteradb/zteradb-python

🚀 Quick Start (Hello World)

from zteradb.zteradb_config import (
ZTeraDBConfig,
ENVS,
ResponseDataTypes,
Options
)
from zteradb.zteradb_connection import ZTeraDBConnectionAsync
from zteradb.zteradb_query import ZTeraDBQuery
import asyncio


async def main():
config = ZTeraDBConfig(
client_key="YOUR_CLIENT_KEY",
access_key="YOUR_ACCESS_KEY",
secret_key="YOUR_SECRET_KEY",
database_id="YOUR_DATABASE_ID",
env=ENVS("dev"),
response_data_type=ResponseDataTypes("json"),
options=Options(connection_pool=dict(min=1, max=5)),
)

connection = ZTeraDBConnectionAsync(
"YOUR_ZTERADB_HOST",
7777,
config
)

query = ZTeraDBQuery("user").select()

result = await connection.run(query)
print(result)

await connection.close()


asyncio.run(main())

🗂 Documentation Sections