Teng::Row - Teng's Row class
create new Teng::Row's instance
my $val = $row->get($column_name); # alias my $val = $row->$column_name;
get a column value from a row object.
Note: This method inflates values.
$row->set($col => $val);
set column data.
Note: This method deflates values.
my $val = $row->get_column($column_name);
get a column value from a row object.
Note: This method does not inflate values.
my $data = $row->get_columns;
Does get_column
, for all column values.
Note: This method does not inflate values.
$row->set_columns({$col => $val});
set columns data.
Note: This method does not deflate values.
$row->set_column($col => $val); # alias $row->$col($val);
set column data.
Note: This method does not deflate values.
returns those that have been changed.
returns true, If the row object have a updated column.
update is executed for instance record.
It works by schema in which primary key exists.
$row->update({name => 'tokuhirom'}); # or $row->set({name => 'tokuhirom'}); $row->update;
If $arg
HashRef is supplied, each pairs are passed to set()
method before update.
delete is executed for instance record.
It works by schema in which primary key exists.
refetch record from database. get new row object.
get Teng object.
$row->handle->single('table', {id => 1});
Teng::Row has methods that have name from column name. For example, if a table has column named 'foo', Teng::Row instance of it has method 'foo'.
This method has different behave for setter or getter as following:
# (getter) is alias of $row->get('foo') # so this method returns inflated value. my $inflated_value = $row->foo; # (setter) is alias of $row->set_column('foo', $raw_value) # so this method does not deflate the value. This only accepts raw value but inflated object. $row->foo($raw_value);
This behave is from historical reason. You should use column name methods with great caution, if you want to use this.