| 1 | package Sah::Schema::tabledef::table_def; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $schema = [hash => { # XXX should be 'defhash' later | |
| 7 | summary => 'Table definition', | ||
| 8 | |||
| 9 | # tmp | ||
| 10 | _prop => { | ||
| 11 | # from defhash | ||
| 12 | v => {}, | ||
| 13 | defhash_v => {}, | ||
| 14 | name => {}, | ||
| 15 | summary => {}, | ||
| 16 | description => {}, | ||
| 17 | tags => {}, | ||
| 18 | x => {}, | ||
| 19 | |||
| 20 | fields => {}, | ||
| 21 | pk => {}, | ||
| 22 | }, | ||
| 23 | |||
| 24 | keys => { | ||
| 25 | |||
| 26 | # XXX from defhash | ||
| 27 | summary => [ | ||
| 28 | 'str', | ||
| 29 | ], | ||
| 30 | |||
| 31 | # XXX from defhash | ||
| 32 | description => [ | ||
| 33 | 'str', | ||
| 34 | ], | ||
| 35 | |||
| 36 | # XXX from defhash | ||
| 37 | tags => [ | ||
| 38 | 'array', | ||
| 39 | ], | ||
| 40 | |||
| 41 | # XXX from defhash | ||
| 42 | x => [ | ||
| 43 | 'any', | ||
| 44 | ], | ||
| 45 | |||
| 46 | fields => [ | ||
| 47 | 'array*', | ||
| 48 | of => ['field_def', {req=>1}, {}], | ||
| 49 | ], | ||
| 50 | |||
| 51 | pk => [ | ||
| 52 | 'any*' => {of => ['str*', 'array*']}, | ||
| 53 | # XXX how to check that if string, is one of fields' key? | ||
| 54 | # XXX how to check that if array, its element must all be in fields' keys? | ||
| 55 | ], | ||
| 56 | }, | ||
| 57 | 'keys.restrict' => 0, | ||
| 58 | |||
| 59 | req_keys => [qw/fields pk/], | ||
| 60 | |||
| 61 | # XXX from defhash | ||
| 62 | 'allowed_keys_re' => qr/\A\w+(\.\w+)*\z/, | ||
| 63 | }, {}]; | ||
| 64 | |||
| 65 | 1 | 1; | |
| 66 | # ABSTRACT: | ||
| 67 | |||
| 68 | __END__ | ||