0

I'm trying to use in PHP Cassandra with this Driver: https://github.com/datastax/php-driver.

So, I want to know if is it possible to use to use [PDOStatement::fetch] (https://www.php.net/manual/fr/pdostatement.fetch.php) and [PDOStatement::rowCount] (https://www.php.net/manual/fr/pdostatement.rowcount.php) with Cassandra without any problem EXACTLY like it possible to use these PDO Functions with MySQL?

BenMorel
  • 34,448
  • 50
  • 182
  • 322

2 Answers2

0

One likely needs to use a "PDO driver implementation for Cassandra CQL" ...
alike this one here: https://github.com/Orange-OpenSource/YACassandraPDO

Only then PDO would be able to produce CQL syntax.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0

I don't believe PDOStatement will work out of the box with the Cassandra PHP driver.

Years ago (around 2011), there was a Cassandra PDO driver available on Google Code which worked with Thrift -- https://code.google.com/archive/a/apache-extras.org/p/cassandra-pdo.

It was forked by Orange to provide CQL support -- https://github.com/Orange-OpenSource/YACassandraPDO. However, the last release was all the way back to 2014 and it doesn't look like there has been any work on it since 2015.

As a side note, the Cassandra PHP driver has been in maintenance mode for a number of years now with the last release (v1.3.2) going back to 2017. Although we continue to accept pull requests from contributors, I wouldn't recommend doing any new project that uses this driver given it has not been in active development for years. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23