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() {
|
|
12 return IMPL::SQL::Schema::Type->new(Name => 'INTEGER');
|
|
13 }
|
|
14
|
|
15 sub Varchar($) {
|
|
16 return IMPL::SQL::Schema::Type->new(Name => 'VARCHAR', MaxLength => shift);
|
|
17 }
|
|
18
|
|
19 sub Float($) {
|
|
20 return IMPL::SQL::Schema::Type->new(Name => 'FLOAT', Scale => shift);
|
|
21 }
|
|
22
|
|
23 sub Real() {
|
|
24 return IMPL::SQL::Schema::Type->new(Name => 'REAL');
|
|
25 }
|
|
26
|
|
27 sub Text() {
|
|
28 return IMPL::SQL::Schema::Type->new(Name => 'TEXT');
|
|
29 }
|
|
30
|
|
31 sub Binary() {
|
|
32 return IMPL::SQL::Schema::Type->new(Name => 'BINARY');
|
|
33 }
|
|
34
|
|
35 sub DateTime() {
|
|
36 return IMPL::SQL::Schema::Type->new(Name => 'DATETIME');
|
|
37 }
|
|
38
|
|
39 1;
|