SQLite 3 Studio & Data Explorer

Raw MD
Built-in zero-maintenance relational database engine with visual SQL query console and automatic WAL mode.

Zero-Maintenance Database Architecture

Every bot on Botlify Cloud comes pre-provisioned with its own dedicated SQLite 3 database located at database.db. Unlike MySQL or PostgreSQL, SQLite requires no external ports, usernames, or passwords. It operates at native memory speed right on high-speed NVMe SSDs.

Connecting via PDO in PHP

PDO Connection Setup
$db = new PDO('sqlite:' . __DIR__ . '/database.db', null, null, [
    PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
]);

// Enable WAL Mode for High Concurrency
$db->exec("PRAGMA journal_mode = WAL;");
$db->exec("PRAGMA busy_timeout = 5000;");

// Create Standard Users Table
$db->exec("CREATE TABLE IF NOT EXISTS users (
    chat_id TEXT PRIMARY KEY,
    username TEXT,
    first_name TEXT,
    balance REAL DEFAULT 0.00,
    interactions INTEGER DEFAULT 1,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);");

Using the Visual Database Studio

Inside Bot Studio → Database, you have access to:

  • Schema Explorer: View all tables, column types, and primary keys.
  • Interactive SQL Console: Run any query (SELECT, INSERT, UPDATE, DELETE, ALTER TABLE) with formatted result tables.
  • Live Data Browser: Inspect user records, balances, and interaction logs with pagination and search.