aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--doc/manual.xhtml14
2 files changed, 14 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index f8ae6dc..61d30da 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,9 @@ Version 2.2.0
released when commit()/rollback() is called rather than when the
transaction instance goes out of scope.
+ * New odb::schema_catalog function, exists(), allows checking whether a
+ schema with the specified name exists in the catalog.
+
* Support for SQL Server ROWVERSION-based optimistic concurrency. For more
information, refer to Section 19.1.1, "ROWVERSION Support" in the ODB
manual.
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index c620388..8fa672d 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -2852,6 +2852,12 @@ namespace odb
public:
static void
create_schema (database&, const std::string& name = "");
+
+ static bool
+ exists (database_id, const std::string& name);
+
+ static bool
+ exists (const database&, const std::string& name)
};
}
</pre>
@@ -2866,9 +2872,11 @@ namespace odb
custom schema names and then use these names as a second argument
to <code>create_schema()</code>. If the schema is not found,
<code>create_schema()</code> throws the
- <code>odb::unknown_schema</code> exception. The
- <code>create_schema()</code> function should be called within
- a transaction.</p>
+ <code>odb::unknown_schema</code> exception. You can use the
+ <code>exists()</code> function to check whether a schema for the
+ specified database and with the specified name exists in the
+ catalog. Note also that the <code>create_schema()</code> function
+ should be called within a transaction.</p>
<p>Finally, we can also use a custom database schema with ODB. This approach
can work similarly to the standalone SQL file described above except that