Filechain and Blockchain regular methods have different signatures
Modules Pheix::Model::Database::Filechain and Pheix::Model::Database::Blockchian have the common method, such as
table_createrow_insertrow_set- etc...
We have them, to create the abstract universal layer at Pheix::Model::Database::Access.
But the signatures of these methods are different:
For example:
Pheix::Model::Database::Filechain
method row_get(Str :$t, Hash :$clause!, Bool :$comp) returns List { ... }
Pheix::Model::Database::Blockchain
method row_get(Str :$t, Int :$id!, Bool :$comp) returns Hash { ... }
So, the method get() from Pheix::Model::Database::Access will crash at $!dbswitch = 1 (blockchain case), cause:
method get( Hash $arg_ref ) returns List {
# %arg = k1 => v1, k2 => v2, ...;
# sql: SELECT * FROM table WHERE k1=v1 AND k2=v2,...;
my @rows;
given $!dbswitch {
default {
my $_obj = self.get_chain_obj;
if $_obj {
@rows = $_obj.row_get(:clause($clause));
}
}
}
@rows;
}
Edited by Konstantin Narkhov