Last modified: 2010-06-21 17:18:13 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.
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
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.