Fledge
An open source edge computing platform for industrial users
SchemaManager Class Reference

The singleton SchemaManager class used to interact with the extension schemas created by various extension services. More...

#include <schema.h>

Collaboration diagram for SchemaManager:

Public Member Functions

void load (sqlite3 *db)
 Load the existing Schema from the table of supported schemas. More...
 
bool create (sqlite3 *db, const std::string &definition)
 Create a schema. More...
 
bool exists (sqlite3 *db, const std::string &schema)
 Check if a named schema exists, loading the schemas if need be. More...
 

Static Public Member Functions

static SchemaManagergetInstance ()
 Fetch the singleton instance of the SchemaManager. More...
 

Static Public Attributes

static SchemaManagerinstance = 0
 

Detailed Description

The singleton SchemaManager class used to interact with the extension schemas created by various extension services.

Member Function Documentation

◆ create()

bool SchemaManager::create ( sqlite3 *  db,
const std::string &  definition 
)

Create a schema.

This may create a completely new schema if it does not already exist, update an existing schema if the version is different from the one that already exists or no nothing if the schema exists and the version of the schema is the same.

Parameters
dbA database connection to use for sqlite3 interactions
definitionThe schema definition
Returns
bool Returns true if the schema was created, updated or no action is required

◆ exists()

bool SchemaManager::exists ( sqlite3 *  db,
const std::string &  schema 
)

Check if a named schema exists, loading the schemas if need be.

As a side effect the schema will be attached to the database connection.

Parameters
schemaThe schema to check the existance of
Returns
bool True if the schema exists

◆ getInstance()

SchemaManager * SchemaManager::getInstance ( )
static

Fetch the singleton instance of the SchemaManager.

Returns
SchemaManager* The singleton SchemaManager instance

◆ load()

void SchemaManager::load ( sqlite3 *  db)

Load the existing Schema from the table of supported schemas.

Parameters
dbThe database connection to use to load the schema information

The documentation for this class was generated from the following files: