annotate lib/IMPL/SQL/Types.pm @ 413:af8d359ee4cc ref20150831

working on di container
author cin
date Thu, 24 Sep 2015 12:19:30 +0300
parents c6e90e02dd17
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
407
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
1 package IMPL::SQL::Types;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
2 use strict;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
3 use warnings;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
4
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
5 require Exporter;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
6 our @ISA = qw(Exporter);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
7 our @EXPORT_OK = qw(&Integer &Varchar &Float &Real &Text &Binary &DateTime);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
8
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
9 require IMPL::SQL::Schema::Type;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
10
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
11 sub Integer() {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
12 return IMPL::SQL::Schema::Type->new(name => 'INTEGER');
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
13 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
14
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
15 sub Varchar($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
16 return IMPL::SQL::Schema::Type->new(name => 'VARCHAR', maxLength => shift);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
17 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
18
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
19 sub Float($) {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
20 return IMPL::SQL::Schema::Type->new(name => 'FLOAT', scale => shift);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
21 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
22
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
23 sub Real() {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
24 return IMPL::SQL::Schema::Type->new(name => 'REAL');
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
25 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
26
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
27 sub Text() {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
28 return IMPL::SQL::Schema::Type->new(name => 'TEXT');
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
29 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
30
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
31 sub Binary() {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
32 return IMPL::SQL::Schema::Type->new(name => 'BINARY');
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
33 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
34
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
35 sub DateTime() {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
36 return IMPL::SQL::Schema::Type->new(name => 'DATETIME');
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
37 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
38
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
39 1;