[development] Intro + sql abstraction

Philippe Jadin philippe.jadin at gmail.com
Mon Feb 5 16:26:34 UTC 2007


Hello,

I hope this is the right mailing list to introduce myself as a
"willing to be" contributor.

I'm new to Drupal, but not to the world of content management. I wrote
quite a few systems, the latest is available on
http://www.thinkedit.org (this is the result of 2 years of work). It
has some features in common with Drupal (node system, custom content
types, trees, etc...) but we lack a community (the goal was to create
one when I decided to opensource it a year ago) and community building
features.

Two weeks ago, I started to wonder if I wasn't reinventing the wheel
(it's never too late isn't it ?), and when I looked again at Drupal,
it was clear that something special is happening here :-)

So, I hope I'll be able to contribute to Drupal and maybe contribute a
few module/ideas. I will try to avoid  "why don't you do it like
this?" posts.

Looking at recent discussions, like how to abstract the sql used to
create tables in the install/update system, here's how we do it (not
that it's the best way, but it works with a minimal amount of code)

This is for example the default sql table definition file :
http://svn.berlios.de/wsvn/thinkedit/trunk/config/tables-dist.php?op=file&rev=0&sc=0

>From this, we can install and upgrade the database at any time : the
installer checks if a table is missing, and adds the required fields.
(it is not possible to delete fields by design, to avoid trouble). If
this file is updated, when you run the installer again, the
corresponding fields are added. This way, you can use versioning on
this file and thus on your sql schema (sql schema migration is a
pita). The "create table" and "alter table" are created on the fly, by
comparing the existing database and the requested schema.

We can also build forms on the fly with validation, scaffolding (there
is an "active record" object)

Nothing new under the sun, but using data oriented programming seemed
powerful. Using php arrays to store this is very straightforward and
can be directly used by the language.

I hope to bring some of those ideas to Drupal (if they are not yet
there, which seems unlikely)

My 0.02, as an intro :-)


Philippe Jadin


More information about the development mailing list