Introduction

The LibSQL PHP Extension facilitates connections to LibSQL databases from PHP applications, offering a range of functionalities to streamline database operations. This documentation provides a detailed overview of the LibSQL class and its methods.

Class Synopsis

class LibSQL
{
    // Constants
    const OPEN_READONLY = 1;
    const OPEN_READWRITE = 2;
    const OPEN_CREATE = 4;

    // Properties
    public $mode;

    // Methods
    public function __construct(string|array $config, ?int $flags = 6, ?string $encryption_key = "");
    public static function version(): string;
    public function changes(): int;
    public function isAutocommit(): bool;
    public function execute(string $stmt, ?array $parameters = []): int;
    public function executeBatch(string $stmt): bool;
    public function query(string $stmt, ?array $parameters = []): array;
    public function transaction(?string $behavior = "DEFERRED"): LibSQLTransaction;
    public function prepare(string $sql): LibSQLStatement;
    public function close(): void;
    public function sync(): void;
}

Table of Contents