NAME

DBIx::Meld::Traits::SQLAbstract - Melds SQL::Abstract with DBIx::Meld.

ATTRIBUTES

abstract

The SQL::Abstract object that is being used.

METHODS

insert

$meld->insert(
    'users',                                            # table name
    { user_name=>'bob2003', email=>'bob@example.com' }, # fields to insert
);

This accepts the same arguments as SQL::Abstract's insert() method accepts.

update

$meld->update(
    'users',                 # table name
    { phone => '555-1234' }, # fields to update
    { user_id => $uid },     # where clause
);

This accepts the same arguments as SQL::Abstract's update() method accepts.

delete

$meld->delete(
    'users',             # table name
    { user_id => $uid }, # where clause
);

This accepts the same arguments as SQL::Abstract's delete() method accepts.

array_row

my $user = $sweeet->array_row(
    'users',                                  # table name
    ['user_id', 'created', 'email', 'phone'], # fields to retrieve
    { user_name => $uname },                  # where clause
);

hash_row

my $user = $meld->hash_row(
    'users',                    # table name
    ['user_id', 'created'],     # fields to retrieve
    { user_name => 'bob2003' }, # where clause
);

array_of_array_rows

my $disabled_users = $meld->array_of_array_rows(
    'users',                       # table name
    ['user_id', 'email', 'phone'], # fields to retrieve
    { status => 0 },               # where clause
    'status',                      # order by clause
);
print $disabled_users->[2]->[1];

Returns an array ref of array refs, one for each row returned.

array_of_hash_rows

hash_of_hash_rows

count

my $enabled_users_count = $meld->count(
    'users',        # table name
    { status => 1}, # where clause
);

column

select_sth

my $users_sth;
foreach my $status (0, 1) {
    $users_sth ||= $meld->select_sth(
        'users',
        ['user_name', 'user_id'],
        {status => $status},
    );

    $users_sth->execute(
        $meld->bind_values( {status => $status} ),
    );
}

insert_sth

delete_sth

bind_values

AUTHOR

Aran Clary Deltac <bluefeet@gmail.com>

LICENSE

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.