Bigtop
view release on metacpan or search on metacpan
lib/Bigtop/Backend/SQL.pm view on Meta::CPAN
package # table_block
table_block;
use strict; use warnings;
sub get_create_keyword {
my $self = shift;
return 'TABLE';
}
sub _skip_this_block {
my $self = shift;
my $skip = $self->walk_postorder( 'skip_this' );
return pop @{ $skip };
}
package # seq_block
seq_block;
use strict; use warnings;
sub get_create_keyword {
my $self = shift;
return 'SEQUENCE';
}
sub _skip_this_block {
my $self = shift;
my $skip = $self->walk_postorder( 'skip_this' );
return pop @{ $skip };
}
package # schema_block
schema_block;
use strict; use warnings;
sub get_create_keyword {
my $self = shift;
return 'SCHEMA';
}
sub _skip_this_block {
my $self = shift;
return;
}
package # table_element_block
table_element_block;
use strict; use warnings;
sub skip_this {
my $self = shift;
if ( $self->{__BODY__} eq 'not_for' ) {
foreach my $skipped_backend ( @{ $self->{__ARGS__} } ) {
if ( $skipped_backend eq 'SQL' ) {
return [ 1 ];
}
}
}
}
1;
=head1 NAME
Bigtop::Backend::SQL - defines legal keywords in table and field blocks
=head1 SYNOPSIS
If you are making an SQL generating backend:
use Bigtop::Backend::SQL;
This specifies the valid keywords for the SQL generating backend.
If you need additional keywords which are generally useful, add them
here (and send in a patch). If you need backend specific keywords, register
them within your backend module. Note that only keywords affecting
the SQL should be put here. But, fields have other keywords which
affect things like how they look in html forms and whether they are fetched
by default. Register those keywords in Bigtop::Control:: or
Bigtop::Model:: modules.
=head1 DESCRIPTION
If you are using a Bigtop backend which generates SQL, you should
read this document to find out what the valid keywords inside table
and field blocks are.
If you are writing a Bigtop backend to generate SQL, you should use
this module. That will register the standard table and field keywords
with the Bigtop parser.
=head1 BASIC STRUCTURE
A bigtop app block could look like this:
app name {
table name {
field name {
}
}
}
=head1 KEYWORDS
Inside the table, you can include the following keywords:
=over 4
=item sequence
This must be the name of a valid sequence defined with an app level
( run in 0.714 second using v1.01-cache-2.11-cpan-39bf76dae61 )