1SQL::Translator::ParserU(s3e)r Contributed Perl DocumentaStQiLo:n:Translator::Parser(3)
2
3
4
6 SQL::Translator::Parser - describes how to write a parser
7
9 Parser modules that get invoked by SQL::Translator need to implement a
10 single function: parse. This function will be called by the
11 SQL::Translator instance as $class::parse($tr, $data_as_string), where
12 $tr is a SQL::Translator instance. Other than that, the classes are
13 free to define any helper functions, or use any design pattern
14 internally that make the most sense.
15
16 When the parser has determined what exists, it will communicate the
17 structure to the producer through the SQL::Translator::Schema object.
18 This object can be retrieved from the translator (the first argument
19 pass to parse) by calling the schema method:
20
21 my $schema = $tr->schema;
22
23 The Schema object has methods for adding tables, fields, indices, etc.
24 For more information, consult the docs for SQL::Translator::Schema and
25 its related modules. For examples of how this works, examine the
26 source code for existing SQL::Translator::Parser::* modules.
27
29 Ken Youens-Clark, <kclark@cpan.org<gt>, darren chamberlain
30 <darren@cpan.org>.
31
33 perl(1), SQL::Translator, SQL::Translator::Schema.
34
35
36
37perl v5.32.1 2021-01-27 SQL::Translator::Parser(3)