Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73480 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3655 invoked from network); 30 Mar 2014 11:41:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Mar 2014 11:41:43 -0000 Authentication-Results: pb1.pair.com header.from=phofstetter@sensational.ch; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=phofstetter@sensational.ch; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sensational.ch designates 195.226.6.199 as permitted sender) X-PHP-List-Original-Sender: phofstetter@sensational.ch X-Host-Fingerprint: 195.226.6.199 mail.sensational.ch Linux 2.6 Received: from [195.226.6.199] ([195.226.6.199:41666] helo=mail.sensational.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/20-00754-6F208335 for ; Sun, 30 Mar 2014 06:41:42 -0500 Received: from mail-qc0-f177.google.com ([209.85.216.177]:35473) by mail.sensational.ch with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71 and XAMS 0.0.20) id 1WUE7P-0001lX-Dc for internals@lists.php.net; Sun, 30 Mar 2014 13:41:39 +0200 Received: by mail-qc0-f177.google.com with SMTP id w7so7693096qcr.22 for ; Sun, 30 Mar 2014 04:41:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=XxfLZNLZTCU6VAia+EbJMrAAkj6tpSAwUVPlwbHWawU=; b=k2k/AmWc2X7boLqzYAHVQNLYyjS7coDdEmZNcoaK+TqDC1hlNiAHwHGUdcJfWab5AO SqDLAVRF5wOxJUrw5ol4EOi0K0e9FZxssDk3H5WFaQoURwP+rxzpdVvli7NMiuxtl/QU U9jCufiTk8d1CgfaHfountiSrxkhfVyQyLBbejv++Z93Br9Z+SSeqHOnYXbNlHySaneZ FCD6mjt28MmJ5m+YmHnf+Rn6iJ+hlUJV0uySITq9DgUoo0zpDFJmsLbfFLSBLZeRW28t qAM7E1aPHyz/sThPXa2lM8KIQ11QYCpxf/mtFTk8wgoT2/e5Y2UWtTYZx2eMPw8d1+Kp PVPg== X-Gm-Message-State: ALoCoQk1ZcMptvtL3pFxltA150L5fNHrf1SYljpARvo4mxiWQKAvaJTt7+9xs7sDDIlon5NtdjeakZtUUraw5+VeF7DCOGmK2FCUI1wEhxUu/XhKHPx5UIuknOvPvrIBv48T7dKD7tuyeQeT23pZ4di2ChYAdbzu65YUVu0RA5Wl/L58rBoZI8Y= X-Received: by 10.140.97.183 with SMTP id m52mr112234qge.108.1396179697947; Sun, 30 Mar 2014 04:41:37 -0700 (PDT) X-Received: by 10.140.97.183 with SMTP id m52mr112218qge.108.1396179697742; Sun, 30 Mar 2014 04:41:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.96.61.232 with HTTP; Sun, 30 Mar 2014 04:41:17 -0700 (PDT) Date: Sun, 30 Mar 2014 13:41:17 +0200 Message-ID: To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 209.85.216.177 X-SA-Exim-Mail-From: phofstetter@sensational.ch X-SA-Exim-Scanned: No (on mail.sensational.ch); SAEximRunCond expanded to false Subject: pdo_pgsql-Improvements From: phofstetter@sensational.ch (Philip Hofstetter) Hello, over the last few days I have been playing with pdo_pgsql a bit in order to make some wishes I've always had finally come true. So far, I've added 1) support for automatically parsing JSON result column (if the json extension is enabled) 2) support for automatically parsing array columns 3) support for turning timestamp and date columns into DateTime objects 4) a pgsqlQuoteIdentifier method to correctly quote table and column names (arguably, this should maybe go into PDO base) The first three features need enabling by setting PDO::PGSQL_ATTR_ADVANCED_TYPE_CONVERSIONS to true on either the PDO object or as a driver specific parameter to prepare(). Parsing the arrays feels especially important to me as the various userland solutions out here are either quite slow, unreadable or outright buggy. Arrays are a core feature of Postgres and map really well to arrays in PHP. 1 and 4 also have unit tests. Tests for 2 and 3 will be coming too. I'm writing here in order to find out whether you think that improving the pdo_pgsql driver is something you would think makes sense for you, in which case I will write an official RFC. My work so far is on https://github.com/pilif/php-src/commits/pdo_pgsql-improvements Stuff I still would also want to add is 1) support for DateTimeInterface bound parameters 2) support for Array as bound parameters (maybe - not sure if doable) 3) support for the new features of PGResult (9.3 and later) that expose information of what columns have failed a unique key constraint, for example. 4) Unit tests for everything, of course So, asking again: Do you guys think, this is worth writing an RFC for? Thank you in advance Philip