Import of a perl5 module for accessing MySQL databases
This commit is contained in:
parent
6a10d52817
commit
0fa2622346
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=6997
29
databases/p5-DBD-mysql/Makefile
Normal file
29
databases/p5-DBD-mysql/Makefile
Normal file
@ -0,0 +1,29 @@
|
||||
# New ports collection makefile for: p5-MySQL
|
||||
# Version required: 1.17
|
||||
# Date created: June 17th 1997
|
||||
# Whom: James FitzGibbon <jfitz@FreeBSD.org>
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
DISTNAME= Mysqlperl-1.17
|
||||
PKGNAME= p5-Mysql-1.17
|
||||
CATEGORIES= databases perl5
|
||||
MASTER_SITES= http://www.tcx.se/Contrib/
|
||||
EXTRACT_SUFX= .tgz
|
||||
|
||||
MAINTAINER= jfitz@FreeBSD.ORG
|
||||
|
||||
BUILD_DEPENDS= perl5.004:${PORTSDIR}/lang/perl5 \
|
||||
${PREFIX}/lib/mysql/libmysqlclient.a:${PORTSDIR}/databases/mysql
|
||||
RUN_DEPENDS= perl5.004:${PORTSDIR}/lang/perl5
|
||||
|
||||
MAN3= Mysql.3
|
||||
MANPREFIX= ${PREFIX}/lib/perl5
|
||||
|
||||
CONFIGURE_ENV+= PREFIX=${PREFIX}
|
||||
|
||||
do-configure:
|
||||
@cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${PREFIX}/bin/perl Makefile.PL
|
||||
|
||||
.include <bsd.port.mk>
|
1
databases/p5-DBD-mysql/distinfo
Normal file
1
databases/p5-DBD-mysql/distinfo
Normal file
@ -0,0 +1 @@
|
||||
MD5 (Mysqlperl-1.17.tgz) = a92064386ff373a31fb1fe854e81e461
|
1
databases/p5-DBD-mysql/pkg-comment
Normal file
1
databases/p5-DBD-mysql/pkg-comment
Normal file
@ -0,0 +1 @@
|
||||
perl5 interface to the MySQL database
|
58
databases/p5-DBD-mysql/pkg-descr
Normal file
58
databases/p5-DBD-mysql/pkg-descr
Normal file
@ -0,0 +1,58 @@
|
||||
What you achieve with MysqlPerl
|
||||
------------------------------
|
||||
|
||||
MysqlPerl is an interface between the perl programming language and the
|
||||
MySQL programming API that comes with the MySQL relational database
|
||||
management system. All functions provided by the MySQL programming API
|
||||
are supported.
|
||||
|
||||
From perl you activate the interface with the statement
|
||||
|
||||
use Mysql;
|
||||
|
||||
After that you can connect to multiple msql database servers and send
|
||||
multiple queries to any of them via an simple object oriented
|
||||
interface. Two types of objects are available: database handles and
|
||||
statement handles. Perl returns a database handle to the Connect
|
||||
method like so:
|
||||
|
||||
$dbh = Mysql->connect($hostname,$databasename);
|
||||
|
||||
Once you have connected to a database, you get a statement handle
|
||||
with:
|
||||
|
||||
$sth = $dbh->query("select foo from bar");
|
||||
|
||||
You can open as many queries as you like simultaneously by selecting a
|
||||
different scalar to hold the object:
|
||||
|
||||
$another_sth = $dbh->Query("select bar from foo");
|
||||
|
||||
|
||||
The statement handle allows you to step through the virtual table
|
||||
returned from the database with the FetchRow method:
|
||||
|
||||
@row = $sth->fetchrow;
|
||||
or
|
||||
%hash = $sth->fetchhash;
|
||||
|
||||
You can access all metadata that MySQL supplies for a given table. To
|
||||
find out the number of rows or the number of fields returned by a
|
||||
query you simply say:
|
||||
|
||||
$numrows = $sth->numrows;
|
||||
$numfields = $sth->numfields;
|
||||
|
||||
To find out the size in bytes for the field with the offset 0 (the
|
||||
first field of a query), you say:
|
||||
|
||||
$length = $sth->length->[0];
|
||||
|
||||
The list of the names for each column is returned by
|
||||
|
||||
@list => $sth->name;
|
||||
|
||||
As for other metadata available, consult the manpage that comes with
|
||||
MysqlPerl and study the examples in the file t/msql.t, which is the
|
||||
extensive testscript to test your installation, but is heavily
|
||||
commented, so you may use it as a tutorial.
|
8
databases/p5-DBD-mysql/pkg-plist
Normal file
8
databases/p5-DBD-mysql/pkg-plist
Normal file
@ -0,0 +1,8 @@
|
||||
lib/perl5/man/man3/Mysql.3.gz
|
||||
lib/perl5/site_perl/Mysql.pm
|
||||
lib/perl5/site_perl/Mysql/Statement.pm
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/Mysql.bs
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/Mysql.so
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/.packlist
|
||||
@dirrm lib/perl5/site_perl/i386-freebsd/auto/Mysql
|
||||
@dirrm lib/perl5/site_perl/Mysql
|
29
databases/p5-Mysql/Makefile
Normal file
29
databases/p5-Mysql/Makefile
Normal file
@ -0,0 +1,29 @@
|
||||
# New ports collection makefile for: p5-MySQL
|
||||
# Version required: 1.17
|
||||
# Date created: June 17th 1997
|
||||
# Whom: James FitzGibbon <jfitz@FreeBSD.org>
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
DISTNAME= Mysqlperl-1.17
|
||||
PKGNAME= p5-Mysql-1.17
|
||||
CATEGORIES= databases perl5
|
||||
MASTER_SITES= http://www.tcx.se/Contrib/
|
||||
EXTRACT_SUFX= .tgz
|
||||
|
||||
MAINTAINER= jfitz@FreeBSD.ORG
|
||||
|
||||
BUILD_DEPENDS= perl5.004:${PORTSDIR}/lang/perl5 \
|
||||
${PREFIX}/lib/mysql/libmysqlclient.a:${PORTSDIR}/databases/mysql
|
||||
RUN_DEPENDS= perl5.004:${PORTSDIR}/lang/perl5
|
||||
|
||||
MAN3= Mysql.3
|
||||
MANPREFIX= ${PREFIX}/lib/perl5
|
||||
|
||||
CONFIGURE_ENV+= PREFIX=${PREFIX}
|
||||
|
||||
do-configure:
|
||||
@cd ${WRKSRC}; ${SETENV} ${CONFIGURE_ENV} ${PREFIX}/bin/perl Makefile.PL
|
||||
|
||||
.include <bsd.port.mk>
|
1
databases/p5-Mysql/distinfo
Normal file
1
databases/p5-Mysql/distinfo
Normal file
@ -0,0 +1 @@
|
||||
MD5 (Mysqlperl-1.17.tgz) = a92064386ff373a31fb1fe854e81e461
|
1
databases/p5-Mysql/pkg-comment
Normal file
1
databases/p5-Mysql/pkg-comment
Normal file
@ -0,0 +1 @@
|
||||
perl5 interface to the MySQL database
|
58
databases/p5-Mysql/pkg-descr
Normal file
58
databases/p5-Mysql/pkg-descr
Normal file
@ -0,0 +1,58 @@
|
||||
What you achieve with MysqlPerl
|
||||
------------------------------
|
||||
|
||||
MysqlPerl is an interface between the perl programming language and the
|
||||
MySQL programming API that comes with the MySQL relational database
|
||||
management system. All functions provided by the MySQL programming API
|
||||
are supported.
|
||||
|
||||
From perl you activate the interface with the statement
|
||||
|
||||
use Mysql;
|
||||
|
||||
After that you can connect to multiple msql database servers and send
|
||||
multiple queries to any of them via an simple object oriented
|
||||
interface. Two types of objects are available: database handles and
|
||||
statement handles. Perl returns a database handle to the Connect
|
||||
method like so:
|
||||
|
||||
$dbh = Mysql->connect($hostname,$databasename);
|
||||
|
||||
Once you have connected to a database, you get a statement handle
|
||||
with:
|
||||
|
||||
$sth = $dbh->query("select foo from bar");
|
||||
|
||||
You can open as many queries as you like simultaneously by selecting a
|
||||
different scalar to hold the object:
|
||||
|
||||
$another_sth = $dbh->Query("select bar from foo");
|
||||
|
||||
|
||||
The statement handle allows you to step through the virtual table
|
||||
returned from the database with the FetchRow method:
|
||||
|
||||
@row = $sth->fetchrow;
|
||||
or
|
||||
%hash = $sth->fetchhash;
|
||||
|
||||
You can access all metadata that MySQL supplies for a given table. To
|
||||
find out the number of rows or the number of fields returned by a
|
||||
query you simply say:
|
||||
|
||||
$numrows = $sth->numrows;
|
||||
$numfields = $sth->numfields;
|
||||
|
||||
To find out the size in bytes for the field with the offset 0 (the
|
||||
first field of a query), you say:
|
||||
|
||||
$length = $sth->length->[0];
|
||||
|
||||
The list of the names for each column is returned by
|
||||
|
||||
@list => $sth->name;
|
||||
|
||||
As for other metadata available, consult the manpage that comes with
|
||||
MysqlPerl and study the examples in the file t/msql.t, which is the
|
||||
extensive testscript to test your installation, but is heavily
|
||||
commented, so you may use it as a tutorial.
|
8
databases/p5-Mysql/pkg-plist
Normal file
8
databases/p5-Mysql/pkg-plist
Normal file
@ -0,0 +1,8 @@
|
||||
lib/perl5/man/man3/Mysql.3.gz
|
||||
lib/perl5/site_perl/Mysql.pm
|
||||
lib/perl5/site_perl/Mysql/Statement.pm
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/Mysql.bs
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/Mysql.so
|
||||
lib/perl5/site_perl/i386-freebsd/auto/Mysql/.packlist
|
||||
@dirrm lib/perl5/site_perl/i386-freebsd/auto/Mysql
|
||||
@dirrm lib/perl5/site_perl/Mysql
|
Loading…
Reference in New Issue
Block a user