From owner-freebsd-ports@FreeBSD.ORG Sat Oct 23 01:02:17 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BF2016A4CE for ; Sat, 23 Oct 2004 01:02:17 +0000 (GMT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84EE943D4C for ; Sat, 23 Oct 2004 01:02:13 +0000 (GMT) (envelope-from apeiron@comcast.net) Received: from localhost.localdomain (pcp08490587pcs.levtwn01.pa.comcast.net[68.83.169.224]) by comcast.net (sccrmhc11) with SMTP id <2004102301021201100779q1e> (Authid: apeiron); Sat, 23 Oct 2004 01:02:12 +0000 From: Christopher Nehren To: Sam Nilsson In-Reply-To: <4179A684.7000508@servingpeace.com> References: <20041022153854.GA88362@happy-idiot-talk.infracaninophile.co.uk> <4179A684.7000508@servingpeace.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-671QFBENhEF1OyBjxQgZ" Date: Fri, 22 Oct 2004 21:02:30 -0400 Message-Id: <1098493350.849.39.camel@prophecy.dyndns.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2FreeBSD GNOME Team Port cc: FreeBSD Ports List Subject: Re: portindex -- the second coming. X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Oct 2004 01:02:17 -0000 --=-671QFBENhEF1OyBjxQgZ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2004-10-22 at 17:32 -0700, Sam Nilsson wrote: [Please don't remove the CC on ports@ unless you believe that the message is for the receiver only and that no one else can benefit from it or any possible responses. I've reproduced your original message here for archival purposes.] > Christopher Nehren wrote: > > You could see which ports you had installed which depended upon a > > group of ports that matched a regex, for example (using subqueries -- > > which is one of the reasons why I'm glad that PostgreSQL was chosen, > > instead of a certain overly popular RDBMS which shall remain nameless > > which lacks this feature). >=20 > I agree that it is fortunate that PostgreSQL was chosen for the advanced=20 > and powerful SQL features that it supports. >=20 > > If you're interested, I'd like to implement the RDBMS side of your > > portindex replacement. >=20 > Thanks for volunteering for that. I really appreciate and all of you=20 > people that do this kind of work for FreeBSD or any open source cause. > Thank you. >=20 > While I agree that in a simple world, PostgreSQL would be a great choice=20 > for RDBMS for this tool, realistically a lot of us are already=20 > supporting Mysql installations for ourselves or clients or both. Many=20 > times it is not a choice to switch to PostgreSQL, and for many clients=20 > it is undesireable. >=20 > It would be great if this could be database agnostic. This should be=20 > possible using perl's DBI, so why not? I would definately try it in that=20 > case! >=20 > I'm sure you already thought of this, but I just wanted to pipe in. As a=20 > potential user, this sounds great! >=20 > Thanks for volunteering and listening. > - Sam Nilsson Yes, DBI makes database-independent _Perl_ code possible. However, that says nothing about the _SQL_ code (and the SQL in the Perl). One particular portability nit is unfortunately one of the main concepts behind the "R" part of RDBMSs: MySQL is woefully incompatible when it comes to uniquely identifying rows in a table numerically. It uses the auto_increment type modifier, whereas PostgreSQL for example uses serial. More grievous incompatibilities also abound. MySQL uses parameterised numeric types in its schema declarations, which also cause problems. There's probably many more issues than the ones that I've covered here, but I'll assume that you get the idea that it's not as easy as it sounds. Of course, there are solutions -- in the form of DBI abstractions -- to this problem. One of the most popular is Class::DBI. Another, which I personally favour because it doesn't force an OO mindset on the user (which can be handy for a utility where you'll only have one instance of the thing represented by the DB anyway, like a utility that manages DB-backed virtual users for an FTP server) is Alzabo. Unfortunately, both of these abstraction layers require lots of other modules to do their magic. It's not polite, IMO, to require a user to install Class::DBI or Alzabo and all dependencies just to have a SQL interface to their ports tree.=20 Another possible solution is to implement one's own abstraction layer. This isn't *too* difficult, it's good programming practise anyway, and I've already thought of how to do it for another project that I'm currently still designing. However, I don't have a MySQL RDBMS available to me, and I'm far too lazy to set one up just for testing purposes. Presuming Matthew likes the idea of the RDBMS part of portindex and of my implementing it, I'll do my best to create portable SQL and I'll also do my best to translate anything else to MySQL. However, I'll need someone else to test it. Since you've spoken up about it, I'll take you as my first volunteer. :) And yes, you're right, I did think of this already. And don't thank me for the idea; thank Radim for originally writing portindex and implementing the RDBMS idea in the first place (I'll toot my own horn here and say that I had the idea too, but never implemented it). --=20 I abhor a system designed for the "user", if that word is a coded pejorative meaning "stupid and unsophisticated". -- Ken Thompson - Unix is user friendly. However, it isn't idiot friendly. --=-671QFBENhEF1OyBjxQgZ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBea2mk/lo7zvzJioRAmFmAJ9cfMY5ApXEzxRrqx/Q3L0yywFHhgCfV+bc HxJpL6Yim9nSqR1orpUqXWY= =iNWt -----END PGP SIGNATURE----- --=-671QFBENhEF1OyBjxQgZ--