You are here: Re: Database abstraction layers « PHP Programming Language « IT news, forums, messages
Re: Database abstraction layers

Posted by Kenneth Downs on 10/06/64 11:47

Colin McKinnon wrote:

Are you married to mySQL?

I've created a dictionary-based comprehensive tool that uses Postgres as the
back end and runs on linux, and is GPL.

http://docs.secdat.com

I never code inserts or updates ever. My app code is full of stuff like:

$row=array("colname"=>value,"col2"=>value)
SQLX_Insert($table_dd,$row);

You can also do:

SQLX_InsertOrUpdate($table,$row)

which looks for the existing row and does an appropriate insert or update as
the case may be.

You can make a big batch of rows like:

$rows=array(
"table1"=>array(
array( .... row .....)
,array( .... row .....)
,array( .... row .....)
)
,"table2"=>array(
array( .... row .....)
,array( .... row .....)
,array( .... row .....)
)
);
SQLX_TransactionBegin();
SQLX_InsertsOrUpdates($rows);
SQLX_TransactionEnd("NAME");

If there is an error in the transaction, it gets logged and tagged with
"NAME" so that it can be examined later.

You can also grab anything you need to know from the online dictionary. The
complete description of every column in every table is available in the
"flat" array for each table:

$dd=dd_tableref("orders");
echo "The description of order # is: ".$dd['flat']['order']['description']

This includes detailed information about foreign keys.

There is a huge amount of database-side automation as well.

Our first system went live a few weeks ago and two more are coming soon. I
consider it late beta for my own use because i know all of the foibles it
has, but it is probably early alpha for somebody picking it up right now.





> Hi all,
>
> There's lots of DB abstraction layers out there, but a quick look around
> them hasn't turned up anything which seems to met my requirements. Before
> I go off and write one I thought I'd ask here if anyone knows of such a
> beast...


>
> I want some code where I present an array of data, and the corresponding
> primary key and let the code work out whether to INSERT or UPDATE it, I
> also want to be able to present the data from a QBF or QBE then be able to
> step through the result set. However I don't want to have to configure the
> DBMS structure - after all most of it is already in the DBMS (OK so not
> the relationships in a MySQL db). It'd be really cool if I could throw SQL
> directly at it *too*.
>
> Anybody any suggestions?
>
> TIA,
>
> C.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация