From da00d54b5704d33057a1569366d0e497606dc1a0 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 --- odb/schema-catalog.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'odb/schema-catalog.cxx') diff --git a/odb/schema-catalog.cxx b/odb/schema-catalog.cxx index cd1ded4..f834b1d 100644 --- a/odb/schema-catalog.cxx +++ b/odb/schema-catalog.cxx @@ -27,6 +27,13 @@ namespace odb schema_catalog_impl* schema_catalog_init::catalog = 0; size_t schema_catalog_init::count = 0; + bool schema_catalog:: + exists (database_id id, const std::string& name) + { + const schema_catalog_impl& c (*schema_catalog_init::catalog); + return c.find (key (id, name)) != c.end (); + } + void schema_catalog:: create_schema (database& db, const string& name) { -- cgit v1.1