add possibility of calculating how many rows there were before LIMIT was applied
The Finder has get_rows_counter() method which returns how many rows there were before LIMIT clause was applied. The select(...) method should be called with Select::with_rows_counter flag in such a case. while here: - change the semantic of Finder, now the select(...) method takes a morm::Select flags, and we have such flags: - Select::no_auto_generated_columns - do not generate columns from models - with_rows_counter - add an additional column for the rows counter - remove Finder::prepare_to_select() - now use select(...) with no_auto_generated_columns flag
This commit is contained in:
@@ -126,6 +126,7 @@ void BaseExpression::generate_from_model(Model & model)
|
||||
before_generate_from_model();
|
||||
dump_additional_info(model);
|
||||
model.fields();
|
||||
add_additional_columns(model);
|
||||
after_generate_from_model();
|
||||
}
|
||||
}
|
||||
@@ -141,6 +142,11 @@ void BaseExpression::dump_additional_info(Model & model)
|
||||
}
|
||||
|
||||
|
||||
void BaseExpression::add_additional_columns(Model & model)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void BaseExpression::before_generate_from_model()
|
||||
{
|
||||
is_first_field = true;
|
||||
|
Reference in New Issue
Block a user