Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130549 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 7DA5E1A00BC for ; Fri, 3 Apr 2026 16:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1775232752; bh=0m3NOV9nbqupgqC038D6m/t+w8DzATJpRD+FeIb9YhY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dTa/QhOAKmKNaF+v4pOycCo+5tsZ2DOpdBYaQ1K/9TxNcMeTJogemOlGWWUKd94YE sFo25pocs/zFjbABnszkujeZO39ubXbS/Qi8dUDjr0XsQPCClwWmgF5D6Q4o+CJxrI np7HAMNg6LjetnNA2XjEGtd87Gakv91+Efdf3SFMAm0tenN+neFJTudxwiMpWwnbUY FVt9iHi57FNGXJhOuloiuH65GRi5CwvJL/yBxNnnvVg1sWP5tegRpOUEYzhmVOQh+w sVyDKETB7KvdXRTD4TChbODV2ReRwx6lyOExmx8KXGlwEDFo0KWtgM3K4vsatlh3NW ZdfAcc3eThI8g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 6409418004C for ; Fri, 3 Apr 2026 16:12:31 +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-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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:12:26 +0000 (UTC) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-486ff201041so20100295e9.1 for ; Fri, 03 Apr 2026 09:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775232740; cv=none; d=google.com; s=arc-20240605; b=MvjnFmmYQcNZm4ny3GjiClwPlYqykoi3LIGwH7PxA4qKLL/oyG5cL6upcHb7nwcHZn qrAFMcfPrcA2w2Vp1O+zwazRe0dkw4tPdqf515nV0E1Zht/4enei/J4U52/G/7hhkHht BGTqpIZSAGlyghosgdn/JChiCwrf+3lfWvu54eFH7K6zcuYbWkzBj5jeWkES/t47qudF gle9sCjZp6d77wZ1RI+Wfz9TEeXLodAkAGMEtWrXoG1ZrypQdktnG+LL4V23GGcp488y yaFnfwJANMIXkySi3/9ox+YpnX4OnMjBkKeiQ1RmqUAZqnWdL6YM1s3mZVbfVBfbGQ4t t+zw== 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=p4fiAQe9VB5LXk9LARgj9AnJqFsuTwnESWNqMQ3w8II=; fh=p7SchcpifR88zu0/jxFxgMBCscuWI+ZmPeB48AQRy6g=; b=EjfeleoKvQxRxTTZgiz+IsKvDxFQ6eA54EiDWDZBIYlwbZ0+BJxrT9XBN+Vr7wNfUu hM3bivLnNVN/ADqovwVFJaObuAO5/ImFVLHctK0/LvAyN4081qKnTu4mnOmVmIAE2g85 P7KIMHu0opIahzJplAnEpN4vmJKAltGsPL6l6yaJ/YdfkDX10+Zk+KRSrb5TqWDC0Nv3 7NzlckQCkvoSwYgcwR+GhXEHWMSE4Np2ps9TZ9uoI7O5rTODeWM/6WTPd6LsiF7rCOQx +WpgvVn1K9xO2sFeM0lVO5C4n2LodVS/6F1W+8OuOFizpuVajBUGKZiLbSojJ0Vu+S8F 3n3A==; 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=1775232740; x=1775837540; 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=p4fiAQe9VB5LXk9LARgj9AnJqFsuTwnESWNqMQ3w8II=; b=CYSxDxpj3zTFiev53TYWscGu6NtlFvroM8v58Mfwd29g0Ta1K97GLF9wqvSICSsLg5 r9vnAXLdBp2J7yKlATmr4bLVikoXzvgyBNE1CefD6Jl7GBqzoGboKnDRbJYegDN0OqQQ 0GjpNc0D0JX7HqIfkxO/357BmBIApQaiwRfKEIPX+Wdbz/lQaiAsu84BKM/t8oBhaPFq WuVcpje0xO21AaADS1JPtGHZSaz63VVfIsMzx3tLCRRu/NwSF7FJS1foCvOOba6m/Dcj r86Nm8wFxjgD8ZAoCjniDimomBRYGe6Labad9QmV8eNGl8RYf7MXkE91Ag2+3q9/Ee2Z DAYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775232740; x=1775837540; 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=p4fiAQe9VB5LXk9LARgj9AnJqFsuTwnESWNqMQ3w8II=; b=RpgAI73A/lmyJ3MO2VaGcwPDi0Ns2XPukm2nHz3+J8TObsd54/ip2d3XqolDgaXCXh nVQPKIyqtBv/oCEJj/aVWhAiDXXYqq8Psa02EtgrHVXL6BcsMekxCZpVyjMhteOZTbU4 WECWQdoSROzvNKiZims5PtTY8g0klKAhNrP5mlG/m6QDrtOZlQOW5oXUCdKDV/6poj5J tg23Wq6KkMesKL9c7w+qWD5ztC79M3wvVhbAHmAbbHt9Zyl9T+UUBbN66JKPTK4iwpwO 7qYtjuYQv2OFsMgAv5qQwx5UW2cF9MYLIrRe20qWvSqNF7jkRp78fFO4gPY6ft2TwOx6 Im4A== X-Forwarded-Encrypted: i=1; AJvYcCUYOsFBTeQMkS5pz8HYl2tiD+kCD8FX1E6NSXko6ePHOPdaoglVNCDkXULwQ/fPeDNpbVNYny5NXo8=@lists.php.net X-Gm-Message-State: AOJu0YxHSGQEQKTd4GRu5xBQGL8HYMlCpUAOMsdSokKr8rVhljzByak3 1C8polWXhiZvt54qLcwDw9Eevz9y3anJHFa0NmGtAucMksr+L25UVqhLUx9M4Yq2Ya5xhvMFjQm 2Fob3aqRe6uR+T3suTj5NoCExQ5ApVQaSzlAc2Pm3 X-Gm-Gg: ATEYQzw4ftsOSKleuTCGgg+rKR1jCWyxNV42XNZFRN5VX1Z12wUU/k/lGxNQucowLiy C6QBrKfcIbwNhyAGJ1fvrU4NOdDDMSNldl2dxSp2Hb7WdCV6gLs8vHX1E+QpqTGAIscUUcjCPXt JZjgcqd4K7K5PIBrJCbEJmY4s8T8HlJOJCuFNQdpnGYjlwxxxn0bkKC9m3Ud4Un0TW5CHK9mKv0 QMbzAyR1CKvq4/gCDw/HqOGAGgrfkfLX1LvL4BqZ8ZahjCAJ4N8ycUeFiC6kLc9g3B3P9nbUIiV aFcLw1LGk9vpL3vvbgj8CmZXo8WDCGzDqxcj9DZV8IOTLlesQ0EQxCzKBxDvl3JkjFAm X-Received: by 2002:a05:600c:638e:b0:480:2521:4d92 with SMTP id 5b1f17b1804b1-488997b23c6mr56469455e9.24.1775232739954; Fri, 03 Apr 2026 09:12:19 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <606EDE71-8E63-4626-A509-5E067DA3EACA@sakiot.com> In-Reply-To: <606EDE71-8E63-4626-A509-5E067DA3EACA@sakiot.com> Date: Fri, 3 Apr 2026 12:12:08 -0400 X-Gm-Features: AQROBzAQocMS_Qieeq5y3ettxO0to7Xt9n_caMU1QTOFBlcrOcCDc8KI7OY87JI Message-ID: Subject: Re: [PHP-DEV] PDO SQLite: statement attributes for SQL text retrieval To: Saki Takamachi Cc: Kamil Tekiela , internals@lists.php.net, saki@php.net Content-Type: multipart/alternative; boundary="000000000000dbe4b5064e909442" From: ilia@ilia.ws (Ilia) --000000000000dbe4b5064e909442 Content-Type: text/plain; charset="UTF-8" > > First of all, one quick note: there is a convention here that you should > not post above the quoted text, so please keep that in mind. > Sorry my bad. PHP convention is a bit different from the mail client default. I will improve, but habits take a while to break, so I can't promise this is the last one :) > As a basic premise, retrieving the SQL is already possible at present: > > ``` > $sql = $stmt->queryString; > ``` > > What you are trying to implement for SQLite this time makes it possible to > retrieve the SQL in either its pre-binding or post-binding state, so it is > slightly more capable than the property above. > This is a slightly different functionality and connotation as you've correctly pointed out. Therefore, it definitely warrants having it due to the different functionality/capability. If so, I think it would be better to make these new features methods > instead, which would also make it clearer that they are SQLite-specific > functionality. > > This has another advantage as well: it would make it possible to declare > the return type explicitly. > 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 parameters allowing either pre/post binding state to be returned, probably defaulting to the pre-binding state. I don't think 2 methods are needed for functionality that is functionally very similar. That being said, I still prefer an attribute because this isn't an actionable function (like sqliteCreateFunction) but rather something that retrieves information, which to me seems more appropriate for attribute retrieval similar to Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE for example. I don't think this warrants its own function and the value of setting a return type seems minimal. -- Ilia Alshanetsky Technologist, CTO, Entrepreneur E: ilia@ilia.ws T: @iliaa B: http://ilia.ws --000000000000dbe4b5064e909442 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
First of all, one quick note: ther= e is a convention here that you should not post above the quoted text, so p= lease keep that in mind.

Sorry my bad. = PHP convention is a bit different from the mail client default. I will impr= ove, but habits=C2=A0take a while to break, so I can't promise this is = the last one :)=C2=A0
=C2=A0
As a basic premise, retrieving the SQL is already possible at present:

```
$sql =3D $stmt->queryString;
```

What you are trying to implement for SQLite this time makes it possible to = retrieve the SQL in either its pre-binding or post-binding state, so it is = slightly more capable than the property above.

This is a slightly different functionality and connotation as you&#= 39;ve correctly pointed out. Therefore, it definitely warrants having it du= e to the different functionality/capability.=C2=A0

If so, I think it would be be= tter to make these new features methods instead, which would also make it c= learer that they are SQLite-specific functionality.

This has another advantage as well: it would make it possible to declare th= e return type explicitly.

I don't f= eel 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 param= eters allowing either pre/post binding state to be returned, probably defau= lting to the pre-binding state.
I don't think 2 methods are n= eeded for functionality that is functionally very similar.=C2=A0
=
That being said, I still prefer an attribute because this is= n't an actionable function (like sqliteCreateFunction) but rather somet= hing that retrieves information, which to me seems more appropriate for att= ribute retrieval similar to Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE for example.= =C2=A0
I don't think this warrants its own function and the v= alue of setting a return type seems minimal.

--
Ilia Alshanetsky
Technologist, CTO, E= ntrepreneur
T: @iliaa=C2=A0
--000000000000dbe4b5064e909442--