{"id":13619754,"url":"https://github.com/he4rt/scylladb-php-driver","last_synced_at":"2025-04-14T16:32:42.381Z","repository":{"id":37799608,"uuid":"324358176","full_name":"he4rt/scylladb-php-driver","owner":"he4rt","description":"PHP Driver for ScyllaDB/Apache Cassandra","archived":false,"fork":true,"pushed_at":"2024-04-15T08:59:06.000Z","size":10283,"stargazers_count":94,"open_issues_count":10,"forks_count":25,"subscribers_count":7,"default_branch":"v1.3.x","last_synced_at":"2024-05-02T03:40:22.214Z","etag":null,"topics":["cassandra","cassandra-database","cassandra-driver","cql","ext-cassandra","php","php-extension","php8","scylladb","scylladb-driver","scylladb-php-driver"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"datastax/php-driver","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/he4rt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-25T12:28:38.000Z","updated_at":"2024-05-02T03:40:22.215Z","dependencies_parsed_at":"2022-06-22T17:51:46.938Z","dependency_job_id":null,"html_url":"https://github.com/he4rt/scylladb-php-driver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he4rt%2Fscylladb-php-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he4rt%2Fscylladb-php-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he4rt%2Fscylladb-php-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/he4rt%2Fscylladb-php-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/he4rt","download_url":"https://codeload.github.com/he4rt/scylladb-php-driver/tar.gz/refs/heads/v1.3.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223638215,"owners_count":17177760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cassandra","cassandra-database","cassandra-driver","cql","ext-cassandra","php","php-extension","php8","scylladb","scylladb-driver","scylladb-php-driver"],"created_at":"2024-08-01T21:00:48.229Z","updated_at":"2025-04-14T16:32:42.373Z","avatar_url":"https://github.com/he4rt.png","language":"C++","readme":"\u003cdiv align=\"center\"\u003e\n\n[![Build Docker Image](https://github.com/he4rt/scylladb-php-driver/actions/workflows/docker-image.yml/badge.svg)](https://github.com/he4rt/scylladb-php-driver/actions/workflows/docker-image.yml)\n[![ScyllaDB Unnoficial Discord Server](https://img.shields.io/badge/ScyllaDB_Developers-Discord_Server-4C388C)](https://discord.gg/B6rutCXvgp)\n\n\u003c/div\u003e\n\n\n# ScyllaDB/CassandraDB Driver for PHP\n\n[![Build Status](https://github.com/he4rt/scylladb-php-driver/actions/workflows/tests.yml/badge.svg?branch=v1.3.x)](https://github.com/he4rt/scylladb-php-driver/actions/workflows/test.yml)\n\nA modern, [feature-rich][Features] and highly tunable PHP client library\nfor [ScyllaDB](https://github.com/scylladb/scylladb) and\n[Apache Cassandra] 3.0+ using exclusively Cassandra's binary protocol.\n\nThis is a wrapper around the [ScyllaDB C/C++ Driver].\n\n## Getting the Driver\n\nBinary versions of the driver, available for Linux systems and officialy supported versions of PHP (8.1 and 8.2), can be\nobtained from GitHub Releases (soon).\n\nYou're also can compile the driver by yourself or use Dockerfile with a pre-set environment to run your tests.\n\n## What's new in v1.2.0/v1.3.8\n\n* ScyllaDB C/C++ Shard Aware driver implemented\n* Support for [`duration`]\n* `Session::execute()` and `Session::executeAsync()` now support a\n  [simple string] for the query CQL and a simple array for the query execution option\n* Full support for Apache Cassandra 3.0+\n* Support for [`tinyint` and `smallint`]\n* Support for [`date`] and [`time`]\n* Support for [user-defined function and aggregate] metadata\n* Support for [secondary index] and [materialized view] metadata\n\n## Last Development Status\n\n### v1.3.8\n\n- Migration from C to C++\n- Removing PHP Build system in favor of CMake\n- Upgraded `Cassandra\\Cluster\\Builder` class to new PHP argument parsing API\n- Reduce memory usage from `Cassandra\\Cluster\\Builder`\n- Migrate from Behat to PestPHP\n- Migrated from TravisCI to Github Actions.\n\n## Compatibility\n\nThis driver works exclusively with the Cassandra Query Language v3 (CQL3) and\nCassandra's native protocol. The current version works with:\n\n* ScyllaDB 4.4.x and 5.x +\n* Apache Cassandra versions 3.0+\n* PHP 8.1 and 8.2\n* 64-bit (x64)\n* Thread safe (TS) and non-thread safe (NTS)\n* Compilers: GCC 13.0+, Clang 16+ and c++23\n\n\u003c!-- ## Documentation\n\n* [Home]\n* [API]\n* [Features] --\u003e\n\n## Getting Help\n\n* If you're able to fix a bug yourself, you can [fork the repository](https://help.github.com/articles/fork-a-repo/)\n  and [submit a pull request](https://help.github.com/articles/using-pull-requests/) with the fix.\n* If you're not able to fix a bug yourself,\n  please [open an issue](https://github.com/he4rt/scylladb-php-driver/issues) , describe it with the most details\n  possible and wait until one of our maintainers join the conversation.\n\n## Quick Start\n\n```php\n\u003c?php\n$cluster   = Cassandra::cluster()                 // connects to localhost by default\n                 -\u003ebuild();\n$keyspace  = 'system';\n$session   = $cluster-\u003econnect($keyspace);        // create session, optionally scoped to a keyspace\n$statement = new Cassandra\\SimpleStatement(       // also supports prepared and batch statements\n    'SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies'\n);\n$querySent = $session-\u003eexecute($statement);\n$result    = $querySent-\u003eget();                      // wait for the result, with an optional timeout\n\nforeach ($result as $row) {                       // results and rows implement Iterator, Countable and ArrayAccess\n    printf(\"The keyspace %s has a table called %s\\n\", $row['keyspace_name'], $row['columnfamily_name']);\n}\n```\n\n## Installation\n\nBefore you compile your driver, first check if your `php` and `php-config` matches the supported versions. If not,\nplease checkout to the available versions.\n\n```sh\nsudo update-alternatives --config php\nsudo update-alternatives --config php-config\n```\n\n\u003e Supported Versions: 8.1 and 8.2.\n\nNext you will learn how to build the driver to:\n\n* Release/Production\n* Debug/Development\n* Optimized for Production (CAREFUL!!)\n\n## BEFORE YOU START\n\n**!Make sure first you cloned the repository with --recursive flag!**\n\n**!Make sure you first install LibUV and LibCassandra/LibScyllaDB!**\n\n#### Installing LibUV\n\n\u003e Install LibUV from your package manager. -\u003e Preferred Way\n\n\u003e Installing From Source\n\n```sh\ngit clone --depth 1 -b v1.46.0 https://github.com/libuv/libuv.git \\\n    \u0026\u0026 cd libuv \\\n    \u0026\u0026 mkdir build \\\n    \u0026\u0026 cd build \\\n    \u0026\u0026 cmake -DBUILD_TESTING=OFF -DBUILD_BENCHMARKS=OFF -DLIBUV_BUILD_SHARED=ON CMAKE_C_FLAGS=\"-fPIC\" -DCMAKE_BUILD_TYPE=\"RelWithInfo\" -G Ninja .. \\\n    \u0026\u0026 ninja install\n```\n\n#### Installing LibCassandra/LibScyllaDB\n\n\u003e Installing From Source (Only Way to get the latest version)\n\n```sh\n\n# The only difference between libscylladb and libcassandra is the name of the git repository.\n\ngit clone --depth 1 https://github.com/scylladb/cpp-driver.git scyladb-driver \\\n  \u0026\u0026 cd scyladb-driver \\\n  \u0026\u0026 mkdir build \\\n  \u0026\u0026 cd build \\\n  \u0026\u0026 cmake -DCASS_CPP_STANDARD=17 -DCASS_BUILD_STATIC=ON -DCASS_BUILD_SHARED=ON -DCASS_USE_STD_ATOMIC=ON -DCASS_USE_TIMERFD=ON -DCASS_USE_LIBSSH2=ON -DCASS_USE_ZLIB=ON CMAKE_C_FLAGS=\"-fPIC\" -DCMAKE_CXX_FLAGS=\"-fPIC -Wno-error=redundant-move\" -DCMAKE_BUILD_TYPE=\"RelWithInfo\" -G Ninja .. \\\n  \u0026\u0026 ninja install\n```\n\n#### CMAKE Options and Presets\n\nWe provide common setups using CMake Presets. You can use them by passing the preset name to CMake:\n\n* Release\n* RelWithInfo\n* CI (Used by GitHub Actions)\n* Debug\n* ReleaseLibCassandra (Release with LibCassandra)\n\n````\noption(ENABLE_SANITIZERS \"Enable sanitizers\" OFF)\noption(ENABLE_AVX \"Enable AVX\" OFF)\noption(ENABLE_AVX2 \"Enable AVX2\" OFF)\noption(ENABLE_LTO \"Enable LTO\" OFF)\nset(CPU_TYPE \"x86-64-v3\" CACHE STRING \"For x86_64 = x86-64|x86-64-v2|x86-64-v3|x86-64-v4|native\")\n\n# PHP Options\nset(CUSTOM_PHP_CONFIG \"\" CACHE STRING \"Custom PHP config path\")\nset(PHP_VERSION_FOR_PHP_CONFIG \"8.3\" CACHE STRING \"PHP version\")\noption(PHP_DEBUG \"Debug or Release\" ON)\noption(PHP_THREAD_SAFE \"ZTS(zts) or NTS(nts)\" OFF)\n\noption(LINK_LIBUV_STATIC \"Statically link libuv\" OFF)\noption(BUILD_LIBUV_FROM_SRC \"Build LibUV from Source\" OFF)\n\noption(PHP_DRIVER_STATIC \"Statically link PHP Driver\" OFF)\noption(USE_LIBCASSANDRA \"Use DataStax LibCassandra instead of LibScyllaDB\" OFF)\n\n````\n\n### Compiling Release Build\n\nThis build you can use it for Production purposes.\n\nTo build your Driver, you should first download a few dependencies:\n\n#### Debian/Ubuntu\n\n````sh\napt install -y pipx build-essential ninja-build libssl-dev libgmp-dev zlib1g-dev openssl libpcre3-dev php-dev \u0026\u0026 pipx install cmake\n````\n\nAfter that, you can run the build command inside the repository root folder:\n\n````sh\nphpize\n./configure\nmake -j$(nproc)\nsudo make install\n````\n\n## Contributing\n\n[Read our contribution policy][contribution-policy] for a detailed description\nof the process.\n\n## Running tests\n\nSoon.\n\n## Copyright\n\n\u0026copy; DataStax, Inc.\n\nLicensed under the Apache License, Version 2.0 (the “License”); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\n[Apache Cassandra]: http://cassandra.apache.org\n\n[DSE PHP driver]: http://docs.datastax.com/en/developer/php-driver-dse/latest\n\n[DataStax Enterprise]: http://www.datastax.com/products/datastax-enterprise\n\n[DataStax C/C++ Driver for Apache Cassandra]: http://docs.datastax.com/en/developer/cpp-driver/latest\n\n[DataStax download server]: http://downloads.datastax.com/php-driver\n\n[GitHub]: https://github.com/datastax/php-driver\n\n[Home]: http://docs.datastax.com/en/developer/php-driver/latest\n\n[API]: http://docs.datastax.com/en/developer/php-driver/latest/api\n\n[installing-details]: https://github.com/datastax/php-driver/blob/master/ext/README.md\n\n[contribution-policy]: https://github.com/datastax/php-driver/blob/master/CONTRIBUTING.md\n\n[Behat Framework]: http://docs.behat.org\n\n[Features]: /tests/features\n\n[`duration`]: /tests/features/duration.feature\n\n[simple string]: /tests/features/simple_string_queries.feature\n\n[`tinyint` and `smallint`]: /tests/features/datatypes.feature#L92\n\n[`date`]: /tests/features/datatypes.feature#L135\n\n[`time`]: /tests/features/datatypes.feature#L170\n\n[user-defined function and aggregate]: /tests/features/function_and_aggregate_metadata.feature\n\n[secondary index]: /tests/features/secondary_index_metadata.feature\n\n[materialized view]: /tests/features/materialized_view_metadata.feature\n","funding_links":[],"categories":["C++","Drivers and Libraries"],"sub_categories":["PHP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe4rt%2Fscylladb-php-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhe4rt%2Fscylladb-php-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhe4rt%2Fscylladb-php-driver/lists"}