mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 19:21:01 +00:00
schema_tables: Add opaque context object
To allow carrying extensions and potentially more
This commit is contained in:
@@ -83,6 +83,23 @@ using namespace std::chrono_literals;
|
||||
|
||||
/** system.schema_* tables used to store keyspace/table/type attributes prior to C* 3.0 */
|
||||
namespace db {
|
||||
|
||||
schema_ctxt::schema_ctxt(const db::config& cfg)
|
||||
: _extensions(cfg.extensions())
|
||||
{}
|
||||
|
||||
schema_ctxt::schema_ctxt(const database& db)
|
||||
: schema_ctxt(db.get_config())
|
||||
{}
|
||||
|
||||
schema_ctxt::schema_ctxt(distributed<database>& db)
|
||||
: schema_ctxt(db.local())
|
||||
{}
|
||||
|
||||
schema_ctxt::schema_ctxt(distributed<service::storage_proxy>& proxy)
|
||||
: schema_ctxt(proxy.local().get_db())
|
||||
{}
|
||||
|
||||
namespace schema_tables {
|
||||
|
||||
logging::logger slogger("schema_tables");
|
||||
|
||||
@@ -54,6 +54,24 @@ class result_set;
|
||||
}
|
||||
|
||||
namespace db {
|
||||
|
||||
class extensions;
|
||||
class config;
|
||||
|
||||
class schema_ctxt {
|
||||
public:
|
||||
schema_ctxt(const config&);
|
||||
schema_ctxt(const database&);
|
||||
schema_ctxt(distributed<database>&);
|
||||
schema_ctxt(distributed<service::storage_proxy>&);
|
||||
|
||||
const db::extensions& extensions() const {
|
||||
return _extensions;
|
||||
}
|
||||
private:
|
||||
const db::extensions& _extensions;
|
||||
};
|
||||
|
||||
namespace schema_tables {
|
||||
|
||||
using schema_result = std::map<sstring, lw_shared_ptr<query::result_set>>;
|
||||
|
||||
Reference in New Issue
Block a user