From: Dennis F. <de...@co...> - 2002-10-23 07:12:48
|
Hey guys, Well just take the CoreAPM abstration layer. I'm using it now for the last 5-10 months and it's stable. It supports MySQL and Postgresql in a totally compatible way. It also has support for all those cool things like booleans (beleave it or not but mysql can handle the true(th) ;) ) I'll up the new version to coreapm cvs and then I'll copy it to the core-lan-org cvs. Implementation should be trivial then. Greetins, Dennis ----- Original Message ----- From: "Andrew Simpson" <and...@pa...> To: "Dennis Fleurbaaij" <de...@co...> Cc: <fra...@so...>; <cor...@li...> Sent: Wednesday, October 23, 2002 8:10 AM Subject: Re: [Core-lan-org-devel] Re: Core/Org -> mySql ... Help > On Tue, 22 Oct 2002 11:03:34 +0200 > "Dennis Fleurbaaij" <de...@co...> wrote: > > > Hi François, > > > > Well I would suggest you do it another way :/ > > Agreed. (I've been thinking the about the steps toward converting to > MySQL for a while too). > > > > > First of all call the query-function db_query(); that way you can > > include different files for different database types and still have > > all you calls the same. (eg. i can now also create an oracle include > > file that has the db_query(); ) > > > > I'd planned to go a bit further. Make a database abstraction layer for > ALL the different database functions. This would also make it easier to > change to other databases (like Oracle) later. I made a list of the > functions required in PostgreSQL, and their equivalents in MySQL: > > pg_exec mysql_query (this is already function db_query) > pg_fetch_array mysql_fetch_array > pg_result mysql_result > pg_numrows mysql_numrows > > These are all easy to implement, because they are 'more or less' > functionally equivalent. > > The last one: > > pg_getlastoid mysql_insert_id > > - needs a bit of re-coding to get it to work. > > > > And second the database is selected at connection time. most likely > > you meant to use the defined variable DATABASE_NAME and not it's > > variable variant $DATABASE_NAME. (so use the one without the $). But > > as said before I would not advise to include it in every function all. > > > > Agreed. > > > As you can see in the query there are a LOT of non SQL'92 comaptible > > functions like: > > current_timestamp() > > extract() > > > > Umm... I think I looked at these. Current_timestamp is O.K. Extract is > in MySQL but different. Null is O.K too. > > > You will need to work around them in code. > > > > In anycase it'll be probably be more difficult then just replacing the > > function calls. > > > > Yes, problems! > > - 'Extract' is similar but different syntax in places - I think > > - Date and time handling is different - particularly with extract. Most > of the date functions in /includes/common.php should still be workable > with care. This is where I gave up previously - I think it could be > solved though... > > - 'Epoch' is not in MySQL - the equivalent is Unix_timestamp. Some > workarounds are required. Only affects /includes/security.php and some > in /tasks/* . > > Small problems: > > There is also a lone pg_exec in index.php that should be converted to > db_query. And tasks/task_project_list and tasks/task_summary_list have > subqueries that won't (?) work in MySQL. > > Andrew Simpson > > > Thanks, good luck and don't give up, > > Dennis Fleurbaaij > > de...@co... > > > > > > ----- Original Message ----- > > From: "François TRICARD" <fra...@so...> > > To: "Dennis Fleurbaaij" <de...@co...> > > Sent: Tuesday, October 22, 2002 9:20 AM > > Subject: RE: Core/Org -> mySql ... Help > > > > > > Hello Dennis ! > > > > My first big problem is the following request, do you know how to port > > it in mysql ? > > > > q = mysql_db_query( $DATABASE_NAME, "SELECT user_id, ip, email, admin, > > fullname, current_timestamp(0) AS now, lastaccess, extract( epoch FROM > > (current_timestamp(0) - lastaccess) ) AS sec_lastaccess FROM users > > LEFT JOIN logins ON (logins.user_id=users.id) WHERE > > session_key='".$x."'",$database_connection ) ) ) > > > > (From security.php) > > > > Thanks > > > > François > > > > -----Message d'origine----- > > De : Dennis Fleurbaaij [mailto:de...@co...] > > Envoyé : lundi 21 octobre 2002 11:16 > > À : François TRICARD > > Objet : Re: Core/Org > > > > > > Hello François, > > > > There is _NO_ mysql port. Mysql lacks features that Core/Org depends > > on. > > > > - Subqueries ( could be fixed by rewriting all subqueries to joins or > > wait > > for a mysql that supports it. ) > > - References ( not a neccesity but you do want security on the > > database layer ) > > > > So unfortunately there is no support yet. If you are interested in > > building > > that I would help as I've allready did > > it once but lost the code. The developement path would be: > > > > - get rid of all the pg_calls and replace them by calls to our own > > database > > object. > > - build a postgresql and a mysql database object > > - config it in > > > > in al 4 hours work or less. > > > > Greetings, > > Dennis Fleurbaaij > > de...@co... > > > > > > ----- Original Message ----- > > From: "François TRICARD" <fra...@so...> > > To: <de...@co...> > > Sent: Monday, October 21, 2002 10:38 AM > > Subject: Core/Org > > > > > > Hello, > > > > Your web's soft is very good for groupware, but I'm just a php/mysql > > user... Do you know is someone is working on Core for Mysql ? > > > > Thanks, > > > > François TRICARD > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > This sf.net emial is sponsored by: Influence the future of > > Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) > > program now. http://ad.doubleclick.net/clk;4699841;7576301;v? > > http://www.sun.com/javavote > > _______________________________________________ > > Core-lan-org-devel mailing list > > Cor...@li... > > https://lists.sourceforge.net/lists/listinfo/core-lan-org-devel > > > |