| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package DBIx::Result::Convert::JSONSchema::Default::MySQL; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
DBIx::Result::Convert::JSONSchema::Default::MySQL - Mapping of MySQL field type lengths |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 VERSION |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
0.01 |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use DBIx::Result::Convert::JSONSchema::Default::MySQL; |
|
14
|
|
|
|
|
|
|
my $lenght_map = DBIx::Result::Convert::JSONSchema::Default::MySQL->get_length_map; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This module defines default field lengths of MySQL database field types. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=cut |
|
21
|
|
|
|
|
|
|
|
|
22
|
4
|
|
|
4
|
|
2565
|
use strict; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
109
|
|
|
23
|
4
|
|
|
4
|
|
19
|
use warnings; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
144
|
|
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
|
26
|
|
|
|
|
|
|
|
|
27
|
4
|
|
|
4
|
|
1342
|
use Readonly; |
|
|
4
|
|
|
|
|
9716
|
|
|
|
4
|
|
|
|
|
659
|
|
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Readonly my %LENGTH_MAP => ( |
|
31
|
|
|
|
|
|
|
char => [ 0, 1 ], |
|
32
|
|
|
|
|
|
|
varchar => [ 0, 255 ], |
|
33
|
|
|
|
|
|
|
binary => [ 0, 255 ], |
|
34
|
|
|
|
|
|
|
varbinary => [ 0, 255 ], |
|
35
|
|
|
|
|
|
|
blob => [ 0, 65_535 ], |
|
36
|
|
|
|
|
|
|
text => [ 0, 65_535 ], |
|
37
|
|
|
|
|
|
|
mediumtext => [ 0, 16_777_215 ], |
|
38
|
|
|
|
|
|
|
tinytext => [ 0, 255 ], |
|
39
|
|
|
|
|
|
|
date => [ 10, 10 ], |
|
40
|
|
|
|
|
|
|
datetime => [ 19, 19 ], |
|
41
|
|
|
|
|
|
|
timestamp => [ 19, 19 ], |
|
42
|
|
|
|
|
|
|
time => [ 8, 8 ], |
|
43
|
|
|
|
|
|
|
year => [ 4, 4 ], |
|
44
|
|
|
|
|
|
|
integer => { |
|
45
|
|
|
|
|
|
|
signed => [ -2_147_483_648, 2_147_483_647 ], |
|
46
|
|
|
|
|
|
|
unsigned => [ 0, 4_294_967_295 ], |
|
47
|
|
|
|
|
|
|
}, |
|
48
|
|
|
|
|
|
|
smallint => { |
|
49
|
|
|
|
|
|
|
signed => [ -32_768, 32_767 ], |
|
50
|
|
|
|
|
|
|
unsigned => [ 0, 65_535 ], |
|
51
|
|
|
|
|
|
|
}, |
|
52
|
|
|
|
|
|
|
tinyint => { |
|
53
|
|
|
|
|
|
|
signed => [ -128, 127 ], |
|
54
|
|
|
|
|
|
|
unsigned => [ 0, 255 ], |
|
55
|
|
|
|
|
|
|
}, |
|
56
|
|
|
|
|
|
|
mediumint => { |
|
57
|
|
|
|
|
|
|
signed => [ -8_388_608, 8_388_607 ], |
|
58
|
|
|
|
|
|
|
unsigned => [ 0, 16_777_215 ], |
|
59
|
|
|
|
|
|
|
}, |
|
60
|
|
|
|
|
|
|
bigint => { |
|
61
|
|
|
|
|
|
|
signed => [ (2**63) * -1, (2**63) - 1 ], |
|
62
|
|
|
|
|
|
|
unsigned => [ 0, (2**64) - 1 ], |
|
63
|
|
|
|
|
|
|
}, |
|
64
|
|
|
|
|
|
|
bit => { |
|
65
|
|
|
|
|
|
|
signed => [ 0, 1 ], |
|
66
|
|
|
|
|
|
|
unsigned => [ 0, 1 ], |
|
67
|
|
|
|
|
|
|
}, |
|
68
|
|
|
|
|
|
|
); |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 C |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Static method on class that returns field length mapping. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my $lenght_map = DBIx::Result::Convert::JSONSchema::Default::MySQL->get_length_map; |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
|
77
|
|
|
|
|
|
|
|
|
78
|
6
|
|
|
6
|
1
|
133
|
sub get_length_map { \%LENGTH_MAP } |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
malishew - C |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 LICENSE |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under |
|
87
|
|
|
|
|
|
|
the same terms as Perl itself. If you would like to contribute documentation |
|
88
|
|
|
|
|
|
|
or file a bug report then please raise an issue / pull request: |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
https://github.com/Humanstate/p5-dbix-result-convert-jsonschema |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |