From c2f8b442ee121f45f7513c4b8e1d6d52628ad2fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Feb 2013 18:21:32 +0200 Subject: Add schema_catalog::exists() function --- doc/manual.xhtml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'doc') 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) }; } @@ -2866,9 +2872,11 @@ namespace odb custom schema names and then use these names as a second argument to create_schema(). If the schema is not found, create_schema() throws the - odb::unknown_schema exception. The - create_schema() function should be called within - a transaction.

+ odb::unknown_schema exception. You can use the + exists() function to check whether a schema for the + specified database and with the specified name exists in the + catalog. Note also that the create_schema() function + should be called within a transaction.

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 -- cgit v1.1