[pmwiki-users] SelectQuery development: database records as pages?
Patrick R. Michaud
pmichaud at pobox.com
Tue Sep 26 20:56:32 CDT 2006
On Tue, Sep 26, 2006 at 05:15:44PM -0500, Ben Stallings wrote:
> To be honest, I haven't used pagelists yet. I'm going to go read up on
> them now. But my gut reaction to this idea is that database information
> is fundamentally more structured than wiki information, and rightly
> so... my purpose in writing SelectQuery and UpdateForm was to use the
> wiki as a *front end* for the data, not to actually bring the data into
> the wiki. [...]
> I'd like a second opinion from someone who knows more about what
> pagelists can do... would it be useful to do what Pico is suggesting?
> Or would it open a whole new can of worms?
I think the most important point to be made here is that pagelists
are all about doing things with lists of *pages*. At the heart of
the pagelist command is the idea that we're creating a list of
pages of some sort, and then doing some processing on each page
in that list.
Somehow I think this is really different from SelectQuery, which
is really about allowing arbitrary queries into MySQL databases,
and such queries will probably always be more powerful than (:pagelist:).
Still, I can see how using (:pagelist:) to access records in a MySQL
table could be somewhat useful. It wouldn't be that hard to do, either--
here are the key points:
- Each record in the MySQL table is conceptually a "page" in PmWiki
- Each record can be referenced by some unique identifier that
fits the PmWiki pagename format
- There's a way to get a list of all of the identifiers (pagenames)
from the table
- When PmWiki requests reading of a particular page (i.e., record),
the PageStore object returns a "page" where the text of the page
is a series of page text variable definitions.
For example, if we have a table with columns "name", "address", "city",
then the custom PageStore object would query the table for a record
and return markup text that looks like:
name: Alice Adams
address: 123 Any Street
city: Anywhere, USA
Then (:pagelist:) would be able to make lists of records using
pagelist templates and the page text variables.
But as you mentioned, this is really more of "looking at a database
as if it were a series of pages" instead of "providing an easy way to
query a database".
Hope this helps,
More information about the pmwiki-users