Last modified: 2010-06-21 17:18:13 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 17336 - REQ: Output database queries as XML for AJAX apps
REQ: Output database queries as XML for AJAX apps
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.13.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-03 13:22 UTC by Ralph Taylor
Modified: 2010-06-21 17:18 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch to add XML output to Database.php (2.81 KB, patch)
2009-02-03 13:22 UTC, Ralph Taylor
Details

Description Ralph Taylor 2009-02-03 13:22:11 UTC
Created attachment 5775 [details]
patch to add XML output to Database.php

When developing extensions or other features that use AJAX and custom database queries there is no current function to return a database query as an XML document to the AJAX script.

Attached is a diff file which introduces a function to create an XML document based on a Database transaction.  Insert, Update and Delete queries should return a boolean value, when parsed through the returnXML() function will generate an XML document as so:

{for queries that have returned as TRUE}
<root>
  <result>OK</result>
</root>

{for queries that have returned as FALSE}
<root>
  <result>FAIL</result>
</root>

Select queries which should return a ResultWrapper object, when parsed throught the returnXML() function will generate an XML document as so:

<root>
  <result>
    <fieldname_1>row1_result1</fieldname_1>
    <fieldname_2>row2_result1</fieldname_2>
  </result>
  <result>
    <fieldname_1>row1_result2</fieldname_1>
    <fieldname_2>row2_result2</fieldname_2>
  </result>
</root>

Where the row_titles are the field names from the database transaction.
Comment 1 Ralph Taylor 2009-02-06 11:38:45 UTC
My further thoughts on this feature request is that this patch should be moved to the SAJAX class and provide support for error message handling

Marking bug as LATER until I work on the patch
Comment 2 Max Semenik 2010-06-21 17:18:13 UTC
See http://www.mediawiki.org/wiki/API
Generic access to SQL queries is available in AskSQL extension and is unlikely to be extended or even cared for due to obvious security concerns.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links