SkillAgentSearch skills...

Cassis

Pure PHP asynchronous implementation of the Cassandra V4 binary protocol.

Install / Use

/learn @phpinnacle/Cassis
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PHPinnacle Cassis

Latest Version on Packagist Software License Coverage Status Quality Score Total Downloads

This library is a pure asynchronous PHP implementation of the Cassandra V4 binary protocol. It utilize amphp framework for async operations.

Install

Via Composer

$ composer require phpinnacle/cassis

Basic Usage

<?php

use Amp\Loop;
use PHPinnacle\Cassis\Cluster;
use PHPinnacle\Cassis\Session;
use PHPinnacle\Cassis\Statement;

require __DIR__ . '/vendor/autoload.php';

Loop::run(function () {
    $cluster = Cluster::build('tcp://localhost:9042');
    
    /** @var Session $session */
    $session = yield $cluster->connect('system');

    $statement = new Statement\Simple('SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies');
    $result    = yield $session->execute($statement);

    foreach ($result as $row) {
        printf("The keyspace %s has a table called %s\n", $row['keyspace_name'], $row['columnfamily_name']);
    }

    $session->close();
});

More examples can be found in examples directory. Run it with:

CASSIS_EXAMPLE_DSN=tcp://user:pass@localhost:9042 php example/*

Testing

CASSIS_TEST_DSN=tcp://user:pass@localhost:9042 composer test

Benchmarks

CASSIS_BENCHMARK_DSN=tcp://user:pass@localhost:9042 composer bench

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email dev@phpinnacle.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

View on GitHub
GitHub Stars12
CategoryData
Updated1y ago
Forks3

Languages

PHP

Security Score

80/100

Audited on Mar 2, 2025

No findings