Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130547 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 C278A1A00BC for ; Fri, 3 Apr 2026 15:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775231331; bh=3NV4LB7gkY58qTlL+9MHLtKmQnHAbmjUZ+LLk6HpuWA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dHw5sd40C/5XveQlWA8MMLkZ+bCqp/aDDtRuRlq83cOrDwnSYzgSQvqWl+dcupVB5 +TOKE/x6EHXMD3VdSYPWBNPDZYK2KDPtroTEQsekmF6Lng4F83DoXl8OTBeD/y/0i+ Hb5L+K+vVTrKCF7Q6j7OHDVtPHaPEwxjbzpNiWyIUV3de/CNe88nGeCk2k/GCYeEwf N3mz6q7ZDLOlJzWDAVjgvxPIiLgXLJY4l0dB8FInEPw0uUu6PzQk/gZbvMTj1uQh6c cARJrQSw6f7zR1VUFG113mOxYmVsUHxizsPYUVOGWbpsIb4HOSrgqJXpxkTgfb7fLQ Xgw/RNNsWrmaQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9DB93180040 for ; Fri, 3 Apr 2026 15:48:50 +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=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 15:48:50 +0000 (UTC) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43cfd96354aso1253680f8f.1 for ; Fri, 03 Apr 2026 08:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775231319; cv=none; d=google.com; s=arc-20240605; b=NNBF05hJ4m0CWEOY4nYnAgdNUee7UFiINGxkT1QULa6yyp37xs3+F7s0KMdid9rNbH lUE6sFNvT4iz14ILe7CQZE6CcxRoUh9Ugpcfg9JJu50aXjLomIF23vgtRNx03+juHdMj aGyzybTggy5kUA0RWi4lgXKy8CRCLpM2C0EKb9JaHZxA6L/72pols2OUDnJ/30BsUvFB 9874LmnsdObBXsBMv1RooxnzKkrRSvovaCG9dbocjkjogHDo9bwLWA5U10QYoQaozMEy 2Tef0f54xdUkYfh6vMHJidcwc5ph7AxpE6KOFz2UsLUI86NvHTBW7/eFNy59KCZIs/U4 cIOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=dcXyK2R1POHaHlIxiwlN/QYIVPK/DmrrJSmAEoxC3OY=; fh=TxbkRDLnz5ng31q/zdSXdA5aavfWeZozqwPd/DA1odk=; b=BB62qIPeP3iC2uT1H7CgvHSzsJswhiOqPjslzEb8tk55jl4abFAh8TbLO90r2DqMes VTrLQVDqatcOu5mAz3ZlzN0KlWG6GbtjBNOcX1SAZEInZOM9Qs2ymfNCcSES/+Jk5u7z gOueHz5EFQdNF4ERnzK5GMVKQmoNd9akqN2Q3Z06sqttC9c+lWatMN5MViNR0/TIZfyo BgqGNizKGV0GM8Er44ApS1eBxL4Ld+nt66uBlwEXK8br//Jocy3K9jZn7TEJF6FPKoD0 rZnu79vbiotV0ttvjUJWpcWxo0d2CSzhBArNk6kpSBNOW1ya+hoBVd0hK1yKWgWa4vW/ PRNw==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilia.ws; s=google; t=1775231319; x=1775836119; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=dcXyK2R1POHaHlIxiwlN/QYIVPK/DmrrJSmAEoxC3OY=; b=S+4gIZyz53ii0fMjKdCgj46H7PBVvNGwd7+v3TW9Zf7BTh9E/0Rw29NHfAfVZ0jXQN mbDpT1TosENekrlSynU+TsVWxOHTkUNzwkOpxqlx869eNSYI7bZUh4u2KpAjnxPiyZWw GYAKi2AhW0Jfv971GV+1Y44y6a5kEKYlZnVguscwCLALqnIkbuMFGaRGUiYAzyquA7qi GZPA3rSSL8JIw32peOdl6rWY4+yQm5LHvKw+UATwD+QsHmcHAJcUxLateij5MqIkjeCD hl5Z2ADSEqxHs4JepYOum/lzA92qozGX6KyamUJAQbVdupZAFM3+ddx0IsEn7927nCrW uWzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775231319; x=1775836119; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dcXyK2R1POHaHlIxiwlN/QYIVPK/DmrrJSmAEoxC3OY=; b=LlOjs2gkGu49KvaZQc7YgKODXTa9bEJ3uBf2SiX/rWySrw0HtgdyooeNKZrSnpL02t i9GkZqaAxdcDvc10wBrNxHEy3G48f9sZqiLhSp9pSte5/fl1fsJFOqqj/l37lgjrC6/c QgqqfE4h8em8Ofsufm5ODdK5jYdVPZdpcgtqevovJXNoilHlI5rqsiP99UTYvQrRXk84 RsFZVVX6UQVs8voxhmt6uoopuZP9l6IEWqTAaIkWLbimZOgzZJd64ikq3CUSIXM+K3Xw LiQBneMEoWxw57TETOJYyoMbUNS4kg2xTuaIi8z6Yttiu6t+ceURFrS4Kz23glUkCvHh PWHw== X-Gm-Message-State: AOJu0YyZxKUCc+7gXU5z1RMbbzxitwlmPlZEzWxB7eLc4X4S9Sh08SVk KeY0liAp3jlA6lvZKnNETBxTRSc9XOgPt1g/UCb/r7+/n+iAyGucn2TSrwqNTVvw/jeHN7tx//i 0cDu2UbYqhdfYGRW7Gd7Ax9qaILT1X69aHuNNJPchM22pvVCKB5KIzg== X-Gm-Gg: AeBDieuYQrafxuRnadAQV8pLA763SjGUPLdacpphdv4ZpImBDX/FmJu/VlP9N8aD6Ce MuAGGQ6gjbLI8LupFOGPsh85Pjc1xDalCwkLeiyw7GKHz4hXHOvaFJU69MU81+odEShd+R4Y5Pz TitEP8Fj9tFF+3PXDbRxm0EdYrPrrtiBpXYcB9yTih1kNxc3QrPgNy80g7iyz+O7Bl7qGsbDzpP /Z4sYAGPArQ9S3FY8zi3kqB/nbqGEMh08esZlU5Ns/QBh414ceJCoCYDAJjPqumtLa06ZzZBvYM arOpC+mwTkxIQSoE30NPZLcp4l+BO3tRjF06O61YPWtDQ74V7198L+jeOlANhHPHdqdZ X-Received: by 2002:a05:6000:2512:b0:43c:fd18:a30b with SMTP id ffacd0b85a97d-43d292f4ffamr5242667f8f.42.1775231319038; Fri, 03 Apr 2026 08:48:39 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 3 Apr 2026 11:48:27 -0400 X-Gm-Features: AQROBzBwyQwbfGXWsL6UD9Jtypg2wjG7A9R5_lP7w18f4lWP6M6X4Tlp3OFZTk0 Message-ID: Subject: Re: [PHP-DEV] PDO SQLite: statement attributes for SQL text retrieval To: Kamil Tekiela Cc: PHP Developers Mailing List , saki@php.net Content-Type: multipart/alternative; boundary="0000000000002a6c72064e904012" From: ilia@ilia.ws (Ilia) --0000000000002a6c72064e904012 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable When a query is structured (generated), easily getting the final value has merit. This is especially true when you need to see how the bound parameters were substituted, which might occur in a different file or function, therefore, having the ability to fetch that clearly adds value, in my opinion. One other scenario can be audit trails and logging, if you wanted to capture changes made for update/insert operations without actually capturing the data, using $stmt->getAttribute(Pdo\Sqlite::ATTR_SQL); to get the query without the data could also be a valid use-case for this functionality. I am somewhat curios as to the reasoning for the objection, give that the functionality does not add any meaningful complexity, performance impact or any other conceivable downsides I can think of, perhaps you can share some your reasoning? On Fri, Apr 3, 2026 at 11:38=E2=80=AFAM Kamil Tekiela wrote: > On Fri, 3 Apr 2026 at 16:29, Ilia wrote: > > > > In the context of the SQLite extension, this makes 100% sense as a > separate function. In the context of PDO which tries to be generic when > fetching essentially meta-data IMO it makes more sense to fetch via the > attribute framework which is generic as opposed to creating driver-specif= ic > functions. > > > > In terms of utility this primarily be helpful for debugging / analysis > purposes and completes the driver implementation, making what PDO offers > match what the native extension offers. It doesn't impact performance > etc... so no negative effect that I can see > > That's the thing. I still don't understand what kind of code would > necessitate the use of this function. What would the debugging code > look like? Why can it not be achieved with the existing functionality? > > Not everything deserves to be brought from SQLite3 to PDO. > --=20 Ilia Alshanetsky Technologist, CTO, Entrepreneur E: ilia@ilia.ws T: @iliaa B: http://ilia.ws --0000000000002a6c72064e904012 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When a query is structured (generated), easily getting the= final value has merit. This is especially true when you need to see how th= e bound parameters=C2=A0were substituted, which might occur in a different = file or function, therefore, having the ability to fetch that clearly adds = value, in my opinion.

One other scenario can be audit tr= ails and logging, if you wanted to capture changes made for update/insert o= perations without actually capturing the data, using=C2=A0$stmt->getAttr= ibute(Pdo\Sqlite::ATTR_SQL);=C2=A0 to get the query without the data could = also be a valid use-case for this functionality.=C2=A0

=
I am somewhat curios as to the reasoning for the objection, give that = the functionality does not add any meaningful complexity, performance impac= t or any other conceivable=C2=A0downsides I can think=C2=A0of, perhaps you = can share some your reasoning?

On Fri, Apr 3, 20= 26 at 11:38=E2=80=AFAM Kamil Tekiela <tekiela246@gmail.com> wrote:
On Fri, 3 Apr 2026 at 16:29, Ilia <ilia@ilia.ws> wrote:
>
> In the context of the SQLite extension, this makes 100% sense as a sep= arate function. In the context of PDO which tries to be generic when fetchi= ng essentially meta-data IMO it makes more sense to fetch via the attribute= framework which is generic as opposed to creating driver-specific function= s.
>
> In terms of utility this primarily be helpful for debugging / analysis= purposes and completes the driver implementation, making what PDO offers m= atch what the native extension offers. It doesn't impact performance et= c... so no negative effect that I can see

That's the thing. I still don't understand what kind of code would<= br> necessitate the use of this function. What would the debugging code
look like? Why can it not be achieved with the existing functionality?

Not everything deserves to be brought from SQLite3 to PDO.


--
Ilia Alshanetsky
Technologist, CTO, Entrepre= neur
T: @iliaa=C2=A0
--0000000000002a6c72064e904012--