cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikko Koppanen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-3025) PHP/PDO driver for Cassandra CQL
Date Sat, 27 Aug 2011 01:07:29 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13092154#comment-13092154
] 

Mikko Koppanen commented on CASSANDRA-3025:
-------------------------------------------

Hello,

if I have following column families inside a keyspace:

CREATE TABLE cf1 (my_key text PRIMARY KEY, test int)
CREATE TABLE cf2 (my_key text PRIMARY KEY, test text)

where each one of them have the same column with different type. There doesn't seem to be
any information in the CqlResult telling me which column family the columns belong to. Does
this mean that I should parse each SELECT query and the column family from there?

It looks that key_alias is unique within column family as well, so there is no way of knowing
that "my_key" is ascii. This is slightly problematic when marshaling the values to correct
PHP types.



> PHP/PDO driver for Cassandra CQL
> --------------------------------
>
>                 Key: CASSANDRA-3025
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3025
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API
>            Reporter: Mikko Koppanen
>              Labels: php
>         Attachments: pdo_cassandra-0.1.0.tgz, pdo_cassandra-0.1.1.tgz, pdo_cassandra-0.1.2.tgz,
php_test_results_20110818_2317.txt
>
>
> Hello,
> attached is the initial version of the PDO driver for Cassandra CQL language. This is
a native PHP extension written in what I would call a combination of C and C++, due to PHP
being C. The thrift API used is the C++.
> The API looks roughly following:
> {code}
> <?php
> $db = new PDO('cassandra:host=127.0.0.1;port=9160');
> $db->exec ("CREATE KEYSPACE mytest with strategy_class = 'SimpleStrategy' and strategy_options:replication_factor=1;");
> $db->exec ("USE mytest");
> $db->exec ("CREATE COLUMNFAMILY users (
> 			my_key varchar PRIMARY KEY,
> 			full_name varchar );");
> 			
> $stmt = $db->prepare ("INSERT INTO users (my_key, full_name) VALUES (:key, :full_name);");
> $stmt->execute (array (':key' => 'mikko', ':full_name' => 'Mikko K' ));
> {code}
> Currently prepared statements are emulated on the client side but I understand that there
is a plan to add prepared statements to Cassandra CQL API as well. I will add this feature
in to the extension as soon as they are implemented.
> Additional documentation can be found in github https://github.com/mkoppanen/php-pdo_cassandra,
in the form of rendered MarkDown file. Tests are currently not included in the package file
and they can be found in the github for now as well.
> I have created documentation in docbook format as well, but have not yet rendered it.
> Comments and feedback are welcome.
> Thanks,
> Mikko

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message