aboutsummaryrefslogtreecommitdiff
path: root/odb/object-result.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-11-02 09:35:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-11-02 09:35:02 +0200
commitb9eff63278d5bb8d59a40f7b837cff4843eaae05 (patch)
tree279d329136a2f9d2afcf9d645e0e7e98f6995ded /odb/object-result.hxx
parent37e1d992d234363ff9aef45555678b5ee7203a99 (diff)
Optimize load_id(), load() sequence for SQLite and PostgreSQL
In these databases both of these functions load the data into the object image. If there is no chance of image overwrite between these calls, then we don't need to load the image the second time.
Diffstat (limited to 'odb/object-result.hxx')
-rw-r--r--odb/object-result.hxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/odb/object-result.hxx b/odb/object-result.hxx
index e4d28ee..8b0b502 100644
--- a/odb/object-result.hxx
+++ b/odb/object-result.hxx
@@ -111,8 +111,14 @@ namespace odb
}
protected:
+ // The fetch argument is a hint to the implementation. If it is
+ // false then it means load_id() was already called (and presumably
+ // fetched the data into the object image) and the object image
+ // is still valid (so the implementation doesn't need to fetch
+ // the data again).
+ //
virtual void
- load (object_type&) = 0;
+ load (object_type&, bool fetch = true) = 0;
virtual id_type
load_id () = 0;