Prefix for all tables

Have a good idea ? Want to suggest something ? Have a couple of lines of code to back it up ?
Post it here !

Prefix for all tables

Postby Animal on 17-11-2007 18:49

Hello everybody
(Sorry for my bad English, I'm a French guy...)

First, many thanks for this AmpJuke : it is wonderful ! :mrgreen:

Just one little suggestion:
  • Is it possible to prefix all tables ? (ex: table 'user' become 'ampjUsers'. Especially this one, because a lot of script can have a table 'user'...)
    Because when you want to use the AmpJuke on a website which can only have 1 database, you might be want share it with other scripts.
    It was more clear with prefixed tables, and it prevent to delete them... Isn't it ? ;)
  • The "nice to have" is to allow the user to choose his customized prefix... ;)
User avatar
Animal
Newbie
Newbie
 
Posts: 3
Joined: 17-11-2007 18:33
Location: France

Postby Michael on 17-11-2007 19:53

Hello Animal,

Welcome to the forum and thanks for posting.
...and thanks for the nice words about AmpJuke :D

I'm aware that some ISP's (incl. the ISP currently being used to host www.ampjuke.org) are only allowing 1 (one!) database for each useraccount.

Table prefixes has been on the to-do list for some time now...
On first investigation, it seems like a moderate task to include a prefix for the tables used in AmpJuke.

The plan: include a configuration setting (f.ex. $ampjuke_tbl_prefix), and then "strip" the SQL-statement in "sql.php", by inserting the $ampjuke_tbl_prefix before the table name(s) are used, - actually before any execution of SQL-statements.
This will be much easier compared to the tedious job of going through all php-files looking up (and modifying) each and every SQL-statement used in AmpJuke...

Provided the above "plan" is watertight/bulletproof/whatever, I will try and get table prefixes included in the next release - 0.6.7 - which is planned late November/early December (well...before start of 2008).


//Michael.

P.S. Hey ! Your English isn't bad ! :wink:
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Postby Animal on 17-11-2007 20:47

Many thanks for your so quick reply ! :shock: :D

And thanks too, for consider my suggestion so quickly, in the next release of AmpJuke...

This is an other reason for me to choose AmpJuke : your reactivity ! :wink:
User avatar
Animal
Newbie
Newbie
 
Posts: 3
Joined: 17-11-2007 18:33
Location: France

Postby Michael on 18-11-2007 12:09

You're welcome - the goal is to respond within 3 days (unless I'm on vacation).

After the post from yesterday, I had a chance to look a little more into the previously posted "plan" in this thread.

It will actually work for approximately 80% of the SQL-statements, - which is better than nothing.
I will find a way to deal with the remaining 20%.

And, by the way: relevant suggestions for improving AmpJuke are always welcome. :wink:

//Michael.
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Almost there...

Postby Michael on 02-12-2007 18:07

Just to update this: I'm in the final stages of testing the table prefixes right now.

It looks OK so far, and, if no unsuspected errors shows up, I will include the table prefix feature in the next release.

//Michael.
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Postby Animal on 03-12-2007 00:49

Great, Michael ! :D
Good luck... :wink:
User avatar
Animal
Newbie
Newbie
 
Posts: 3
Joined: 17-11-2007 18:33
Location: France

Postby Michael on 23-05-2008 11:21

Completely forgot about this, but prefixes has been available since 0.7.1 :D
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark


Return to Requests / suggestions

Who is online

Users browsing this forum: No registered users and 0 guests

cron