[Home]DatabaseWikiFeature

MeatballWiki | RecentChanges | Random Page | Indices | Categories

At some point, it would be useful to allow wiki users to interact with an SQL database (applications include SwitchWiki). I see no point in reinventing the SQL standard; there should just be some sort of wiki tag used like:

<DATABASECMD>
SELECT * FROM shop;
</DATABASECMD>

and then when the page is displayed, in the place of this command, the actual SQL results are displayed (via a call to a separate SQL backend), something like:

     +---------+--------+-------+
     | article | dealer | price |
     +---------+--------+-------+
     |    0001 | A      |  3.45 |
     |    0001 | B      |  3.99 |
     |    0002 | A      | 10.99 |
     |    0003 | B      |  1.45 |
     |    0002 | A      | 10.99 |
     |    0003 | B      |  1.45 |
     |    0003 | C      |  1.69 |
     |    0003 | D      |  1.25 |
     |    0004 | D      | 19.95 |
     +---------+--------+-------+

also, there should be a way to use "variables" that turn into forms, something like:

<DATABASECMDFORM>
select * from shop where price=@min_price or price=@max_price;
</DATABASECMDFORM>

This would appear as a form field allowing the user to enter @min_price and @max_price and press "OK", after which they would be shown the results of their search.

The DATABASECMDFORM command could also be used when there is a database command that you want to make a button for, rather than commands that you want to run each time the page is loaded. For example, the following command would appear as an "OK" button and wouldn't execute unless that button was pressed:

<DATABASECMDFORM>
delete * from shop;
</DATABASECMDFORM>

Tieing the database data to wiki-style revision control would be a little bit more complicated, and is suggested as a later addition. For the initial implementation, one could have no revision control and instead just encourage the wiki owner to backup the database once a week.

For eventual revision control, I propose that each table in the database is given its own wiki page, and that the "View other revisions", etc is tied to this. I don't know SQL too well, is there revision control included? If not, I guess the thing to do would be to control the actual database files via CVS. I believe that MySQL? tables are files, and there are import/export commands to read/write copies of tables from externally stored files.

-- BayleShanks

Maybe using PHP wiki and some PHP plugins would be the way to go? I have never tried either, but I heard that PHP makes these things easy. -- AlexSchroeder


CategoryWikiTechnology CategoryUnimplementedWikiTechnology


Discussion

MeatballWiki | RecentChanges | Random Page | Indices | Categories
Edit text of this page | View other revisions
Search: