Download the PHP package a-h-abid/eloquent-cassandra without Composer

On this page you can find all versions of the php package a-h-abid/eloquent-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 eloquent-cassandra

Eloquent Cassandra

Cassandra driver for Eloquent ORM.

Installation


Note: Make sure you have the Cassandra PHP driver installed (version 1.3+). You can find more information at DataStax PHP Driver.

Installation using composer:

Laravel

And add the service provider in config/app.php:

The service provider will register a cassandra database extension with the original database manager. There is no need to register additional facades or objects. When using cassandra connections, Laravel will automatically provide you with the corresponding cassandra objects.

For usage outside Laravel, check out the Capsule manager and add:

Lumen

Add next lines to your bootstrap.php

Configuration

Change your default database connection name in config/database.php:

And add a new cassandra connection:

You can connect to multiple servers with the following configuration:

Note: you can enter all of your nodes in .env like :

# .env
DB_HOST=192.168.0.1,192.168.0.2,192.168.0.3

Note: list of available consistency levels (php constants):

Cassandra::CONSISTENCY_ANY
Cassandra::CONSISTENCY_ONE
Cassandra::CONSISTENCY_TWO
Cassandra::CONSISTENCY_THREE
Cassandra::CONSISTENCY_QUORUM
Cassandra::CONSISTENCY_ALL
Cassandra::CONSISTENCY_SERIAL
Cassandra::CONSISTENCY_QUORUM
Cassandra::CONSISTENCY_LOCAL_QUORUM
Cassandra::CONSISTENCY_EACH_QUORUM
Cassandra::CONSISTENCY_LOCAL_SERIAL
Cassandra::CONSISTENCY_LOCAL_ONE

Note: you can set specific consistency level according to the query using options

Eloquent

Model Usage

Supported most of eloquent query build features, events, fields access.

Relations - NOT SUPPORTED

Attributes casting

There is ability to use UUID as model primary key

Query Builder

The database driver plugs right into the original query builder. When using cassandra connections, you will be able to build fluent queries to perform database operations.

If you did not change your default database connection, you will need to specify it when querying.

Default use of get method of query builder will call chunked fetch from database. Chunk size can be configured on config file ('page_size' => env('DB_PAGE_SIZE', 5000)) or with additional query builder`s method setPageSize.

WARNING: Not recomended to use get if there are a lot of data in table. Use getPage instead.

Get single page of resuts

There is an ability to set next page token what allows to get next chunk of results

Get next page:

Get next page token:

Append collection with next page`s result:

Check if it is last page:

Get raw cassandra response for current page (\Cassandra\Rows):

Read more about the query builder on http://laravel.com/docs/queries

Examples

TODO:

[ ] full support of composite primary key [ ] full test coverage [ ] fix diff between \Cassandra\Date with Carbon [ ] add schema queries support [ ] add ability to use async queries

Docker:

There is docker-compose setup stored in package root. It can be used for local development and test running. Works well with PHPStorm testing tools + coverage.

Run command below inside of the "main" container to run tests and generate coverage file:


All versions of eloquent-cassandra with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
ext-cassandra Version ^1.3
illuminate/support Version ^5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0
illuminate/container Version ^5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0
illuminate/database Version ^5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0
illuminate/events Version ^5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0
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 a-h-abid/eloquent-cassandra contains the following files

Loading the files please wait ....