aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite')
-rw-r--r--odb/sqlite/connection.hxx6
-rw-r--r--odb/sqlite/connection.ixx11
-rw-r--r--odb/sqlite/database.hxx18
-rw-r--r--odb/sqlite/database.ixx51
4 files changed, 69 insertions, 17 deletions
diff --git a/odb/sqlite/connection.hxx b/odb/sqlite/connection.hxx
index 6dd8292..43c540c 100644
--- a/odb/sqlite/connection.hxx
+++ b/odb/sqlite/connection.hxx
@@ -81,7 +81,11 @@ namespace odb
template <typename T>
prepared_query<T>
- prepare_query (const char* name, const query<T>&);
+ prepare_query (const char* name, const sqlite::query_base&);
+
+ template <typename T>
+ prepared_query<T>
+ prepare_query (const char* name, const odb::query_base&);
// SQL statement tracing.
//
diff --git a/odb/sqlite/connection.ixx b/odb/sqlite/connection.ixx
index 9117bd4..f1f4183 100644
--- a/odb/sqlite/connection.ixx
+++ b/odb/sqlite/connection.ixx
@@ -22,9 +22,18 @@ namespace odb
template <typename T>
inline prepared_query<T> connection::
- prepare_query (const char* n, const query<T>& q)
+ prepare_query (const char* n, const sqlite::query_base& q)
{
return query_<T, id_sqlite>::call (*this, n, q);
}
+
+ template <typename T>
+ inline prepared_query<T> connection::
+ prepare_query (const char* n, const odb::query_base& q)
+ {
+ // Translate to native query.
+ //
+ return prepare_query<T> (n, sqlite::query_base (q));
+ }
}
}
diff --git a/odb/sqlite/database.hxx b/odb/sqlite/database.hxx
index 318cb57..e7650f7 100644
--- a/odb/sqlite/database.hxx
+++ b/odb/sqlite/database.hxx
@@ -268,7 +268,11 @@ namespace odb
template <typename T>
unsigned long long
- erase_query (const sqlite::query<T>&);
+ erase_query (const sqlite::query_base&);
+
+ template <typename T>
+ unsigned long long
+ erase_query (const odb::query_base&);
// Query API.
//
@@ -286,7 +290,11 @@ namespace odb
template <typename T>
result<T>
- query (const sqlite::query<T>&);
+ query (const sqlite::query_base&);
+
+ template <typename T>
+ result<T>
+ query (const odb::query_base&);
// Query preparation.
//
@@ -300,7 +308,11 @@ namespace odb
template <typename T>
prepared_query<T>
- prepare_query (const char* name, const sqlite::query<T>&);
+ prepare_query (const char* name, const sqlite::query_base&);
+
+ template <typename T>
+ prepared_query<T>
+ prepare_query (const char* name, const odb::query_base&);
// Transactions.
//
diff --git a/odb/sqlite/database.ixx b/odb/sqlite/database.ixx
index 2b57912..e20bbec 100644
--- a/odb/sqlite/database.ixx
+++ b/odb/sqlite/database.ixx
@@ -335,7 +335,7 @@ namespace odb
{
// T is always object_type.
//
- return erase_query<T> (sqlite::query<T> ());
+ return erase_query<T> (sqlite::query_base ());
}
template <typename T>
@@ -344,7 +344,7 @@ namespace odb
{
// T is always object_type.
//
- return erase_query<T> (sqlite::query<T> (q));
+ return erase_query<T> (sqlite::query_base (q));
}
template <typename T>
@@ -353,12 +353,12 @@ namespace odb
{
// T is always object_type.
//
- return erase_query<T> (sqlite::query<T> (q));
+ return erase_query<T> (sqlite::query_base (q));
}
template <typename T>
inline unsigned long long database::
- erase_query (const sqlite::query<T>& q)
+ erase_query (const sqlite::query_base& q)
{
// T is always object_type.
//
@@ -366,29 +366,38 @@ namespace odb
}
template <typename T>
+ inline unsigned long long database::
+ erase_query (const odb::query_base& q)
+ {
+ // Translate to native query.
+ //
+ return erase_query<T> (sqlite::query_base (q));
+ }
+
+ template <typename T>
inline result<T> database::
query ()
{
- return query<T> (sqlite::query<T> ());
+ return query<T> (sqlite::query_base ());
}
template <typename T>
inline result<T> database::
query (const char* q)
{
- return query<T> (sqlite::query<T> (q));
+ return query<T> (sqlite::query_base (q));
}
template <typename T>
inline result<T> database::
query (const std::string& q)
{
- return query<T> (sqlite::query<T> (q));
+ return query<T> (sqlite::query_base (q));
}
template <typename T>
inline result<T> database::
- query (const sqlite::query<T>& q)
+ query (const sqlite::query_base& q)
{
// T is always object_type. We also don't need to check for transaction
// here; object_traits::query () does this.
@@ -397,27 +406,45 @@ namespace odb
}
template <typename T>
+ inline result<T> database::
+ query (const odb::query_base& q)
+ {
+ // Translate to native query.
+ //
+ return query<T> (sqlite::query_base (q));
+ }
+
+ template <typename T>
inline prepared_query<T> database::
prepare_query (const char* n, const char* q)
{
- return prepare_query<T> (n, sqlite::query<T> (q));
+ return prepare_query<T> (n, sqlite::query_base (q));
}
template <typename T>
inline prepared_query<T> database::
prepare_query (const char* n, const std::string& q)
{
- return prepare_query<T> (n, sqlite::query<T> (q));
+ return prepare_query<T> (n, sqlite::query_base (q));
}
template <typename T>
inline prepared_query<T> database::
- prepare_query (const char* n, const sqlite::query<T>& q)
+ prepare_query (const char* n, const sqlite::query_base& q)
{
// Throws if not in transaction.
//
sqlite::connection& c (transaction::current ().connection ());
- return c.prepare_query (n, q);
+ return c.prepare_query<T> (n, q);
+ }
+
+ template <typename T>
+ inline prepared_query<T> database::
+ prepare_query (const char* n, const odb::query_base& q)
+ {
+ // Translate to native query.
+ //
+ return prepare_query<T> (n, sqlite::query_base (q));
}
}
}