NAME
DBIx::Custom::MySQL - MySQL implementation
SYNOPSYS
# Connect to the database
my $dbi = DBIx::Custom::MySQL->connect(
user => 'taro',
password => 'kliej&@K',
database => 'dbname'
);
# Get last insert id
my $last_insert_id = $dbi->last_insert_id;
ATTRIBUTES
DBIx::Custom::MySQL inherits all attributes from DBIx::Custom and implements the following new ones.
database
my $database = $dbi->database;
$dbi = $dbi->database('dbname');
Database name. connect()
method use this value to connect the database if data_source
is not specified.
host
my $host = $dbi->host;
$dbi = $dbi->host('somehost');
Host name or IP address. connect()
method use this value to connect the database if data_source
is not specified.
port
my $port = $dbi->port;
$dbi = $dbi->port(1198);
Port number. connect()
method use this value to connect the database if data_source
is not specified.
METHODS
DBIx::Custom::MySQL inherits all methods from DBIx::Custom and implements the following new ones.
connect
my $dbi = DBIx::Custom::MySQL->connect(
user => 'taro',
password => 'kliej&@K',
database => 'dbname',
host => 'somehost',
port => 2000
);
Create a new DBIx::Custom::MySQL object and connect to the database. This method overrides DBIx::Custom::connect()
method. You can specify all attributes of DBIx::Custom and DBIx::Custom::MySQL, such as database
, host
, port
.
last_insert_id
my $last_insert_id = $dbi->last_insert_id;
Get last insert id. This is same as last_insert_id()
function in MySQL.