Download the PHP package mroosz/php-cassandra without Composer

On this page you can find all versions of the php package mroosz/php-cassandra. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-cassandra

php-cassandra: A modern Cassandra client for PHP

Latest Stable Version License PHP Version Require Total Downloads

Static Analysis: PHPStan Static Analysis: Psalm Tests: PHPUnit

php-cassandra is a pure-PHP client for Apache Cassandra and ScyllaDB with support for CQL binary protocol v3, v4 and v5 (Cassandra 2.1+ incl. 3.x–5.x; ScyllaDB 6.2, 2025.x, 2026.x), synchronous and asynchronous APIs, prepared statements, batches, result iterators, object mapping, SSL/TLS, and LZ4 compression.

Packagist: mroosz/php-cassandra
Repository: GitHub – MichaelRoosz/php-cassandra

Table of contents

Introduction

php-cassandra is a modern PHP client for Apache Cassandra that prioritizes correctness, performance, and developer experience. This library aims to provide full protocol coverage and advanced features while maintaining simplicity.

Why choose php-cassandra?

πŸš€ Modern Architecture

⚑ High Performance

🎯 Developer Friendly

Key Features

Requirements

System Requirements

Component Minimum Recommended Notes
PHP Version 8.1.0 8.3+ Latest stable version recommended
Architecture 32-bit/64-bit 64-bit 64-bit required for Bigint/Counter/Date/Duration/Time/Timestamp types and defaultTimestamp request option (unsupported on 32-bit)

PHP Extensions

No PHP extension is required; the library runs on a minimal PHP build. The following are optional and only enhance functionality:

Extension Required Purpose Notes
sockets Optional Socket transport Required for connections configured with SocketNodeConfig; StreamNodeConfig connections need no extension
openssl Optional TLS/SSL encrypted connections Required for tls:// connections configured with StreamNodeConfig
lz4 Optional Native LZ4 (de)compression Used automatically when present for much faster compressed connections; a pure-PHP implementation is the transparent fallback
gmp or bcmath Optional Faster large integer math Speeds up the Varint and Decimal types; gmp is preferred when both are present, and a pure-PHP calculator is the fallback

Data Type Compatibility

Some Cassandra data types require 64-bit PHP and are unsupported on 32-bit:

Type 32-bit PHP 64-bit PHP Notes
Bigint ⚠️ Partial βœ… Full Supported if the value is within 32-bit range
Counter ⚠️ Partial βœ… Full Supported if the value is within 32-bit range
Date ❌ Unsupported βœ… Full Requires 64-bit PHP
Duration ❌ Unsupported βœ… Full Requires 64-bit PHP
Time ❌ Unsupported βœ… Full Requires 64-bit PHP
Timestamp ❌ Unsupported βœ… Full Requires 64-bit PHP

Additionally, the defaultTimestamp request option (in QueryOptions and BatchOptions) requires 64-bit PHP and is unsupported on 32-bit.

Installation

Using Composer (Recommended)

Then include Composer's autoloader in your application entrypoint (if not already):

Without Composer

If you can't use Composer, you can load the library's own autoloader:

Quick start

Basic Connection and Query

Prepared statements

Async Operations Example

Error Handling Example

SSL/TLS Connection Example

Connecting

Create NodeConfig instances and pass them to Connection:

Connection options are provided via ConnectionOptions:

Keyspace selection β€” the keyspace given to the constructor, or set later with $conn->setKeyspace('ks'), applies to every request sent on the connection, but how it gets there depends on the negotiated protocol version:

Consistency levels

Use the Consistency enum:

Apply per call or as default via setConsistency().

Queries

Synchronous:

Asynchronous:

Query options (QueryOptions):

Notes:

Fetch all pages helpers:

Prepared statements

Pagination with prepared statements:

Execute all pages helper:

Additional notes:

Batches

Batch notes:

Results and fetching

query()/execute() return a Result; call asRowsResult() for row-returning queries. Supported RowsResult methods:

Example:

Advanced fetching examples:

Pagination example:

Object mapping

You can fetch rows into objects by implementing RowClassInterface or by using the default RowClass:

Data types

All native Cassandra types are supported via classes in Cassandra\Value\*. You may pass either:

Without that metadata (e.g. query(..., autoPrepare: false) or Batch::appendQuery() simple-query values) a bare PHP int is encoded as 32-bit int, and a bare DateTime has no unambiguous encoding β€” wrap large integers in Value\Bigint and temporal values in Value\Timestamp/Date/Time (or use a prepared statement). The driver throws rather than silently sending a wrong value.

Examples:

UUID / Timeuuid input forms

Cassandra\Value\Uuid and Cassandra\Value\Timeuuid accept any of three forms, distinguished by length:

The value is stored raw internally, so getBinary() is a no-op and getValue() always returns the canonical lowercase string. Any string that is none of these forms is rejected with a Cassandra\Exception\ValueException.

Type definition syntax for complex values

For complex types, the driver needs a type definition to encode PHP values. Wherever you see a parameter like \Cassandra\Type|(array{ type: \Cassandra\Type }&array<mixed>), you can either pass a scalar Type::... (for simple elements) or a definition array with nested types for complex structures. The common shapes are:

Examples

Nested complex example (Set inside a row):

Collection updates

On non-frozen set, list, and map columns you can add or remove individual elements instead of rewriting the whole collection. This is plain CQL (DataStax docs) β€” php-cassandra adds no special API: you write the UPDATE yourself and bind only the delta (the elements to add or remove) as ?.

Operation set list map
Replace whole collection INSERT, or SET col = ? INSERT, or SET col = ? INSERT, or SET col = ?
Add SET col = col + ? (merges members) SET col = col + ? (append)
SET col = ? + col (prepend)
SET col = col + ? (merges entries)
Remove SET col = col - ? (removes those members) SET col = col - ? (removes by value β€” every occurrence) SET col = col - ? (removes keys; pass a set/list of keys)
Single element – SET col[?] = ? (by index)
DELETE col[?] FROM … (by index)
SET col[?] = ? (by key)
DELETE col[?] FROM … (by key)
Clear SET col = {} or DELETE col FROM … SET col = ? with [], or DELETE col FROM … SET col = {} or DELETE col FROM …

Notes:

Each example below is shown twice: first with explicit Value\...::fromValue() objects (always works, no prepare step), then with plain PHP values (relies on the default autoPrepare, which prepares the statement to learn the column types).

Set β€” add and remove members:

Map β€” merge entries, remove keys, or address a single key:

List β€” append, prepend, address a position, or remove by value:

Nested collections (map<int, frozen<list<text>>>, set<frozen<list<int>>>, list<frozen<udt>>) support the same +/- operations on the outer collection; the frozen inner value is always replaced as a whole.

Counter columns use the same + pattern with Counter::fromValue():

Special values:

Lightweight transactions (LWT)

INSERT, UPDATE and DELETE accept an IF clause for compare-and-set semantics (see the DataStax docs). No special API is needed β€” a conditional statement simply returns a rows result whose first column is [applied]:

The same applies to conditional updates and deletes:

Use serialConsistency to choose the Paxos consistency level, and read back with Consistency::SERIAL / Consistency::LOCAL_SERIAL to observe in-progress transactions:

Conditional statements also work inside a batch (all statements must target the same partition):

Notes:

JSON support

CQL can read and write rows as JSON documents (see the DataStax docs). The driver transports the document as a plain varchar, so no dedicated API is required:

By default a column that is absent from the document is written as null. Append DEFAULT UNSET to leave such columns untouched instead:

Events

Register a listener and subscribe for events on the connection:

Non-blocking event polling:

Tracing and custom payloads (advanced)

You can enable tracing on a request. Custom payloads require protocol v4 or newer and are supported by Query, Prepare, Execute, and Batch requests. The driver rejects other version/opcode combinations before sending them.

Asynchronous API

The async API lets you pipeline multiple requests without blocking. Each async method returns a Cassandra\Statement handle that you can resolve later.

You now have both blocking and non-blocking control:

Basics:

Waiting for all responses:

Non-blocking draining and polling:

Prepared + async:

Advanced waiting:

What $timeoutInSeconds means on the waits

Every wait takes the same four values β€” 0 makes one non-blocking read attempt and returns, n waits at most that many seconds, INF waits until something arrives. Only the default, null, differs between them, because each has a different thing to fall back on:

Wait null means
waitForStatements(), waitForAnyStatement(), waitForAllPendingStatements() let the statements' own request timeouts bound it
waitForNextResponse() use the connection's requestTimeoutInSeconds β€” there is no statement to go by
waitForNextEvent() wait for as long as it takes; an event can arrive at any time

Whichever it is, every request in flight keeps its own budget while a wait runs, so one going overdue is noticed there rather than only when its own caller next asks about it. A wait that ends up unbounded β€” no bound of the caller's and no bounded request in flight β€” leans entirely on the heartbeat to tell a dead connection from a quiet one; with heartbeatIntervalInSeconds set to null as well, the transport's stall window is all that is left and its elapsing fails the connection.

Compression

Enable LZ4 compression (if supported by the server) via ConnectionOptions:

Notes:

Error handling

php-cassandra provides comprehensive error handling with a well-structured exception hierarchy. Understanding these exceptions helps you build robust applications with proper error recovery.

Exception Hierarchy

Which timeout is which

Three different exceptions report a timeout, and they mean quite different things:

Exception Raised by Meaning Node health
ServerException\ReadTimeoutException / WriteTimeoutException the coordinator the server hit its own read_request_timeout / write_request_timeout and said so fine β€” it answered
RequestTimeoutException the client the server never answered within requestTimeoutInSeconds not blamed; the connection stays open and only the request that ran out is finished
SocketException / StreamException (with a SOCKET_TIMEOUT_DURING_* / STREAM_TIMEOUT_DURING_* code) the transport the connection made no progress within the stall timeout suspect β€” counted as a node failure

A ConnectionException naming the heartbeat is the fourth possibility: the connection went quiet and did not answer its OPTIONS probe, so it is treated as dead even though a request may still be outstanding.

Error Handling Patterns

Basic Error Handling

Specific Server Error Handling

Retry Logic with Exponential Backoff

Timeout Handling

Error Information Access

Most server exceptions provide additional context:

Configuration Reference

Connection Configuration

Node Configuration

StreamNodeConfig (supports SSL/TLS)

SocketNodeConfig (requires ext-sockets)

Both timeout components are honoured, so sub-second timeouts work (['sec' => 0, 'usec' => 500000] is half a second). Setting both to 0 disables the timeout, matching the meaning of the socket option itself; request timeouts, wait bounds and the heartbeat are handed to the read itself and so fire on schedule regardless β€” see Choosing timeout values for what disabling the receive timeout does give up. connectTimeoutInSeconds is separate and must stay positive, so an unreachable host can never wedge the client indefinitely.

Choosing timeout values

There are two independent layers, and they answer different questions.

Transport timeouts (SO_RCVTIMEO/SO_SNDTIMEO, timeoutInSeconds) are stall timeouts: they bound how long the connection makes no progress at all, not how long a request takes end to end. Sending a large batch or reading a large result set over a slow link therefore does not trip them, and there is no implicit ceiling on payload size.

The request timeout (ConnectionOptions::$requestTimeoutInSeconds, default 30s) is what governs a slow query. A server that is simply thinking sends nothing, which looks exactly like a stalled connection, so the transport timeout alone cannot tell the two apart β€” it keeps waiting, and only the request timeout decides when to give up, with a RequestTimeoutException. Adjust it per situation:

requestTimeoutInSeconds is available on QueryOptions, ExecuteOptions, BatchOptions and PrepareOptions, and as the last argument of every call that sends a request β€” query(), queryAll(), queryAsync(), execute(), executeAll(), executeAsync(), batch(), batchAsync(), prepare(), prepareAsync(), syncRequest() and asyncRequest(). Precedence runs from the most specific to the least: the explicit argument, then the request's own options, then setRequestTimeout(), then ConnectionOptions.

The explicit argument bounds each request the call sends, not the call as a whole β€” when the driver has to prepare or reprepare the statement first, the PREPARE and the request it precedes each get the full budget, and on the paged helpers (queryAll(), executeAll()) each page request does:

The default of 30s is chosen to sit above Cassandra's own coordinator timeouts, so that the server answers with a proper error before the client gives up. Raise it for anything the server itself allows more time for, or that is bounded by data volume rather than by a server-side limit:

Operation Suggested Why
ordinary reads and writes 30s (default) above read_request_timeout (5s), write_request_timeout (2s) and range_request_timeout (10s)
TRUNCATE 90s truncate_request_timeout is 60s server-side
DDL / schema changes 120s waits for schema agreement across all nodes
full scans, aggregates, large batches 300s or more bounded by how much data is walked, not by a server-side timeout

Raising the request timeout is safe: a connection that has actually died is still caught within about 35s by the heartbeat, rather than being left to the request timeout to notice.

Request budgets vs. wait bounds

Two different things are being bounded, and the API keeps them apart by name:

Set by Means On expiry
Request budget β€” requestTimeoutInSeconds ConnectionOptions, setRequestTimeout(), request options, the $requestTimeoutInSeconds argument how long the server may take to answer a request the request is given up on: RequestTimeoutException
Wait bound β€” timeoutInSeconds the waitFor…() methods how long this call may block the call returns empty-handed; nothing is given up on

Every waitFor…() method takes the wait bound the same way:

Value Meaning
null that method's default, see below
0 do not wait: make one non-blocking read attempt and return
n wait at most n seconds
INF wait for as long as it takes

The default (null) is whatever makes sense for that wait:

Method null means
waitForNextEvent() wait for as long as it takes β€” an event can arrive at any time
waitForNextResponse() the connection's request timeout. Not "as long as it takes": with nothing in flight no response can ever arrive, so such a wait would never end
waitForStatements(), waitForAnyStatement(), waitForAllPendingStatements() let the statements' own budgets bound the wait

Note that 0 is the shortest wait, not an unlimited one β€” the opposite of what it means for the transport timeouts, where SO_RCVTIMEO => ['sec' => 0, 'usec' => 0] disables the timeout because that is what the socket option itself means. Even 0 still costs one read β€” a non-blocking one, so it does not wait on the transport either; for a look that never bounds itself by a deadline, use tryReadNextEvent() / tryReadNextResponse(), or tryResolveStatement() / tryResolveStatements() when waiting on statements.

Every wait is bounded by whichever comes first, and a request that runs out of budget is given up on from any wait β€” so it cannot quietly outlive its budget while you are, say, listening for events. Which wait reports it is a separate matter: only a call that was asked about that request raises it. waitForNextEvent() and waitForNextResponse() were asked for the next event or response, not about any request in particular, so they run their course; the caller finds out when they next touch the statement, which then throws RequestTimeoutException.

When several requests run out at the same moment they are all finished in one pass and reported as a single failure, which carries the statements themselves:

A parked stream id is only released when its late answer arrives, so a node that keeps leaving requests unanswered would tie up more and more of them. Past maxOrphanedStreams the connection is closed and started over, and that is raised β€” as a ConnectionException β€” whatever the caller was waiting for: their connection is gone and the requests still in flight on it went with it.

Cassandra's own coordinator defaults are 5s for reads, 2s for writes, 10s for range requests and the generic request timeout, and 60s for TRUNCATE. Keep the request timeout above whichever of those apply, so the server gets to answer with a proper error β€” which this driver surfaces as ReadTimeoutException / WriteTimeoutException β€” instead of the client giving up first.

A RequestTimeoutException leaves the connection open and does not count the node as failed, so one expensive query neither drops your prepared statements nor pushes a healthy node out of rotation. Only the request that ran out of time is finished.

Deadlines are handed to the read itself rather than merely consulted before one starts, so the transport timeout does not bound when a deadline is noticed: a request timeout of half a second fires after half a second even against a completely silent server whose receive timeout is 15s. A deadline that has already passed never buys a blocking read at all, so a request that ran out while you were busy elsewhere is reported at once, and a connection busy answering other requests cannot defer it either.

That makes the two settings genuinely independent, and disabling the receive timeout safe: SO_RCVTIMEO => ['sec' => 0, 'usec' => 0] and timeoutInSeconds: 0 mean "no stall window", not "no deadlines" β€” request timeouts, wait bounds and the heartbeat all still fire on schedule. What you give up is the transport's own judgement that a connection making no progress at all has failed. That judgement is what ends a wait carrying no deadline of its own on a connection with the heartbeat turned off β€” a stall window elapsing on such a read is raised as the transport failure it is (SocketException / StreamException, both NodeExceptions) rather than waited out, since nothing else is left to notice a connection that died. Turn both of those off as well and nothing bounds the wait at all.

The heartbeat (heartbeatIntervalInSeconds, default 30s) is what distinguishes a dead connection from a quiet one β€” at the socket, a coordinator that is still thinking and a node that vanished look identical. Whenever the connection has been silent for the interval, an OPTIONS frame is sent; because stream ids are multiplexed, it is answered on its own stream while a slow request is still being computed. A broken connection therefore surfaces after heartbeatInterval + heartbeatTimeout (~35s by default) as a ConnectionException, no matter how high the request timeout is β€” which is what makes generous request timeouts safe to set. Reads are bounded by when the probe is next due, so that holds during a wait with no deadline of its own and whatever the transport timeouts are set to.

The probe is the driver's own request and stays out of your way entirely: it is held to heartbeatTimeoutInSeconds rather than to your request timeout, it does not keep waitForAllPendingStatements() waiting, and its answer is resolved out of sight rather than handed back by waitForNextResponse() / tryReadNextResponse() β€” so a loop pumping the connection for responses never sees a Supported frame it did not ask for.

Note that these three values are independent: the request timeout follows your cluster's coordinator timeouts, while the heartbeat interval should stay below the idle timeout of any NAT, firewall or load balancer between you and the node. They both default to 30s by coincidence, not because they are related.

Timeouts and async statements

The budget of an async statement runs from the moment its request was written to the node, not from the moment you get around to waiting for it β€” so a statement gets the same total allowance whether you wait immediately or after other work:

Each statement carries the timeout its own request asked for, so a mixed batch is not forced onto one number:

When several statements are waited on together, the wait ends as soon as the first of them exhausts its own budget.

The polling methods (tryResolveStatement(), tryReadNextResponse(), …) never wait, so how long your loop runs is yours to bound β€” but they do keep the same books a wait does. Request budgets are still enforced, so a statement you only ever poll runs out of time and releases its stream id rather than staying pending for good; and the heartbeat is still sent, so a connection that died quietly is noticed by an application that never blocks. Statement::tryGetResult() and its siblings therefore raise RequestTimeoutException once the budget is gone, exactly as the blocking calls do. To look at a statement without any of that, use Statement::peekResponse(), which only reads what has already arrived.

When an async statement times out, only that statement is finished β€” the connection stays open and every other statement in flight on it keeps waiting:

What makes that safe is that the timed-out statement's stream id is not returned to the pool β€” the server may still answer on it, and reusing it would let that late answer resolve a different request. The id is parked until the late answer arrives, then released. A connection whose requests keep timing out would tie up more and more ids, so past maxOrphanedStreams (default 24) the connection is closed instead.

Synchronous requests take their stream ids from the same pool, so a sync timeout is handled identically and also leaves the connection open β€” which matters because closing it would clear the prepared statement cache and force every prepared statement to be prepared again.

Closing a connection invalidates every statement still in flight on it β€” their stream ids meant something only on that connection. Those are marked abandoned, and touching one fails at once with a StatementException rather than waiting out another request timeout:

The host may be a hostname, an IPv4 literal, or an IPv6 literal in either bare (::1) or bracketed ([::1]) form. It is resolved with getaddrinfo(), so IPv4-only, IPv6-only and dual-stack hosts all work; when a name resolves to several addresses, each is tried in turn until one connects. URL schemes (tcp://, tls://) are not accepted here β€” use StreamNodeConfig for TLS.

Connection Options

Request Options

Query Options

Execute Options

Prepare Options

Batch Options

Advanced Configuration

Value Encoding Configuration

Map decoding defaults to MapEncodeOption::AUTO. Maps with losslessly representable scalar keys are returned as native PHP arrays, preserving the existing result shape. A map whose configured keys are objects or composites β€” for example a timestamp key decoded as DateTimeImmutable, or a tuple key β€” is returned as Cassandra\Value\MapCollection; inspect its ordered MapEntry values with getEntries(). The decision is based only on the declared key type and the active ValueEncodeConfig, never on the entries in a particular value. Given the same key type and configuration, the result type is stable across rows: empty and non-empty maps have the same PHP representation. For example, map<text, …> is an array in AUTO mode, while map<timestamp, …> is a MapCollection when timestamps are configured as DateTimeImmutable (and an array when configured as strings or integers). Use AS_MAP_COLLECTION to request MapCollection for every map, or AS_ARRAY to require an array and receive a ValueException when conversion would be lossy.

Handling both results in AUTO mode:

Force a stable representation for every map returned by the connection:

Create a map with timestamp object keys through the entry API:

Tuple keys use the same API:

Event Listeners

Notes

Frequently Asked Questions (FAQ)

General Questions

Q: What's the difference between this library and the DataStax PHP Driver?

A: The main differences are:

Q: Can I use this with older versions of Cassandra?

A: Yes! The library supports protocol versions v3, v4, and v5:

Installation and Setup

Q: Do I need any PHP extensions?

A: No. The library requires no PHP extension and works on a minimal PHP build, but some extensions enhance functionality:

Q: Can I run this on 32-bit PHP?

A: Yes, with limited support. The following features are unsupported on 32-bit PHP: value types Bigint, Counter, Date, Duration, Time, Timestamp, and the defaultTimestamp request option. Use 64-bit PHP for full compatibility.

Data Types and Modeling

Q: How do I handle complex data structures?

A: Use collections and UDTs:

Q: How do I add or remove items from a set, list, or map?

A: Use CQL UPDATE with + / - and bind the delta as ? (not { ? }). See Collection updates for set/map/list examples and a syntax table.

Q: How do I work with timestamps?

A: Use the Timestamp value class:

Migration Guide

From DataStax PHP Driver

If you're migrating from the DataStax PHP Driver, here are the key differences and migration steps:

Connection Setup

Query Execution

Prepared Statements

Data Types

Async Operations

Migration Checklist

Connection tuning examples

Configuring value encoding

Warnings listener

Event processing patterns

v5 keyspace per request

Tracing notes

Performance tips

Benchmarks

The following results were produced by the benchmarking suite in benchmarks/ (Dockerized), comparing this library against the legacy DataStax PHP driver and the ScyllaDB PHP driver. Full setup and reproduction steps are documented in benchmarks/README.md; raw outputs are stored under benchmarks/results/.

Notes:

Version support

Server compatibility and required settings

Server version Supported? Protocol(s) Notes / required settings
Apache Cassandra 2.1.x βœ… With manual configuration v3 Cassandra 2.1 only supports protocol v3 and does not support protocol negotiation. You must set the initial protocol explicitly: new ConnectionOptions(initialProtocolVersion: ProtocolVersion::V3). Optionally, also restrict allowedProtocolVersions to [ProtocolVersion::V3].
Apache Cassandra 2.2.x / 3.x βœ… (3.0 / 3.11 tested) v4 These versions speak protocol v4 but do not support protocol negotiation. The default initialProtocolVersion is ProtocolVersion::V4, so no special configuration is required.
Apache Cassandra 4.x βœ… (tested) v4 / v5 Protocol negotiation is supported from 4.x; the driver will automatically negotiate the highest mutually supported protocol (v5, then v4, then v3) using the default ConnectionOptions.
Apache Cassandra 5.x βœ… (tested) v5 Fully supported with protocol negotiation. No special configuration is required; v5 will be negotiated when available.
ScyllaDB 6.2, 2025.1, 2025.2, 2025.3 βœ… (tested) v4 ScyllaDB currently supports protocol v4 and does not support protocol negotiation. The default initialProtocolVersion is ProtocolVersion::V4, so no special configuration is required.

For example, to connect to a Cassandra 2.1 cluster:

Server-side features that are off by default

A few CQL features need to be enabled on the server before any driver can use them. They are pure server configuration β€” nothing changes on the client side.

Feature Apache Cassandra ScyllaDB
User-defined functions / aggregates user_defined_functions_enabled: true in cassandra.yaml (called enable_user_defined_functions in 4.0) --experimental-features=udf and --enable-user-defined-functions=true; bodies are written in Lua, not Java
Materialized views materialized_views_enabled: true in cassandra.yaml (called enable_materialized_views in 4.0); every CREATE MATERIALIZED VIEW returns a warning that the feature is experimental Enabled by default
SASI indexes (CREATE CUSTOM INDEX … USING 'org.apache.cassandra.index.sasi.SASIIndex', LIKE) sasi_indexes_enabled: true in cassandra.yaml (called enable_sasi_indexes in 4.0) Not supported

API reference (essentials)

Changelog

See CHANGELOG.md for release notes and upgrade considerations.

License

This library is released under the MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Here's how to get started:

Development Setup

  1. Fork and Clone

  2. Install Dependencies

  3. Start Development Environment

  4. Run Tests

Docker quickstart for integration tests:

Contribution Guidelines

Code Standards

Contributors

Special thanks to all contributors who have helped make this library better.

Supporting the Project

If you find this library useful, consider:

Your support helps keep this project active and improving!


All versions of php-cassandra with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mroosz/php-cassandra contains the following files

Loading the files please wait ...