Extension talk:SQL2Wiki

Older comments at Extension talk:SQL2Wiki/old

Dynamic Query and Pagination mods didn't make it in...

I see my dynamic query mod ("where=") didn't make it in. Nor did my pagination mod ("count="). Sigh.

The latter is absolutely essential if you expect a large number of hits on a query.

These mods are at: Extension_talk:SQL2Wiki/old#Use_with_Extension:InputBox.3F

--Bytesmiths 18:12, 6 June 2011 (UTC)

ufff ... branched from that extension so long ago that i failed to notice the Talk page ... will have a look at it. Freakolowsky 07:49, 14 June 2011 (UTC)

Problem: parameter in template

Sugestion:

In "SQL2Wiki.body.php", replace:

$sql = ( $s2w->shouldPreexpand() ) ? $parser->recursiveTagParse( $input ) : $input;

by:

$sql = ( $s2w->shouldPreexpand() ) ? $parser->recursiveTagParse( $input, $frame ) : $input;

See: http://www.mediawiki.org/wiki/Manual:Tag_extensions#Extensions_and_Templates

Thanks. -- Alexandre Porto msg 16:16, 22 July 2011 (UTC)

Missing or invalid type

I am using MW 1.16.2, my database is mysql,

on the page: Special:SQL2Wiki I have the error massage: Missing or invalid type,
and a query results in a blank page
in LocalSettings I wrote: $wgExSql2WikiDatabases["db1"] = array( "type"=> "mysql", "host" => "localhost", "dbname" => "myname", "user" => "myuser", "password" => "mypass");
( I am still using the old version of sql2wiki as xsql2wiki, and it works fine)
thank you Agapetulus 09:37, 9 December 2011 (UTC)
Hi, I don't think I can help you, as I don't have $wgExSql2WikiDatabases anywhere in my system.
I think you must be working on a branch of the SQL2Wiki.php that I worked on. Bytesmiths 01:33, 16 December 2011 (UTC)
Hello, thank you for the answer,
I'm confused, on the Extension page I can read :
3. Specify databases you want to access into
$wgExSql2WikiDatabases["db1"] = array( "type"=> "oracle", "host" => "tnsname", "dbname" => "scott", "user" => "scott", "password" => "tiger");
in my LocalSettings I wrote:
$wgExSql2WikiDatabases["db1"] = array( "type"=> "mysql", "host" => "localhost", "dbname" => "myname", "user" => "myuser", "password" => "mypass");
why shouldn't there be a $wgExSql2WikiDatabases ?, or did I get something wrong?
unfortunatly I cannot work on your branch of the SQL2Wiki, (things might change after a update of my mediawiki in January)...
in any case I wish you a merry christmas, and a happy new year Agapetulus 14:46, 16 December 2011 (UTC)
My version has the database information embedded in the extension -- which I admit is not wonderful.
Good luck with your problem, and if you become interested in my version (which has some interesting mods that never got into the version posted here, like ability to query and paginate), let me know. Bytesmiths 22:06, 16 December 2011 (UTC)

SQL2Wiki download

Where has this Extension gone? The snapshot download doesn't find it anymore. Does anyone know where to download this extension or other versions of it? Thank you R.Colbach 194.154.205.47 06:12, 8 July 2014 (UTC)

I found a copy of this extension from Wikia's github. Based on the date and other versioning info in the files, I think that it is the newer version. I don't know if Wikia has made any other changes to this extension:
https://github.com/svn2github/wikia/tree/master/extensions/SQL2Wiki Nick2253 (talk) 17:30, 29 August 2014 (UTC)

Escaping leading-space formatting on result strings

I am using Wiki ad automated program documentation page. I have an external preprocessor , which extracts commented string from Oracle plsql source codes.

BEGIN
-- fictional code
IF --Comm4Wiki
   L_PARAM1 >100 THEN 
   RETURN 'SIZE LIMIT EXCEEDED';--/Comm4Wiki
END IF;

IF --Comm4Wiki
L_PARAM1 >TRUNC(L_PARAM1) THEN RETURN 'FRACTIONS not ACCEPTED';--/Comm4Wiki
END IF;
.
.
.
. 
END;

My preprocessor extracts everything between Comm4Wiki tags, inserting 2 lines in a table:

string 1, two lines starting with 4 spaces>

   L_PARAM1 >100 THEN 
   RETURN 'SIZE LIMIT EXCEEDED';

string 2>L_PARAM1 >TRUNC(L_PARAM1) THEN RETURN 'FRACTIONS not ACCEPTED';


My Wiki page extracts the lines with sql2wiki.

I do not want to remove leading spaces. How can I manage not to have string1 highlighted because of leading spaces? 86.101.250.146 18:34, 21 October 2014 (UTC)

I have recently realized that query resulting more than one row behaves strange.
I use inline, preexpand, expand, noheader = true options, in addition I encapsulate every line in <nowiki> tags

If I have to sql lines each of them starting with spaces then -the first line performs nowiki formatting, I mean it pops up normal, unformatted inline text; -the further rows are presented in box , because of the leading spaces. 145.236.252.35 09:53, 22 October 2014 (UTC)

How to include dynamic content in search results

I am also using Wiki as aautomated program and db-dable documentation tool, a preprocessor extracts valueable comments for code and stores in a cache table. Sql2wiki extention reads these cached comments when rendering the page.

Unfortunately the search motor doesnt see the content from then cache table.

A daily cycle/or on-demand of refreshment would be the goal. 145.236.252.35 11:31, 2 June 2015 (UTC)

How to make this running again

Hi,I recently had to update to mediawiki-1.25 and (obviously) the SQL2Wiki extension refuses to work anymore. I can't get away this error:

fatal] [5d2c6e93] /wiki/index.php/Domains   ErrorException from line 264 of /srv/www/htdocs/mediawiki-1.25.1/includes/exception/MWExceptionHandler.php: Fatal Error: Class 'Database' not found

I assume this has to do with the deprecated Database::newFromType() function but I'm unable to fix this for myself. Any help appreciated, since AFAIK this is the only way to dynamically put sql data directly into wiki pages. FrankAltpeter (talk) 15:14, 5 August 2015 (UTC)

Ok, found the problem for myself... the undocumented setting "type" within the wgExSql2WikiDatabases() array was the problem. It is nowhere defined how this is to be set, just a reference to "oracle" is found on this page.
So, setting it to "sql" or "mysql" didn't work until I had a lucky guess and tried "mysqli" and now it works. FrankAltpeter (talk) 12:45, 6 August 2015 (UTC)