This Question is Answered

1 "correct" answer available (10 pts) 1 "helpful" answer available (5 pts)
2 Replies Last post: Oct 25, 2007 5:50 PM by Stefan Reuter  
LG KeyContributor 4,984 posts since
Dec 13, 2005
Currently Being Moderated

Aug 25, 2007 2:46 PM

Unified Database Scripts ?

Hi,

 

I did start some time ago writing a script to convert openfire.sql to openfire_db2.sql, openfire_mysql.sql, openfire_oracle.sql etc. Currently it's a shell script which parses one sql file to create db dependent sql files.

The openfire.sql file looks like this


CREATE TABLE jiveUser (
  username           &nbsp ;  _nodeI_     NOT NULL,
  password           &nbsp ;  _chr32_,
  encryptedPassword     _chr255_,
  name            &nb sp;     _chr100_,
  email            &n bsp;    _chr100_,
  creationDate          _jivedate_     NOT NULL,
  modificationDate      _jivedate_     NOT NULL,
  CONSTRAINT jiveUser_pk PRIMARY KEY (username)
);

and my m4 based parser replaces the \_foo\_ fields with the right values for the database (at least for HSQLDB and Oracle). That's a little bit lame and one may want to write something like this in Java so every plugin (thinking of Reuters XEP-0136 plugin which supports only a few databases) and also Openfire could be delivered with only one sql script. I did talk with JS about this but they do a lot of other things so they'll likely not write such a tool within the next months.

 

LG

 

PS: If one is interested in writing this I'd be glad to hear.

Alex Wenckus Jiver 1,029 posts since
Jan 13, 2005
Currently Being Moderated
Aug 27, 2007 5:22 PM in response to: LG
Re: Unified Database Scripts ?

LG,

 

Jive actually has a tool that does this. It is utilized for Clearspace and I know there has been talk of open sourcing it though I am not sure where that stands currently. I will ask around and see whats up.

Stefan Reuter KeyContributor 287 posts since
Aug 3, 2005
Currently Being Moderated
Oct 25, 2007 5:50 PM in response to: Alex Wenckus
Re: Unified Database Scripts ?

 

Any news on this one?

 

 

It would be great for plugin developers that don't operate the full zoo of databases.

 

 

More Like This

  • Retrieving data ...