#@ISA = qw(Exporter);
@ISA = ();
-$VERSION = "0.18";
+$VERSION = "0.19";
=head1 NAME
it a different process. Most importantly, DBIx::DBSchema can write SQL
CREATE statements statements for different databases from a single source.
-Currently supported databases are MySQL and PostgreSQL. DBIx::DBSchema will
-attempt to use generic SQL syntax for other databases. Assistance adding
-support for other databases is welcomed.
+Currently supported databases are MySQL and PostgreSQL. Sybase support is
+partially implemented. DBIx::DBSchema will attempt to use generic SQL syntax
+for other databases. Assistance adding support for other databases is
+welcomed. See L<DBIx::DBSchema::DBD>, "Driver Writer's Guide and Base Class".
=head1 METHODS
Ivan Kohler <ivan-dbix-dbschema@420.am>
+Charles Shapiro <charles.shapiro@numethods.com> and Mitchell Friedman
+<mitchell.friedman@numethods.com> contributed the start of a Sybase driver.
+
=head1 COPYRIGHT
Copyright (c) 2000 Ivan Kohler
L<DBIx::DBSchema::Table>, L<DBIx::DBSchema::ColGroup>,
L<DBIx::DBSchema::ColGroup::Unique>, L<DBIx::DBSchema::ColGroup::Index>,
-L<DBIx::DBSchema::Column>, L<DBIx::DBSchema::DBD>, L<DBIx::DBSchema::mysql>,
-L<DBIx::DBSchema::Pg>, L<FS::Record>, L<DBI>
+L<DBIx::DBSchema::Column>, L<DBIx::DBSchema::DBD>,
+L<DBIx::DBSchema::DBD::mysql>, L<DBIx::DBSchema::DBD::Pg>, L<FS::Record>,
+L<DBI>
=cut
=back
+=head1 TYPE MAPPING
+
+You can define a %typemap array for your driver to map "standard" data
+types to database-specific types. For example, the MySQL TIMESTAMP field
+has non-standard auto-updating semantics; the MySQL DATETIME type is
+what other databases and the ODBC standard call TIMESTAMP, so on of the
+entries in the MySQL %typemap is:
+
+ 'TIMESTAMP' => 'DATETIME',
+
+Another example is the Pg %typemap which maps the standard types BLOB and
+LONG VARBINARY to the Pg-specific BYTEA:
+
+ 'BLOB' => 'BYTEA',
+ 'LONG VARBINARY' => 'BYTEA',
+
+Make sure you use all uppercase-keys.
+
=head1 AUTHOR
Ivan Kohler <ivan-dbix-dbschema@420.am>
--- /dev/null
+package DBIx::DBSchema::DBD::Sybase;
+
+use strict;
+use vars qw($VERSION @ISA %typemap);
+use DBIx::DBSchema::DBD;
+
+$VERSION = '0.02';
+@ISA = qw(DBIx::DBSchema::DBD);
+
+%typemap = (
+# 'empty' => 'empty'
+);
+
+#
+# Return this from uncompleted driver calls.
+#
+
+=head1 NAME
+
+DBIx::DBSchema::DBD::Sybase - Sybase database driver for DBIx::DBSchema
+
+=head1 SYNOPSIS
+
+use DBI;
+use DBIx::DBSchema;
+
+$dbh = DBI->connect('dbi:Sybase:dbname=database', 'user', 'pass');
+$schema = new_native DBIx::DBSchema $dbh;
+
+=head1 DESCRIPTION
+
+This module implements a Sybase driver for DBIx::DBSchema.
+
+=cut
+
+sub columns {
+
+ my($proto, $dbh, $table) = @_;
+
+ my $sth = $dbh->prepare("sp_columns \@table_name=$table")
+ or die $dbh->errstr;
+
+ $sth->execute or die $sth->errstr;
+ map {
+ [
+ $_->{'COLUMN_NAME'},
+ $_->{'TYPE_NAME'},
+ ($_->{'NULLABLE'} ? 1 : ''),
+ $_->{'LENGTH'},
+ '', #default
+ '' #local
+ ]
+ } @{ $sth->fetchall_arrayref({}) };
+
+}
+
+sub primary_key {
+ return("StubbedPrimaryKey");
+}
+
+
+sub unique {
+
+ my %stubList = (
+ 'stubfirstUniqueIndex' => ['stubfirstUniqueIndex'],
+ 'stubtwostUniqueIndex' => ['stubtwostUniqueIndex']
+ );
+
+ return ( { %stubList } );
+
+}
+
+sub index {
+
+ my %stubList = (
+ 'stubfirstIndex' => ['stubfirstUniqueIndex'],
+ 'stubtwostIndex' => ['stubtwostUniqueIndex']
+ );
+
+ return ( { %stubList } );
+
+}
+
+=head1 AUTHOR
+
+Charles Shapiro <charles.shapiro@numethods.com>
+(courtesy of Ivan Kohler <ivan-dbix-dbschema@420.am>)
+
+Mitchell Friedman <mitchell.friedman@numethods.com>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2001 Charles Shapiro, Mitchell J. Friedman
+Copyright (c) 2001 nuMethods LLC.
+All rights reserved.
+This program is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
+=head1 BUGS
+
+Yes.
+
+Most of this is not implemented.
+
+the "columns" method works; primary key, unique and index do not yet. Please
+send any patches to all three addresses listed above.
+
+=head1 SEE ALSO
+
+L<DBIx::DBSchema>, L<DBIx::DBSchema::DBD>, L<DBI>, L<DBI::DBD>
+
+=cut
+
+1;
+
it from different process. Most importantly, DBIx::DBSchema can write SQL
CREATE statements for different databases from a single source.
-Currently supported databases are MySQL and PostgreSQL. DBIx::DBSchema will
-attempt to use generic SQL syntax for other databases. Assistance adding
-support for other databases is welcomed.
+Currently supported databases are MySQL and PostgreSQL. Sybase support is
+partially implemented. DBIx::DBSchema will attempt to use generic SQL syntax
+for other databases. Assistance adding support for other databases is
+welcomed. See the DBIx::DBSchema::DBD> manpage, "Driver Writer's Guide and
+Base Class".
To install:
perl Makefile.PL
Homepage: <http://www.420.am/dbix-dbschema>
-$Id: README,v 1.5 2001-07-08 00:57:17 ivan Exp $
+$Id: README,v 1.6 2001-09-05 16:20:03 ivan Exp $