14 Sep 2020 13:21:58 UTC
- Distribution: SQL-Translator
- Module version: 1.62
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (97)
- Testers (2083 / 0 / 0)
- KwaliteeBus factor: 5
- 23.69% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity24 month
- Download (402.1KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:14 non-PAUSE usersILMARI Dagfinn Ilmari Mannsåkerand 1 contributors
SQL::Translator::Parser - describes how to write a parser
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.
Ken Youens-Clark, <firstname.lastname@example.org<gt>, darren chamberlain <email@example.com>.
perl(1), SQL::Translator, SQL::Translator::Schema.
Module Install Instructions
To install SQL::Translator, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install SQL::Translator
For more information on module installation, please visit the detailed CPAN module installation guide.