Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E781F86C3 for ; Tue, 30 Aug 2011 16:00:02 +0000 (UTC) Received: (qmail 10684 invoked by uid 500); 30 Aug 2011 16:00:02 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 9987 invoked by uid 500); 30 Aug 2011 16:00:01 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 9979 invoked by uid 99); 30 Aug 2011 16:00:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 16:00:00 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Aug 2011 15:59:59 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DEDF9D779C for ; Tue, 30 Aug 2011 15:59:38 +0000 (UTC) Date: Tue, 30 Aug 2011 15:59:38 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: <917048166.8049.1314719978909.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <534288118.35172.1313192127380.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-3025) PHP/PDO driver for Cassandra CQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-3025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13093845#comment-13093845 ] Jonathan Ellis commented on CASSANDRA-3025: ------------------------------------------- Great, that looks reasonable. Let me come back to this comment earlier: bq. bq. PDO doesn't seem to allow variable number of columns per row bq. How deep does this assumption go? In JDBC all rows are supposed to have the same number of columns but nothing actually breaks if you quietly ignore this. The reason I ask is, all current scenarios will work fine with the "take superset of all rows" approach, but UNION support in CASSANDRA-3069 will make it easier to get resultsets of wildly different row sizes. > 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, pdo_cassandra-0.1.3.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} > $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