Tyler Riddle > MediaWiki-DumpFile-0.2.1 > MediaWiki::DumpFile::SQL

Download:
MediaWiki-DumpFile-0.2.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Module Version: 0.1.8   Source   Latest Release: MediaWiki-DumpFile-0.2.2

NAME ^

MediaWiki::DumpFile::SQL - Process SQL dump files from a MediaWiki instance

SYNOPSIS ^

  use MediaWiki::DumpFile::SQL;
  
  $sql = MediaWiki::DumpFile::SQL->new($file);
  $sql = MediaWiki::DumpFile::SQL->new(\*FH);
  
  @schema = $sql->schema;
  $name = $sql->table_name;
  
  while(defined($row = $sql->next) {
        #do something with the data from the row
  }

FUNCTIONS ^

new

This is the constructor for this package. It is called with a single parameter: the location of a MediaWiki SQL dump file or a reference to an already open file handle.

next

Returns a hash reference where the key is the column name from the table and the value of the hash is the value for that column and row. Returns undef when there is no more data available.

table_name

Returns a string of the table name that was discovered in the dump file.

table_statement

Returns a string of the unparsed CREATE TABLE statement straight from the dump file.

schema

Returns a list that represents the table schema as it was parsed by this module. Each item in the list is a reference to an array with two elements. The first element is the name of the row and the second element is the MySQL datatype associated with the row. The list is in an identical order as the definitions in the CREATE TABLE statement.

AUTHOR ^

Tyler Riddle, <triddle at gmail.com>

BUGS ^

Please see MediaWiki::DumpFile for information on how to report bugs in this software.

COPYRIGHT & LICENSE ^

Copyright 2009 "Tyler Riddle".

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: