[development] no date / time types in schema API

Larry Garfield larry at garfieldtech.com
Wed Jul 2 15:03:14 UTC 2008


On Wed, 2 Jul 2008 19:19:56 +0800, "augustin (beginner)" <drupal.beginner at wechange.org> wrote:
> On Wednesday 02 July 2008 19:04:46 Ashraf Amayreh wrote:
>> Maybe what you want is strtotime?
> 
> 
> Errr, no, it doesn't work. Read again the date I provided.
> But thanks. I didn't know this function and it might prove useful one day.
> 
> Thanks to Gerhard for his reply. I just upgraded a big module to schema
> API,
> but I will have to revert about half back and use db_query() instead, as
> he
> recommends.
> 
> I have absolutely no clue how the database layer, the next generation
> (http://drupal.org/node/225450 ) will affect this issue.

In the short term, it won't.  That patch does not do anything to Schema API at this point beyond move it into a class structure on the back-end for consistency.  There are a lot of things that could and should happen to Schema API that are not going to until that patch lands because it's big enough already. :-)

Right now the only remaining issues are chasing HEAD (every time the testing framework has an upgrade it breaks half my tests and I have to go in and refactor them) and Postgres recently starting to segfault on install.  I simply don't have the Postgres knowledge to know how to fix that.  If you do, *please* contact me.  There's a dozen or more tasks that are blocked on us getting Postgres to work completely in the new codebase, and even with the code freeze pushed back time is short.  If your skill set includes Postgres and PDO, you have just found your calling. :-)


Early on I toyed with the idea of doing driver-specific field overrides.  The concept was that you could pass, say, a PHP DateTime object in as a "value" and it would get formatted down to the proper format expected for a given database.  That wouldn't help on read, though.  I've tabled that for the time being as it requires a lot more thought and I refuse to put more thought into it until the current patch lands.

Timestamps suck.  "Native" date/time fields suck.  Time/date handling in general just sucks.  It's just a question of which form of suckage you want to have to deal with.

--Larry Garfield



More information about the development mailing list