Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118031 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71734 invoked from network); 20 Jun 2022 23:37:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Jun 2022 23:37:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 194111804B1 for ; Mon, 20 Jun 2022 18:26:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS19151 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 20 Jun 2022 18:26:09 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id C80C15C0068 for ; Mon, 20 Jun 2022 21:26:08 -0400 (EDT) Received: from imap52 ([10.202.2.102]) by compute1.internal (MEProxy); Mon, 20 Jun 2022 21:26:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1655774768; x= 1655861168; bh=GMTqMthmhHmmRpWN1jdojYwBwTSi4+lBLTcMubJAQeE=; b=B sG6b0RKZAOnfulFH+Se/J/IwCyte5IEg5GThPs/0Mll/Ih9UOJ8Zwjqmcu7RN4lN xu2JlUphSHzRI1NI42GtgIbIDtj9qn4V3Ukv4v1mDcMUDnVEeS1nq2rCygup2XIg cR1iicl2mrJi8ONpOpDUWlsEH+dOQa1BGfvnEuo+c8ZeDRyXU+w9l/BCNGPN3z5X NzjS/6+Mxh9m4LluGc8Y2n1mNxnb3+lOkAVtok9ByCqrUMFXfQNNhCrt1G1jzUoY dMuSqHdqsdEQUasJFUARJe/cyAQ7fNlVNOwpR2EEQ1Vlx8IkS+WTiWGbw1ZqiWiv UIIzaaOzlKgStKfndiqdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1655774768; x=1655861168; bh=GMTqMthmhHmmRpWN1jdojYwBwTSi 4+lBLTcMubJAQeE=; b=Db9NInH+I6ZJBO3ocv5GYb4DoWzwBmy3RHrzXQlnL5b3 KbtTn7CBkP8UZe1EencCRJuOMe4dZAWldsjL/AYvZg8tgnnALnwwGnJVznqrouoa XHVACndTuLzhbHwKYXZeOfBTZrj8ApaSuW5VI7W1QM1LPDm5txxmxfSWR7D7mdRg BOUAzdlWe2PRoTUqtQGMdjGWW7XBVmpNIv1v3GFBLMcoFNz0dsigKIkeM6xkC/Q5 oP7lvn9Ku3a+sipOJWBGkEKWB7dqOKIbi795vjOE77jLPswGv2bKgy6a0a8zemWW hRX9XEP1ILuNr/ntcVQPZPQwKe+x+JwZBHlkd9KZyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefvddggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeevheehvdevjeelvdevgfelvefftdejkeelvdekgeeh fffgiedvjefhhfeltdduteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhi vghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 74600C6008B; Mon, 20 Jun 2022 21:26:08 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-713-g1f035dc716-fm-20220617.001-g1f035dc7 Mime-Version: 1.0 Message-ID: In-Reply-To: References: Date: Mon, 20 Jun 2022 20:25:46 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] [RFC] [Under Discussion] PDO driver specific sub-classes From: larry@garfieldtech.com ("Larry Garfield") On Mon, Jun 20, 2022, at 6:01 PM, Dan Ackroyd wrote: > Hi, > > Following previous discussions, here is an RFC to have DB specific > classes for PDO. > > https://wiki.php.net/rfc/pdo_driver_specific_subclasses > > cheers > Dan > Ack I'm conceptually in favor of this. A few comments: * Any chance I could convince you to move away from the DSN for the factory? Every DB system I've used has had to do some kind of mangling to build the DSN, but almost never takes its own configuration in the same format, which means there's always some amazingly stupid "parse a URL string to its components, then build up a new string to pass to PDO" step that serves no purpose other than to introduce bugs. If user/pass are separate args, why can't we just make type and host separate args, too? Especially with named args now so it's easy to skip or reordr the args. Please? * "Should the sub-classes only be avaiable when support for that DB is compiled in?" - I agree, probably not. Also, "available" is misspelled. * "Create all DB sub-classes?" - I'd say they all should have subclasses, even if empty. It's more consistent that way, and you can then also rely on instanceof giving you useful information rather than "well, it's not one of the special ones, so beyond that, NFI." * Re PQescapeIdentifier - My gut thought is that we should have separate methods for escaping value and identifier in the base class, and then on most DBs they're just identical. That way it's consistent for anyone building on top of it, because they can rely on escapeValue() and escapeIdentifier() always being The Right Thing To Do without worrying about which DB they're using. * "This RFC does not propose adding subclasses for any other PDO database not listed above. " - But does it presume that future RFCs may do so? This could currently be read as "let's not do that" rather than what I think the intent is, which is more "I'm not dealing with that here, talk about that later." If so, that could be clarified. --Larry Garfield