GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Bigtop::Backend::Model(3) User Contributed Perl Documentation Bigtop::Backend::Model(3)

Bigtop::Backend::Model - defines legal keywords in table and field blocks

If you are making a Model generating backend:

    use Bigtop::Backend::Model;

This specifies the valid keywords for the Model 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 model should be put here. But, fields have other keywords which affect things like what SQL represents them and how they look in html forms. Register those keywords in Bigtop::SQL:: or Bigtop::Control:: modules.

If you are using a Bigtop backend which generates models, 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 models, you should use this module. That will register the standard table and field keywords with the Bigtop parser.

A bigtop app block could look like this:

    app name {
        table name {
            field name {
            }
        }
    }

Tables can be field blocks. They can also have these simple statements:
foreign_display
Inside the table, you can include a foreign_display statement. The value must be a quoted string like this:

    foreign_display `%last_name, %first_name`;
    

Any percent and the Perl identifier after it will be replaced with the current row's values for those columns. This is useful when a model needs to deliver a user meaningful value for the current row.

model_base_class
This becomes the base class of the model module for this table. Each backend has a default base model, but setting this overrides it.

non_essential
Inside the field you may include non_essential. If it has a true value, the column will not be considered essential. This usually means that it will not be fetched when a row is retrieved from the database, unless its accessor is directly called. By default, all fields are considered essential.

The main Bigtop::Parser registers not_for simple statements for tables and fields. You can use them like this:

    table something_that_needs_no_model {
        not_for      Model;
        ...
    }

This will generate the SQL for the table (if you are using an SQL backend), but not the Model. The same goes for this:

    table normal_but_with_strange_field {
        field confusing_to_CDBI {
            is      int4;
            not_for Model;
        }
    }

Phil Crow <crow.phil@gmail.com>

Copyright (C) 2005 by Phil Crow

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.