Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110581 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8463 invoked from network); 16 Jun 2020 12:48:18 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2020 12:48:18 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3CC4D1804CB for ; Tue, 16 Jun 2020 04:33:43 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS16276 91.121.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mail.kd2.org (citrouille.kd2.org [91.121.181.110]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 16 Jun 2020 04:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bohwaz.net; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=l7y3e9hlhec/UIQvMHmTBPyCpfQfryISh+q4DIuuHnQ=; b=xP09hCIxAbsJm4J9YLhhTFV/+u E5+8cudij7YarBf84VMJme8yGQIBWp8pYe/mMzt8TNIG7PjGEyD20JDBUoXbYFLjkXh+6UPKmZo30 kwbgsgtiZGnHmU8Vf7PFVXF+juJNpg5Y14DROqzXnbf01nAi08tY2QcDnK96hxnthO1w=; Received: from [2a01:e0a:28:d640:62f2:62ff:feee:3dfb] (helo=platypus) by mail.kd2.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jl9qW-0000IZ-Th for internals@lists.php.net; Tue, 16 Jun 2020 13:33:40 +0200 Date: Tue, 16 Jun 2020 13:33:34 +0200 To: internals@lists.php.net Message-ID: <20200616133334.77fff07b@platypus> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Authenticated-User: bwz@bohwaz.net X-Authenticator: login X-Invalid-HELO: HELO is no FQDN (contains no dot) (See RFC2821 4.1.1.1) X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) Subject: Re: [PHP-DEV] SQLite3, PDO/SQLite and driver specific methods From: php@bohwaz.net (BohwaZ) On Tue, 16 Jun 2020 11:32:01 +0100 / Peter Bowyer said : > Hi list, > > 4 months ago there was a discussion about the future of SQLite3 and > PDO/SQLite extensions (https://externals.io/message/108256), > highlighting the effort required to maintain two codebases. Yes and I haven't had time to write a RFC or write any code on that yet, but hopefully I will have some time next year... > PDO is well established as providing a standardised access layer > across databases. SQLite requires extensions to be loaded to gain > feature parity with other databases (e.g. to load geospatial > functions) and since it is not a database server these have to be > loaded at runtime. PDO has three sqlite-prefixed functions > (https://www.php.net/manual/en/ref.pdo-sqlite.php) but not one to > load extensions. > > Is it a problem to add one? Yes adding driver-specific methods to PDO has been refused by PHP developers when I did a RFC on adding a couple methods for SQLite, even though there's already a bunch of other methods for other drivers like Postgre. What I was thinking was not exactly what Dan was proposing as I remember the driver-specific code to be very much linked to the PDO class and changing that would be a lot of work, so I was more thinking about adding a "getDriver()" method on PDO that would return a "PDO_SQLite" instance (or other drivers) and this class would have driver-specific methods. I dont exactly remember why the inheritance path suggested by Dan seemed way too complex as I haven't had time to work on this for a long time, but if it is actually possible it also seems like a good way to go :) I personally already use a wrapper-class that implements the same PDO methods but using the SQLite3 class underneath as it's the only one to provide access to advanced features like setting the authorizer callback, backup API and others.