| 1 | package DBIx::QuickORM::LookupTable::Unchecked; | ||
| 2 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | our $VERSION = '0.000033'; | |
| 6 | |||
| 7 | 2 | ▶ | use Role::Tiny::With; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | use parent 'DBIx::QuickORM::LookupTable'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | =pod | ||
| 12 | |||
| 13 | =encoding UTF-8 | ||
| 14 | |||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | DBIx::QuickORM::LookupTable::Unchecked - No row cache and no canonical checks. | ||
| 18 | |||
| 19 | =head1 DESCRIPTION | ||
| 20 | |||
| 21 | C<< lookup => 'Unchecked' >>. Every read gives new row data, nothing is | ||
| 22 | cached, and all row data is canonical, so C<enforce_canon> never croaks, not | ||
| 23 | even inside a transaction or for row data that is deleted or not in the | ||
| 24 | database. Keeping rows current, and keeping them inside their transactions, | ||
| 25 | is the caller's job. It costs the least. | ||
| 26 | |||
| 27 | It implements L<DBIx::QuickORM::Role::LookupTable> and inherits | ||
| 28 | L<DBIx::QuickORM::LookupTable>. Every method of the role does nothing: | ||
| 29 | C<ingest>, C<store>, and C<update_entry> return the row data given, C<lookup> | ||
| 30 | finds nothing, C<is_canon> is true, and C<canon_status> is undef. | ||
| 31 | |||
| 32 | Row state still applies: a row's C<is_in_db> and C<was_deleted> follow | ||
| 33 | deletes and rolled-back inserts, a row not in the database is not canonical | ||
| 34 | itself (C<< $row->is_canon >>), and the row methods that need a stored row | ||
| 35 | (C<update>, C<delete>, C<refresh>) still croak on one. Its C<canon_status> | ||
| 36 | stays undef even then: C<is_in_db> and C<was_deleted> are what tell. | ||
| 37 | C<retain_cache> croaks with this lookup table, and C<cache> options always | ||
| 38 | miss. | ||
| 39 | |||
| 40 | =head1 SYNOPSIS | ||
| 41 | |||
| 42 | my $orm = DBIx::QuickORM->new(credentials => \%credentials, lookup => 'Unchecked'); | ||
| 43 | |||
| 44 | my $ann = $orm->insert(users => {name => 'Ann'}); | ||
| 45 | $ann->delete; | ||
| 46 | |||
| 47 | my $status = $orm->canon_status(users => $ann); # undef: all row data is canonical | ||
| 48 | my $stored = $ann->is_in_db; # 0: this is what tells | ||
| 49 | |||
| 50 | =cut | ||
| 51 | |||
| 52 | 3 | ▶ | sub caches { 0 } |
|
Subroutine
caches: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 53 | |||
| 54 | 7 | ▶ | sub lookup { undef } |
|
Subroutine
lookup: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 55 | 37 | ▶ | sub is_canon { 1 } |
|
Subroutine
is_canon: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 56 | 37 | ▶ | sub canon_status { undef } |
|
Subroutine
canon_status: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 57 | |||
| 58 | 8 | ▶ | sub ingest { $_[2] } |
|
Subroutine
ingest: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 59 | 7 | ▶ | sub store { $_[2] } |
|
Subroutine
store: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 60 | 3 | ▶ | sub update_entry { $_[4] } |
|
Subroutine
update_entry: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 61 | 1 | ▶ | sub ingest_many { $_[2] } |
|
Subroutine
ingest_many: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 62 | |||
| 63 | 3 | ▶ | sub gone { } |
|
Subroutine
gone: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 64 | 3 | ▶ | sub forget { } |
|
Subroutine
forget: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 65 | 3 | ▶ | sub clear { } |
|
Subroutine
clear: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 66 | 1 | ▶ | sub remove_table { } |
|
Subroutine
remove_table: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 67 | 6 | ▶ | sub begin_root { } |
|
Subroutine
begin_root: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 68 | 3 | ▶ | sub push_level { } |
|
Subroutine
push_level: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 69 | 2 | ▶ | sub commit_level { } |
|
Subroutine
commit_level: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 70 | 7 | ▶ | sub rollback_level { } |
|
Subroutine
rollback_level: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 71 | 2 | ▶ | sub clear_txn_levels { } |
|
Subroutine
clear_txn_levels: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 72 | |||
| 73 | 2 | with 'DBIx::QuickORM::Role::LookupTable'; | |
| 74 | |||
| 75 | 2 | 1; | |
| 76 | |||
| 77 | __END__ | ||