summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-08-05 03:24:44 +0000
committerfukachan <fukachan>2001-08-05 03:24:44 +0000
commit3eaaca9f8962691a89a688b6a13867908ca6be08 (patch)
treec9e73bea543c9235a90ba5b70eb9fb9fe30adf94
parente4cc719ae4765c351c424b6ebef20fe7686ff844 (diff)
downloadfml8-3eaaca9f8962691a89a688b6a13867908ca6be08.tar.gz
fml8-3eaaca9f8962691a89a688b6a13867908ca6be08.tar.bz2
fml8-3eaaca9f8962691a89a688b6a13867908ca6be08.zip
move SQL::Schema:: to IO::Adapter::SQL::
-rw-r--r--fml/lib/IO/Adapter/DBI.pm4
-rw-r--r--fml/lib/IO/Adapter/MySQL.pm18
-rw-r--r--fml/lib/IO/Adapter/RDBMS.pm9
-rw-r--r--fml/lib/IO/Adapter/SQL/toymodel.pm10
-rw-r--r--fml/lib/SQL/Makefile18
-rw-r--r--fml/lib/SQL/Schema/Makefile6
-rw-r--r--fml/lib/SQL/Schema/toymodel.pm71
7 files changed, 21 insertions, 115 deletions
diff --git a/fml/lib/IO/Adapter/DBI.pm b/fml/lib/IO/Adapter/DBI.pm
index a87c73e7..fa97de79 100644
--- a/fml/lib/IO/Adapter/DBI.pm
+++ b/fml/lib/IO/Adapter/DBI.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML$
+# $FML: DBI.pm,v 1.6 2001/06/17 08:57:10 fukachan Exp $
#
package IO::Adapter::DBI;
@@ -25,7 +25,7 @@ This module is a top level driver to talk with a DBI server in SQL
(Structured Query Language).
The model dependent SQL statement is expected to be holded in
-other modules in such as C<SQL::Schema::> class.
+other modules in such as C<IO::Adapter::SQL::> class.
Each model name is specified at $args->{ schema } in new($args).
=head1 METHODS
diff --git a/fml/lib/IO/Adapter/MySQL.pm b/fml/lib/IO/Adapter/MySQL.pm
index c871d923..9ac00c96 100644
--- a/fml/lib/IO/Adapter/MySQL.pm
+++ b/fml/lib/IO/Adapter/MySQL.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML$
+# $FML: MySQL.pm,v 1.13 2001/06/17 08:57:10 fukachan Exp $
#
@@ -50,7 +50,7 @@ This module is a top level driver to talk with a MySQL server in SQL
(Structured Query Language).
The model dependent SQL statement is expected to be holded in
-C<SQL::Schema::> modules.
+C<IO::Adapter::SQL::> modules.
You can specify your own module name at $args->{ driver } in
new($args).
@@ -63,7 +63,7 @@ C<get_next_value()> method.
=head2 C<configure($me, $args)>
IO::Adapter::MySQL specific configuration loader.
-It also calles SQL::Schema::$model module for model specific
+It also calles IO::Adapter::SQL::$model module for model specific
customizatoins and functions.
=cut
@@ -90,12 +90,12 @@ sub configure
});
# load model specific library
- my $pkg = $config->{ driver } || 'SQL::Schema::toymodel';
+ my $pkg = $config->{ driver } || 'IO::Adapter::SQL::toymodel';
eval qq{ require $pkg; $pkg->import();};
# $self->{ _driver } is the $config->{ driver } object.
unless ($@) {
- print STDERR "load $pkg\n" if $ENV{ 'debug ' };
+ print STDERR "load $pkg\n" if $ENV{ 'debug' };
@ISA = ($pkg, @ISA);
$me->{ _driver } = $pkg;
}
@@ -156,14 +156,14 @@ sub get_next_value
=head2 C<add($addr)>
add C<$addr> to the sql server specified at new().
-SQL::Schema::$model provides model specific SQL query statement.
-If SQL::Schema::add() exists, SQL::Schema::add() is called.
+IO::Adapter::SQL::$model provides model specific SQL query statement.
+If IO::Adapter::SQL::add() exists, IO::Adapter::SQL::add() is called.
=head2 C<delete($addr)>
delete C<$addr> from the sql server specified at new().
-SQL::Schema::$model provides model specific SQL query statement.
-If SQL::Schema::delete() exists, SQL::Schema::delete() is called.
+IO::Adapter::SQL::$model provides model specific SQL query statement.
+If IO::Adapter::SQL::delete() exists, IO::Adapter::SQL::delete() is called.
=cut
diff --git a/fml/lib/IO/Adapter/RDBMS.pm b/fml/lib/IO/Adapter/RDBMS.pm
index 7cccf2d1..80903a51 100644
--- a/fml/lib/IO/Adapter/RDBMS.pm
+++ b/fml/lib/IO/Adapter/RDBMS.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: RDBMS.pm,v 1.9 2001/05/30 14:35:11 fukachan Exp $
+# $FML: RDBMS.pm,v 1.10 2001/06/09 08:58:10 fukachan Exp $
#
package IO::Adapter::RDBMS;
@@ -14,7 +14,7 @@ use Carp;
=head1 NAME
-IO::Adapter::RDBMS - IO with SQL servers
+IO::Adapter::RDBMS - talk with SQL servers
=head1 SYNOPSIS
@@ -31,7 +31,7 @@ IO::Adapter::RDBMS - IO with SQL servers
Configure object for C<dsn>.
new({
- driver => 'SQL::Schema::toymodel',
+ driver => 'IO::Adapter::SQL::toymodel',
});
It forwards the request to the specified driver,
@@ -53,7 +53,8 @@ sub configure
$type = 'MySQL' if $type eq 'mysql';
$type = 'PostgreSQL' if $type eq 'postgresql';
- my $driver = "IO::Adapter::${type}::${schema}";
+ my $driver = "IO::Adapter::SQL::${type}::${schema}";
+ print STDERR "driver = $driver\n" if defined $ENV{'debug'};
# forward the request to the specified subclass or DBI base class
eval qq{ require $driver; $driver->import();};
diff --git a/fml/lib/IO/Adapter/SQL/toymodel.pm b/fml/lib/IO/Adapter/SQL/toymodel.pm
index e9b638ec..dc1e926b 100644
--- a/fml/lib/IO/Adapter/SQL/toymodel.pm
+++ b/fml/lib/IO/Adapter/SQL/toymodel.pm
@@ -3,11 +3,11 @@
# Copyright (C) 2000,2001 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: toymodel.pm,v 1.6 2001/06/17 08:57:11 fukachan Exp $
+# $FML: toymodel.pm,v 1.1.1.1 2001/08/05 01:55:17 fukachan Exp $
#
-package SQL::Schema::toymodel;
+package IO::Adapter::SQL::toymodel;
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
@@ -15,12 +15,12 @@ use Carp;
=head1 NAME
-SQL::Schema::toymodel - SQL statement dependent on toymodel
+IO::Adapter::SQL::toymodel - SQL statement dependent on toymodel
=head1 SYNOPSIS
- use SQL::Schema::toymodel;
- $obj = new SQL::Schema::toymodel;
+ use IO::Adapter::SQL::toymodel;
+ $obj = new IO::Adapter::SQL::toymodel;
=head1 DESCRIPTION
diff --git a/fml/lib/SQL/Makefile b/fml/lib/SQL/Makefile
deleted file mode 100644
index 2fcb52ac..00000000
--- a/fml/lib/SQL/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-all: anal
-
-anal:
- @ find . | sort | grep -v CVS | sed 's@./@@'
-
-html: _subdir index.ja.html
-
-_subdir:
- (cd Schema;make html)
-
-index.ja.html: *.pm
- ../../../doc/bin/dir2url.pl > index.ja.html
-
-_clean:
- rm -f index.ja.html */index.ja.html
-
-clean:
- (cd ../../..;make clean)
diff --git a/fml/lib/SQL/Schema/Makefile b/fml/lib/SQL/Schema/Makefile
deleted file mode 100644
index 795737fa..00000000
--- a/fml/lib/SQL/Schema/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-all: html
-
-html: index.ja.html
-
-index.ja.html: *pm
- ../../../../doc/bin/dir2url.pl > index.ja.html
diff --git a/fml/lib/SQL/Schema/toymodel.pm b/fml/lib/SQL/Schema/toymodel.pm
deleted file mode 100644
index 43caf067..00000000
--- a/fml/lib/SQL/Schema/toymodel.pm
+++ /dev/null
@@ -1,71 +0,0 @@
-#-*- perl -*-
-#
-# Copyright (C) 2000,2001 Ken'ichi Fukamachi
-# All rights reserved.
-#
-# $FML$
-#
-
-
-package SQL::Schema::toymodel;
-
-use strict;
-use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
-use Carp;
-
-=head1 NAME
-
-SQL::Schema::toymodel - SQL statement dependent on toymodel
-
-=head1 SYNOPSIS
-
- use SQL::Schema::toymodel;
- $obj = new SQL::Schema::toymodel;
-
-=head1 DESCRIPTION
-
-SQL::Schema modules hold SQL statement dependent on each specific
-model.
-
-=head1 METHODS
-
-=head2 C<build_sql_query($args)>
-
- $args = {
- query => 'add',
- address => 'rudo@nuinui.net',
- _params => {
- ml_name => 'elena',
- file => 'actives',
- },
- }
-
-=cut
-
-
-sub build_sql_query
-{
- my ($self, $args) = @_;
- my $query = $args->{ query };
- my $address = $args->{ address };
-
- # inherit parameter from object
- my $ml_name = $self->{ _params }->{ ml_name };
- my $file = $self->{ _params }->{ file };
- my $table = $self->{ _table };
-
- print STDERR "build_sql_query( query=$query )\n" if $ENV{'debug'};
-
- if ($query eq 'add') {
- "insert into $table values ('$ml_name', '$file', '$address', 0, 0)";
- }
- elsif ($query eq 'delete') {
- "delete from $table where ml='$ml_name' and address='$address'";
- }
- else {
- "select address from $table where ml='$ml_name' and file='$file'";
- }
-}
-
-
-1;