Name : perl-Net-MySQL
| |
Version : 0.11
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.1.1
| Date : 2023-07-20 17:26:37
|
Group : Development/Libraries/Perl
| Source RPM : perl-Net-MySQL-0.11-lp155.1.1.src.rpm
|
Size : 0.03 MB
| |
Packager : https://www_suse_com/
| |
Summary : Pure Perl MySQL network protocol interface
|
Description :
Net::MySQL is a Pure Perl client interface for the MySQL database. This module implements network protocol between server and client of MySQL, thus you don\'t need external MySQL client library like libmysqlclient for this module to work. It means this module enables you to connect to MySQL server from some operation systems which MySQL is not ported. How nifty!
Since this module\'s final goal is to completely replace DBD::mysql, API is made similar to that of DBI.
From perl you activate the interface with the statement
use Net::MySQL;
After that you can connect to multiple MySQL daemon and send multiple queries to any of them via a simple object oriented interface.
There are two classes which have public APIs: Net::MySQL and Net::MySQL::RecordIterator.
$mysql = Net::MySQL->new( hostname => $host, database => $database, user => $user, password => $password, );
Once you have connected to a daemon, you can can execute SQL with:
$mysql->query(q{ INSERT INTO foo (id, message) VALUES (1, \'Hello World\') });
If you want to retrieve results, you need to create a so-called statement handle with:
$mysql->query(q{ SELECT id, message FROM foo }); if ($mysql->has_selected_record) { my $a_record_iterator = $mysql->create_record_iterator; }
This Net::MySQL::RecordIterator object can be used for multiple purposes. First of all you can retreive a row of data:
my $record = $a_record_iterator->each;
The each() method takes out the reference result of one line at a time, and the return value is ARRAY reference.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-N/15.5/noarch |