NAME

DBIx::Custom::MySQL - MySQL implementation

SYNOPSYS

# Connect to database
my $dbi = DBIx::Custom::MySQL->connect(user     => 'taro', 
                                       password => 'kliej&@K',
                                       database => 'your_database');

# Get last insert id
my $id = $dbi->last_insert_id;

ATTRIBUTES

This class is DBIx::Custom subclass. You can use all attributes of DBIx::Custom

database

my $database = $dbi->database;
$dbi         = $dbi->database('your_database');

Database name. This is used for connect().

host

my $host = $dbi->host;
$dbi     = $dbi->host('somehost.com');

Database host name. You can also set IP address, instead of host name. This is used for connect().

$dbi->host('127.03.45.12');

port

my $port = $dbi->port;
$dbi     = $dbi->port(1198);

Database port. This is used for connect().

METHODS

This class is DBIx::Custom subclass. You can use all methods of DBIx::Custom.

connect (overridden)

$dbi = DBIx::Custom::MySQL->connect(
    data_source => "dbi:mysql:database=books;host=somehost;port=2000"
);

$dbi = DBIx::Custom::MySQL->connect(user     => 'taro', 
                                    password => 'kliej&@K',
                                    database => 'your_database',
                                    host     => 'somehost',
                                    port     => 2000);

Connect to database. You can also specify database, host, and port (instead of data soruce).

last_insert_id

$last_insert_id = $dbi->last_insert_id;

Get last insert id. This is equal to MySQL last_insert_id() function.