Re: SQLite and PEAR DB
| From: | Tomas V.V.Cox | Date: | Tue, 18 Jun 2002 08:02:30 +0000 |
| Subject: | Re: SQLite and PEAR DB | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7172@lists.php.net to get a copy of this message | ||
Jonas Koch Bentzen wrote:
>
> Stig S. Bakken wrote:
> > On Sun, 2002-06-16 at 17:57, Jonas Koch Bentzen wrote:
> >
> >>Has anyone begun work on a SQLite class for PEAR DB? I'm thinking of
> >>making one, but of course I'd like to know if anyone has done some of it
> >>already.
> >
> >
> > Not that I know of. If you want to start working on it, please apply
> > for a CVS account at http://www.php.net/cvs-php.php and a
> > PEAR account
> > at http://pear.php.net/account-request.php
>
> Hi Stig,
>
> I have a couple of additional questions:
>
> Seeing how MDB will eventually replace DB, should I opt to write the
> class for MDB instead of DB?
Even if some day MDB gets ready for production and people accepts it,
PEAR DB is a reallity and will be still maintained for many time, and
well you know, PEAR DB is the layer that supports nowadays more
databases. Anyway, it shouldn't be difficult to port a driver from one
format to another.
I don't see any SQL Lite PHP extension, how do you plan to develop a
driver without it?
> Do you have any suggestions for how to construct the DSN? SQLite is kind
> of special when it comes to connecting: Instead of specifying the host,
> the username, etc., you specify a file (the whole database is contained
> in one file). If the file does not exist already and you want SQLite to
> create it with certain permissions, you can also specify the permissions
> (e.g. 644). The problem is the fact that the path to the database file
> may contain slashes (in most cases it will), but the different parts of
> the DSN are also separated with slashes. Another problem is the
> permissions part - there no logical place to put it in the DSN. Do you
> have any idea as to where I could put it? Otherwise, I'll just leave
> that portion out (i.e., not allow the user to create a database with
> custom permissions). This is my suggestion for a DSN - please let me
> know if it fits in with
> the way you've designed DB:
>
> sqlite:///home/user/test.db
The correct format is:
sqlite:////home/user/test.db
sqlite:// <- driver spec
/ <- database part separator
/home/user/test.db <- path for the database
If you want to pass special options to it:
sqlite:////home/user/test.db?perms=foo
> Another question: Most likely when I've written the class and tested it
> thoroughly, I won't have the time in the future to maintain the class.
> Would it be okay to make the class, test it thoroughly and then abandon
> the whole thing after a couple of months, or do I *have* to maintain the
> class forever and ever? : )
This is Open Source and you are not enforced to nothing. People will
send patches and if there is no active extension maintainer Stig or me,
will apply that patch. Eventually other maintainers would appear.
Tomas V.V.Cox