X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FConstants.pm;h=3683f27ca4f3446c996461d32078485de052fe67;hb=7f897a63d37d3096c6535a2417aefe599057400f;hp=e5538167482c0bf93b67978ed377cee1d54111f1;hpb=27901cd5f5959c1bb57eaeb5a7aeb6ef1e60424d;p=dbsrgits%2FSQL-Translator-2.0-ish.git diff --git a/lib/SQL/Translator/Constants.pm b/lib/SQL/Translator/Constants.pm index e553816..3683f27 100644 --- a/lib/SQL/Translator/Constants.pm +++ b/lib/SQL/Translator/Constants.pm @@ -1,20 +1,30 @@ package SQL::Translator::Constants; use DBI qw(:sql_types); -use Exporter (); +use Sub::Exporter -setup => { + exports => [ @{$DBI::EXPORT_TAGS{sql_types}}, CHECK_C, FOREIGN_KEY, FULL_TEXT, SPATIAL, NOT_NULL, NORMAL, NULL, PRIMARY_KEY, UNIQUE, DEFAULT_PARSER_VERSION ], + groups => { + sqlt_types => [ @{$DBI::EXPORT_TAGS{sql_types}} ], + sqlt_fk_actions => [ qw(SQLT_FK_CASCADE SQLT_FK_RESTRICT SQLT_FK_SET_NULL SQLT_FK_NO_ACTION SQLT_FK_SET_DEFAULT) ], + sqlt_constants => [ qw(CHECK_C FOREIGN_KEY FULL_TEXT SPATIAL NOT_NULL NORMAL NULL PRIMARY_KEY UNIQUE DEFAULT_PARSER_VERSION) ], + } +}; -BEGIN { - @ISA = qw(Exporter); +use constant SQLT_FK_CASCADE => 0; +use constant SQLT_FK_RESTRICT => 1; +use constant SQLT_FK_SET_NULL => 2; +use constant SQLT_FK_NO_ACTION => 3; +use constant SQLT_FK_SET_DEFAULT => 4; - @EXPORT = (); - @EXPORT_OK = (); - %EXPORT_TAGS = ( - sqlt_types => [ - qw(), - @{$DBI::EXPORT_TAGS{sql_types}} - ] - ); +use constant CHECK_C => 'CHECK'; +use constant FOREIGN_KEY => 'FOREIGN KEY'; +use constant FULL_TEXT => 'FULLTEXT'; +use constant SPATIAL => 'SPATIAL'; +use constant NOT_NULL => 'NOT NULL'; +use constant NORMAL => 'NORMAL'; +use constant NULL => 'NULL'; +use constant PRIMARY_KEY => 'PRIMARY KEY'; +use constant UNIQUE => 'UNIQUE'; - Exporter::export_ok_tags(keys %EXPORT_TAGS); -} +use constant DEFAULT_PARSER_VERSION => 30000; 1;