blib/lib/Mojolicious/DBIxCustom.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 9 | 12 | 75.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 6 | 50.0 |
pod | 0 | 2 | 0.0 |
total | 12 | 20 | 60.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Mojolicious::DBIxCustom; | ||||||
2 | 1 | 1 | 986 | use strict; | |||
1 | 2 | ||||||
1 | 24 | ||||||
3 | 1 | 1 | 4 | use warnings; | |||
1 | 2 | ||||||
1 | 25 | ||||||
4 | |||||||
5 | 1 | 1 | 648 | use DBIx::Custom -base; | |||
1 | 44203 | ||||||
1 | 9 | ||||||
6 | |||||||
7 | sub last_id{ | ||||||
8 | 0 | 0 | 0 | shift->select("LAST_INSERT_ID()")->value; | |||
9 | } | ||||||
10 | |||||||
11 | sub count{ | ||||||
12 | shift->select(@_, | ||||||
13 | after_build_sql => sub{ | ||||||
14 | 0 | 0 | "select count(*) from ($_[0]) as t" | ||||
15 | 0 | 0 | 0 | })->value; | |||
16 | } | ||||||
17 | |||||||
18 | 1; |