Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130551 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id A966A1A00BC for ; Fri, 3 Apr 2026 16:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775233985; bh=iKsJPKFLEjr1Gt7r0TtpIXpeRP3nG1COus++u6bWLp0=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=iEJTrrgiMyH+s3IWb30eKmyDE2oi18ni2VBJnXNLa0POa9qbmBenTJbbPp7OAG5ee 2HCnHIIvqPjkCQ7gHPwuX2OKJ3cK1SF4aBy8imzisG3sZH+kqh3cXKjNs7qgmxUxST qin0CE0hgfP2v8S7hgTJ9LAB9N808CWUxsV6ss0jEZHlVR5cbNWe0xNPSFWhrr+psl LoxDi9QiY+gW+27fpshRrVOeN2rB1A7Cu2zWQXpFlQCi0bPmZWK9VaYDAweCbDNPOY fnGm7WSJA3k9QKfBSkiHvYAjq0U4xqwcFO1v5KGCflG77WLREgAqyaJiUMvWv4AADP 71b6dDG6YPRag== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7A1721804D7 for ; Fri, 3 Apr 2026 16:33:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 3 Apr 2026 16:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1775233977; bh=iKsJPKFLEjr1Gt7r0TtpIXpeRP3nG1COus++u6bWLp0=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=WDybl1CA5lVCM9jp9E1hMUIAkXO+QUNRHdo69hTJCNhxVFc1hXrdYwkkdftNv/q/8 T0tORDw0Ikw0Q84WDSL6yoeQz5F+TIkw6fn5D4PUcfrxtMIPpxNHyjZd1A9BCibV1l 3+MRHn5uN/rCj/fcUF9TYMJyYM3CKPZq8b1zZ8hU= Received: from smtpclient.apple (madb688d19.ap.nuro.jp [219.104.141.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 627F54019C; Sat, 4 Apr 2026 01:32:57 +0900 (JST) Content-Type: multipart/alternative; boundary=Apple-Mail-85B04204-4E92-4E09-BC07-80E8D561F26E Content-Transfer-Encoding: 7bit Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] PDO SQLite: statement attributes for SQL text retrieval In-Reply-To: Cc: Kamil Tekiela , internals@lists.php.net, saki@php.net Date: Sat, 4 Apr 2026 01:32:44 +0900 Message-ID: <5652D731-0D2B-49ED-941C-FA6BC60368DC@sakiot.com> References: To: Ilia X-Mailer: iPhone Mail (23D8133) From: saki@sakiot.com (Saki Takamachi) --Apple-Mail-85B04204-4E92-4E09-BC07-80E8D561F26E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Sorry my bad. PHP convention is a bit different from the mail client defau= lt. I will improve, but habits take a while to break, so I can't promise thi= s is the last one :)=20 No worries, I make that kind of mistake all the time too :) > This is a slightly different functionality and connotation as you've corre= ctly pointed out. Therefore, it definitely warrants having it due to the dif= ferent functionality/capability.=20 Implementing every feature that exists would increase the maintenance burden= on the codebase, so it may be worth being a little cautious in deciding whe= ther this should be implemented. I suspect this is probably something Kamil is also concerned about. Of course, if a good use case becomes clear in the discussion going forward,= I would not oppose implementing it. > I don't feel strongly about one way or the other. I'm happy to revise this= into a function if the consensus is that everyone is more comfortable with p= arameters allowing either pre/post binding state to be returned, probably de= faulting to the pre-binding state. > I don't think 2 methods are needed for functionality that is functionally v= ery similar.=20 >=20 > That being said, I still prefer an attribute because this isn't an actiona= ble function (like sqliteCreateFunction) but rather something that retrieves= information, which to me seems more appropriate for attribute retrieval sim= ilar to Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE for example.=20 > I don't think this warrants its own function and the value of setting a re= turn type seems minimal. > Looking at pdo/PgSQL and pdo/SQlite they both limit custom functions to th= ings that change data. However, pdo/MySQL and pdo/Firebird break the convent= ion, each has a single custom function for info retrieval, so there isn't te= chnically as convention universally followed convention here. I=E2=80=99m sorry, I just realized something very important. The place where this should be implemented is the statement class, not the d= river, right? Drivers have subclasses, but statements do not. So implementing this as a specialized method would not really be very practi= cal after all=E2=80=A6 One possible approach would be to add a method on the driver and pass the st= atement as an argument, but that seems very confusing to me. So in this case, the implementation approach used in your PR may be the only= realistic option after all=E2=80=A6 Regards, Saki --Apple-Mail-85B04204-4E92-4E09-BC07-80E8D561F26E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Sorry my bad. PHP convention is a bit different from the mail cl= ient default. I will improve, but habits take a while to break, so I ca= n't promise this is the last one :) 

=


<= span class=3D"s1">This is a slightly different functionality and connotation= as you've correctly pointed out. Therefore, it definitely warrants having i= t due to the different functionality/capability. 

=

Im= plementing every feature that exists would increase the maintenance burden o= n the codebase, so it may be worth being a little cautious in deciding wheth= er this should be implemented.


I suspect this is probably= something Kamil is also concerned about.


Of course, if= a good use case becomes clear in the discussion going forward, I would not o= ppose implementing it.


I don't feel strongly about o= ne way or the other. I'm happy to revise this into a function if the consens= us is that everyone is more comfortable with parameters allowing either pre/= post binding state to be returned, probably defaulting to the pre-binding st= ate.

I don't think 2 methods are needed for functional= ity that is functionally very similar. 


That being said, I still prefer an attr= ibute because this isn't an actionable function (like sqliteCreateFunction) b= ut rather something that retrieves information, which to me seems more appro= priate for attribute retrieval similar to Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE= for example. 

I don't think this warrants its ow= n function and the value of setting a return type seems minimal.

<= /blockquote>
Looking at pdo/PgSQL and pdo/SQlite they both= limit custom functions to things that change data. However, pdo/MySQL and p= do/Firebird break the convention, each has a single custom function for info= retrieval, so there isn't technically as convention universally followed co= nvention here.

I=E2=80=99m sorry, I just realize= d something very important.

The place where this should be implemented= is the statement class, not the driver, right?
Drivers have subclasses, bu= t statements do not.

So implementing this as a specialized method wou= ld not really be very practical after all=E2=80=A6

One possible appro= ach would be to add a method on the driver and pass the statement as an argu= ment, but that seems very confusing to me.

So in this case, the imple= mentation approach used in your PR may be the only realistic option after al= l=E2=80=A6

Regards,

Saki


= --Apple-Mail-85B04204-4E92-4E09-BC07-80E8D561F26E--