[interchange-cvs] interchange - heins modified 7 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Tue Sep 10 13:30:00 2002
User: heins
Date: 2002-09-10 17:29:09 GMT
Modified: lib/Vend/Table Common.pm DBI.pm DB_File.pm GDBM.pm
Modified: InMemory.pm LDAP.pm SDBM.pm
Log:
* Allow authoritative table name for constructed queries. Usage:
my $db =3D database_exists_ref($table);
my $tname =3D $db->name();
my $query =3D "select * from $tname";
$db->query($query);
This should allow REAL_NAME many more places.
Revision Changes Path
2.20 +8 -2 interchange/lib/Vend/Table/Common.pm
rev 2.20, prev_rev 2.19
Index: Common.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.19
retrieving revision 2.20
diff -u -r2.19 -r2.20
--- Common.pm 7 Aug 2002 08:03:02 -0000 2.19
+++ Common.pm 10 Sep 2002 17:29:09 -0000 2.20
@@ -1,6 +1,6 @@
# Vend::Table::Common - Common access methods for Interchange databases
#
-# $Id: Common.pm,v 2.19 2002/08/07 08:03:02 mheins Exp $
+# $Id: Common.pm,v 2.20 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -22,7 +22,7 @@
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA.
=20
-$VERSION =3D substr(q$Revision: 2.19 $, 10);
+$VERSION =3D substr(q$Revision: 2.20 $, 10);
use strict;
=20
package Vend::Table::Common;
@@ -245,6 +245,12 @@
# in 5.002.
my $r =3D $s->[$DBM]->EXISTS("k$key");
return $r;
+}
+
+sub name {
+ my ($s) =3D shift;
+ $s =3D $s->import_db() if ! defined $s->[$TIE_HASH];
+ return $s->[$CONFIG]{name};
}
=20
sub row_hash {
2.31 +8 -2 interchange/lib/Vend/Table/DBI.pm
rev 2.31, prev_rev 2.30
Index: DBI.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.30
retrieving revision 2.31
diff -u -r2.30 -r2.31
--- DBI.pm 6 Aug 2002 23:12:09 -0000 2.30
+++ DBI.pm 10 Sep 2002 17:29:09 -0000 2.31
@@ -1,6 +1,6 @@
# Vend::Table::DBI - Access a table stored in an DBI/DBD database
#
-# $Id: DBI.pm,v 2.30 2002/08/06 23:12:09 racke Exp $
+# $Id: DBI.pm,v 2.31 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -20,7 +20,7 @@
# MA 02111-1307 USA.
=20
package Vend::Table::DBI;
-$VERSION =3D substr(q$Revision: 2.30 $, 10);
+$VERSION =3D substr(q$Revision: 2.31 $, 10);
=20
use strict;
=20
@@ -682,6 +682,12 @@
my ($s) =3D shift;
$s =3D $s->import_db() if ! defined $s->[$DBI];
return $s->[$DBI];
+}
+
+sub name {
+ my ($s) =3D shift;
+ $s =3D $s->import_db() if ! defined $s->[$DBI];
+ return $s->[$CONFIG]{REAL_NAME} || $s->[$CONFIG]{name};
}
=20
sub columns {
2.4 +3 -2 interchange/lib/Vend/Table/DB_File.pm
rev 2.4, prev_rev 2.3
Index: DB_File.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/DB_File.pm,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- DB_File.pm 27 Jun 2002 22:24:10 -0000 2.3
+++ DB_File.pm 10 Sep 2002 17:29:09 -0000 2.4
@@ -1,6 +1,6 @@
# Vend::Table::DB_File - Access an Interchange table stored in a DB file h=
ash
#
-# $Id: DB_File.pm,v 2.3 2002/06/27 22:24:10 jon Exp $
+# $Id: DB_File.pm,v 2.4 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -30,7 +30,7 @@
use Vend::Table::Common;
=20
@ISA =3D qw(Vend::Table::Common);
-$VERSION =3D substr(q$Revision: 2.3 $, 10);
+$VERSION =3D substr(q$Revision: 2.4 $, 10);
=20
sub create {
my ($class, $config, $columns, $filename) =3D @_;
@@ -132,6 +132,7 @@
*field_settor =3D \&Vend::Table::Common::field_settor;
*inc_field =3D \&Vend::Table::Common::inc_field;
*isopen =3D \&Vend::Table::Common::isopen;
+*name =3D \&Vend::Table::Common::name;
*numeric =3D \&Vend::Table::Common::numeric;
*quote =3D \&Vend::Table::Common::quote;
*record_exists =3D \&Vend::Table::Common::record_exists;
2.4 +3 -2 interchange/lib/Vend/Table/GDBM.pm
rev 2.4, prev_rev 2.3
Index: GDBM.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/GDBM.pm,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- GDBM.pm 27 Jun 2002 22:24:10 -0000 2.3
+++ GDBM.pm 10 Sep 2002 17:29:09 -0000 2.4
@@ -1,6 +1,6 @@
# Vend::Table::GDBM - Access an Interchange table stored in a GDBM file
#
-# $Id: GDBM.pm,v 2.3 2002/06/27 22:24:10 jon Exp $
+# $Id: GDBM.pm,v 2.4 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -29,7 +29,7 @@
use Vend::Table::Common;
=20
@ISA =3D qw(Vend::Table::Common);
-$VERSION =3D substr(q$Revision: 2.3 $, 10);
+$VERSION =3D substr(q$Revision: 2.4 $, 10);
=20
sub new {
my ($class, $obj) =3D @_;
@@ -142,6 +142,7 @@
*field_settor =3D \&Vend::Table::Common::field_settor;
*inc_field =3D \&Vend::Table::Common::inc_field;
*isopen =3D \&Vend::Table::Common::isopen;
+*name =3D \&Vend::Table::Common::name;
*numeric =3D \&Vend::Table::Common::numeric;
*quote =3D \&Vend::Table::Common::quote;
*record_exists =3D \&Vend::Table::Common::record_exists;
2.9 +3 -2 interchange/lib/Vend/Table/InMemory.pm
rev 2.9, prev_rev 2.8
Index: InMemory.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/InMemory.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- InMemory.pm 7 Aug 2002 08:03:02 -0000 2.8
+++ InMemory.pm 10 Sep 2002 17:29:09 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Table::InMemory - Store an Interchange table in memory
#
-# $Id: InMemory.pm,v 2.8 2002/08/07 08:03:02 mheins Exp $
+# $Id: InMemory.pm,v 2.9 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -25,7 +25,7 @@
package Vend::Table::InMemory;
use Vend::Table::Common qw(!config !columns);
@ISA =3D qw/Vend::Table::Common/;
-$VERSION =3D substr(q$Revision: 2.8 $, 10);
+$VERSION =3D substr(q$Revision: 2.9 $, 10);
use strict;
=20
# 0: column names
@@ -226,6 +226,7 @@
*test_column =3D \&Vend::Table::Common::test_column;
*column_index =3D \&Vend::Table::Common::column_index;
*field =3D \&Vend::Table::Common::field;
+*name =3D \&Vend::Table::Common::name;
*numeric =3D \&Vend::Table::Common::numeric;
*set_field =3D \&Vend::Table::Common::set_field;
*suicide =3D \&Vend::Table::Common::suicide;
2.6 +3 -2 interchange/lib/Vend/Table/LDAP.pm
rev 2.6, prev_rev 2.5
Index: LDAP.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/LDAP.pm,v
retrieving revision 2.5
retrieving revision 2.6
diff -u -r2.5 -r2.6
--- LDAP.pm 15 Jul 2002 14:08:14 -0000 2.5
+++ LDAP.pm 10 Sep 2002 17:29:09 -0000 2.6
@@ -1,6 +1,6 @@
# Vend::Table::LDAP - Interchange LDAP pseudo-table access
#
-# $Id: LDAP.pm,v 2.5 2002/07/15 14:08:14 mheins Exp $
+# $Id: LDAP.pm,v 2.6 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -24,7 +24,7 @@
=20
package Vend::Table::LDAP;
@ISA =3D qw/Vend::Table::Common/;
-$VERSION =3D substr(q$Revision: 2.5 $, 10);
+$VERSION =3D substr(q$Revision: 2.6 $, 10);
use strict;
=20
use vars qw(
@@ -648,6 +648,7 @@
# Unfortunate hack need for Safe searches
*column_index =3D \&Vend::Table::Common::column_index;
*column_exists =3D \&Vend::Table::Common::column_exists;
+*name =3D \&Vend::Table::Common::name;
*numeric =3D \&Vend::Table::Common::numeric;
*isopen =3D \&Vend::Table::Common::isopen;
*reset =3D \&Vend::Table::Common::reset;
2.4 +4 -3 interchange/lib/Vend/Table/SDBM.pm
rev 2.4, prev_rev 2.3
Index: SDBM.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Table/SDBM.pm,v
retrieving revision 2.3
retrieving revision 2.4
diff -u -r2.3 -r2.4
--- SDBM.pm 27 Jun 2002 22:24:10 -0000 2.3
+++ SDBM.pm 10 Sep 2002 17:29:09 -0000 2.4
@@ -1,6 +1,6 @@
# Vend::Table::SDBM - Access an Interchange table stored in Perl's interna=
l SDBM
#
-# $Id: SDBM.pm,v 2.3 2002/06/27 22:24:10 jon Exp $
+# $Id: SDBM.pm,v 2.4 2002/09/10 17:29:09 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -23,7 +23,7 @@
# MA 02111-1307 USA.
=20
package Vend::Table::SDBM;
-$VERSION =3D substr(q$Revision: 2.3 $, 10);
+$VERSION =3D substr(q$Revision: 2.4 $, 10);
use strict;
use Fcntl;
use SDBM_File;
@@ -31,7 +31,7 @@
use Vend::Table::Common;
=20
@ISA =3D qw(Vend::Table::Common);
-$VERSION =3D substr(q$Revision: 2.3 $, 10);
+$VERSION =3D substr(q$Revision: 2.4 $, 10);
=20
sub create {
my ($class, $config, $columns, $filename) =3D @_;
@@ -138,6 +138,7 @@
*field_settor =3D \&Vend::Table::Common::field_settor;
*isopen =3D \&Vend::Table::Common::isopen;
*inc_field =3D \&Vend::Table::Common::inc_field;
+*name =3D \&Vend::Table::Common::name;
*numeric =3D \&Vend::Table::Common::numeric;
*quote =3D \&Vend::Table::Common::quote;
*record_exists =3D \&Vend::Table::Common::record_exists;