49
|
1 package IMPL::SQL::Types;
|
|
2 use strict;
|
|
3 use warnings;
|
|
4
|
|
5 require Exporter;
|
|
6 our @ISA = qw(Exporter);
|
|
7 our @EXPORT_OK = qw(&Integer &Varchar &Float &Real &Text &Binary &DateTime);
|
|
8
|
|
9 require IMPL::SQL::Schema::Type;
|
|
10
|
|
11 sub Integer() {
|
165
|
12 return IMPL::SQL::Schema::Type->new(name => 'INTEGER');
|
49
|
13 }
|
|
14
|
|
15 sub Varchar($) {
|
165
|
16 return IMPL::SQL::Schema::Type->new(name => 'VARCHAR', maxLength => shift);
|
49
|
17 }
|
|
18
|
|
19 sub Float($) {
|
165
|
20 return IMPL::SQL::Schema::Type->new(name => 'FLOAT', scale => shift);
|
49
|
21 }
|
|
22
|
|
23 sub Real() {
|
165
|
24 return IMPL::SQL::Schema::Type->new(name => 'REAL');
|
49
|
25 }
|
|
26
|
|
27 sub Text() {
|
165
|
28 return IMPL::SQL::Schema::Type->new(name => 'TEXT');
|
49
|
29 }
|
|
30
|
|
31 sub Binary() {
|
165
|
32 return IMPL::SQL::Schema::Type->new(name => 'BINARY');
|
49
|
33 }
|
|
34
|
|
35 sub DateTime() {
|
165
|
36 return IMPL::SQL::Schema::Type->new(name => 'DATETIME');
|
49
|
37 }
|
|
38
|
|
39 1;
|