Download the PHP package prismdb/client without Composer
On this page you can find all versions of the php package prismdb/client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package client
prismdb/client (PHP)
A pure-PHP client for PrismDB, speaking the binary wire
protocol directly over a TCP (or TLS) stream. No PHP extension required beyond
the standard sockets/openssl streams that ship with PHP.
Implements
docs/specs/wire-protocol.md. The byte layouts are kept in lockstep with the Rustprism-protocolcrate and the reference Node SDK.
Install
Requires PHP ≥ 8.1.
Quick start
API
Client::connect(host, port, username, password, database, useTls, tls, ...)
Performs the Hello/Auth handshake. Omit username to skip authentication.
Pass useTls: true (with optional tls: stream SSL context options) for TLS. On
a multi-database server, pass database: to select it at connect; otherwise run
$db->sql('USE <name>') yourself.
SQL — $db->sql(string $text, array $params = [], bool $returnRows = true)
Returns a SqlResult with ->columns, ->rows (associative arrays keyed by
column name), ->raw (cells in column order), and ->affectedRows (int).
KV — $db->kv
get(ns, key): ?string, put(ns, key, value), delete(ns, key). Keys and
values are byte strings.
Documents — $db->doc
insertOne / insertMany (return the assigned ObjectIds), find / findOne,
count, updateOne / updateMany, deleteOne / deleteMany. Build filters with
Q and updates with U:
Transactions — $db->begin(bool $readOnly = false), $db->commit(int $idempotencyKey = 0), $db->abort()
One Client is one server session, so calls between begin() and commit() run
in that transaction.
Value mapping
PHP → wire: null→Null, bool→Bool, int→Int64, float→Double, string→Str,
DateTimeInterface→Timestamp, ObjectId→ObjectId. PHP has no separate byte type,
so a plain string is text; use Prism::binary($bytes) for a BLOB and
Prism::int32($n) / Prism::float64($n) / Prism::timestamp($us) to force the
other wire types. Integers at or above 2^63 round-trip as negative PHP ints.
Develop
Status / limitations
- Streamed (multi-frame) SQL/document results are not yet reassembled.
- KV
range/scanare follow-ups. - The client is synchronous; one
Clientowns one connection.