SQL::Translator::Parser(3pm)

SQL::Translator::Parser3pm

Describes how to write a parser

Overview

Parser modules that get invoked by SQL::Translator need to implement a single function: parse. This function will be called by the SQL::Translator instance as $class::parse($tr, $data_as_string), where $tr is a SQL::Translator instance. Other than that, the classes are free to define any helper functions, or use any design pattern internally that make the most sense.

When the parser has determined what exists, it will communicate the structure to the producer through the SQL::Translator::Schema object. This object can be retrieved from the translator (the first argument pass to parse) by calling the schema method:

  my $schema = $tr->schema;

The Schema object has methods for adding tables, fields, indices, etc. For more information, consult the docs for SQL::Translator::Schema and its related modules. For examples of how this works, examine the source code for existing SQL::Translator::Parser::* modules.

Releases

10 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13

Authors

Ken Youens-Clark, <[email protected]<gt>, darren chamberlain <[email protected]>.

From libsql-translator-perl 1.66-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.