line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$VERSION = "1.06"; |
2
|
|
|
|
|
|
|
package DBIx::Frame; |
3
|
|
|
|
|
|
|
our $VERSION = "1.06"; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# -*- Perl -*- Wed May 26 09:23:06 CDT 2004 |
6
|
|
|
|
|
|
|
############################################################################### |
7
|
|
|
|
|
|
|
# Written by Tim Skirvin |
8
|
|
|
|
|
|
|
# Copyright 2000-2004, Tim Skirvin and UIUC Board of Trustees. |
9
|
|
|
|
|
|
|
# Redistribution terms are below. |
10
|
|
|
|
|
|
|
############################################################################### |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
DBIx::Frame - a perl module for creating and maintaining DBI frameworks |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use DBIx::Frame; |
19
|
|
|
|
|
|
|
DBIx::Frame->init('server', 'dbtype') || exit(0); |
20
|
|
|
|
|
|
|
my $DB = DBIx::Frame->new('database', 'user', 'pass') |
21
|
|
|
|
|
|
|
or die("Couldn't connect to database: ", DBI->errstr); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
See below for how to actually use this object. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
DBIx::Frame is an extension of the standard DBI perl module, designed |
28
|
|
|
|
|
|
|
around mysql, and used to create and maintain frameworks for databases. |
29
|
|
|
|
|
|
|
It has query logging, and a standardized interface for standard SQL |
30
|
|
|
|
|
|
|
statements like 'update' and 'insert' that doesn't require understanding |
31
|
|
|
|
|
|
|
SQL to any great degree. Ideally, the user or developer shouldn't have to |
32
|
|
|
|
|
|
|
know too much SQL to be able to administer a database. On the other hand, |
33
|
|
|
|
|
|
|
it does require a certain setup that isn't necessarily easy to pick up, |
34
|
|
|
|
|
|
|
and isn't standard SQL - with all the problems that this entails. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Database design is discussed below. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
1
|
|
811
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
41
|
1
|
|
|
1
|
|
2408
|
use DBI; |
|
1
|
|
|
|
|
41379
|
|
|
1
|
|
|
|
|
71
|
|
42
|
1
|
|
|
1
|
|
987
|
use SelfLoader; |
|
1
|
|
|
|
|
9825
|
|
|
1
|
|
|
|
|
63
|
|
43
|
|
|
|
|
|
|
require Exporter; |
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
|
|
158
|
use vars qw( $SERVER $DBTYPE $USER $PASS $DBNAME %FIELDS %KEYS %LIST %HTML |
46
|
1
|
|
|
1
|
|
8
|
%REQUIRED %ADMIN %TEXT %ORDER $DEBUG $ERROR ); |
|
1
|
|
|
|
|
1
|
|
47
|
|
|
|
|
|
|
$DEBUG ||= 0; # Default of $DEBUG is 0 - must set it elsewhere |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
SelfLoader->load_stubs(); # Prepare module so it can be loaded elsewhere |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__DATA__ # Comment me out to test the functions without SelfLoader; |