general/dbms/sqlite.pm untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 48 CC 4 SCAR 22.2
CC
4
Cov
0%
errconn
20.0
errdata
2.0
BEGIN
2.0
CRAP 9.2
1 package NKTI::general::dbms::sqlite;
2
3 use strict;
4 use warnings;
5 use DBI;
6 use JSON;
7 use Data::Dumper;
8
9 # Subroutine for SQLite error Handling :
10 # ------------------------------------------------------------------------
11 =head1 SUBROUTINE errconn()
12
13 Deskripsi subroutine errconn() :
14 ----------------------------------------
15 Subroutine yang berfungsi untuk handel Error Connection MySQL.
16
17 Parameter subroutine errconn() :
18 ----------------------------------------
19 No Parameter Subroutine
20
21 =cut
22 sub errconn {
23
24 # Define array for place error DBMS Connection :
25 # ----------------------------------------------------------------
26 my @data = ();
27
28 # Check IF defined $DBI::err;
29 # ----------------------------------------------------------------
30 if (defined $DBI::err) {
31 $data[0] = $DBI::err;
32 } else {
33 $data[0] = 00000;
34 }
35
36 # Check IF defined $DBI::state :
37 # ----------------------------------------------------------------
38 if (defined $DBI::state) {
39 $data[1] = $DBI::state;
40 } else {
41 $data[1] = 0;
42 }
43
44 # Check IF defined $DBI::errstr :
45 # ----------------------------------------------------------------
46 if (defined $DBI::errstr) {
47 $data[2] = $DBI::errstr;
48 } else {
49 $data[2] = 'none';
50 }
51
52 # Return Result :
53 # ----------------------------------------------------------------
54 return \@data;
55 }
56 # End of Subroutine for SQLite error Handling.
57 # ===========================================================================================================
58
59 # Subroutine for Error Handling Data SQLite :
60 # ------------------------------------------------------------------------
61 =head1 SUBROUTINE errdata()
62
63 Deskripsi subroutine errdata() :
64 ----------------------------------------
65 Subroutine yang berfungsi untuk menampilkan error saat proses koneksi Data SQLite.
66
67 Parameter subroutine errdata() :
68 ----------------------------------------
69 $sth => Berisi scalar $sth.
70
71 =cut
72 sub errdata {
73
74 # Define parameter Subroutine :
75 # ----------------------------------------------------------------
76 my ($self, $sth) = @_;
77
78 # Define array for place result :
79 # ----------------------------------------------------------------
80 my @data = ();
81
82 # Place result :
83 # ----------------------------------------------------------------
84 $data[0] = $sth->err;
85 $data[1] = $sth->state;
86 $data[2] = $sth->errstr;
87
88 # Return Result :
89 # ----------------------------------------------------------------
90 return \@data;
91 }
92 # End of Subroutine for Error Handling Data SQLite.
93 # ===========================================================================================================
94
95 1;
96 __END__