|
| SysTablesUnit (const std::string &tableName, const std::string &tableId, const std::string &tableType="auth") |
|
| ~SysTablesUnit () override=default |
|
bool | setupRoutes () override |
|
void | fetchRecord (const Request &req, Response &res, Context &ctx) override |
|
void | fetchRecords (const Request &req, Response &res, Context &ctx) override |
|
void | createRecord (const Request &req, Response &res, const ContentReader &reader, Context &ctx) override |
|
void | updateRecord (const Request &req, Response &res, const ContentReader &reader, Context &ctx) override |
|
void | deleteRecord (const Request &req, Response &res, Context &ctx) override |
|
void | authWithEmailAndPassword (const Request &req, Response &res, Context &ctx) override |
|
bool | hasAccess (const Request &req, Response &res, Context &ctx) override |
|
json | create (const json &entity, const json &opts) override |
|
std::optional< json > | read (const std::string &id, const json &opts) override |
|
json | update (const std::string &id, const json &entity, const json &opts) override |
|
bool | remove (const std::string &id, const json &opts) override |
|
std::vector< json > | list (const json &opts) override |
|
| TableUnit (std::string tableName, std::string tableId, std::string tableType="base") |
|
| TableUnit (const json &schema=json::object()) |
|
virtual | ~TableUnit () override=default |
|
virtual void | resetPassword (const Request &req, Response &res, Context &ctx) |
|
void | setRouteDisplayName (const std::string &routeName) |
|
std::string | tableName () |
|
void | setTableName (const std::string &name) |
|
std::string | tableId () |
|
void | setTableId (const std::string &id) |
|
std::string | tableType () |
|
void | fromJson (const json &j) |
|
std::vector< json > | fields () const |
|
void | setFields (const std::vector< json > &fields) |
|
bool | isSystem () const |
|
void | setIsSystemTable (bool isSystemTable) |
|
Rule | listRule () |
|
void | setListRule (const Rule &rule) |
|
Rule | getRule () |
|
void | setGetRule (const Rule &rule) |
|
Rule | addRule () |
|
void | setAddRule (const Rule &rule) |
|
Rule | updateRule () |
|
void | setUpdateRule (const Rule &rule) |
|
Rule | deleteRule () |
|
void | setDeleteRule (const Rule &rule) |
|
json | create (const json &entity, const json &opts) override |
|
std::optional< json > | read (const std::string &id, const json &opts) override |
|
json | update (const std::string &id, const json &entity, const json &opts) override |
|
bool | remove (const std::string &id, const json &opts) override |
|
std::vector< json > | list (const json &opts) override |
|
json | list_records (const json &opts) |
|
std::string | getColTypeFromName (const std::string &col, const std::vector< json > &fields) const |
|
json | parseDbRowToJson (const soci::row &row) const |
|
json | parseDbRowToJson (const soci::row &row, const std::vector< json > &ref_fields) const |
|
json | getValueFromType (const std::string &type, const std::string &value) |
|
std::optional< json > | bindEntityToSociValue (soci::values &vals, const json &entity) const |
| Helper function to bind json values to soci::values for use in soci::use(...) when executing SQL statements.
|
|
std::optional< std::string > | validateRequestBody (const json &body) const |
|
std::optional< std::string > | validateUpdateRequestBody (const json &body) const |
|
bool | recordExists (const std::string &id) const |
|
std::optional< json > | findFieldByKey (const std::string &key) const |
|
json | checkValueInColumns (const std::string &value, const std::vector< std::string > &columns) const |
|
virtual | ~CrudInterface ()=default |
|
|
static bool | getAuthToken (const Request &req, Response &res, Context &ctx) |
|
static std::string | generateTableId (const std::string &tablename) |
|
static std::pair< bool, std::string > | minimumConstraintCheck (const json &field, const json &entity) |
|
static std::pair< bool, std::string > | maximumConstraintCheck (const json &field, const json &entity) |
|
static std::pair< bool, std::string > | requiredConstraintCheck (const json &field, const json &entity) |
|
static std::pair< bool, std::string > | validatorConstraintCheck (const json &field, const json &entity) |
|
static std::pair< bool, std::string > | viewTypeSQLCheck (const json &entity) |
|
static std::optional< json > | validateTableSchema (const json &entity) |
|
const std::string | __class_name__ = "TableUnit" |
|
std::string | m_tableName |
|
std::string | m_tableId |
|
std::string | m_tableType |
|
std::string | m_routeName |
|
bool | m_isSystem = false |
|
std::vector< json > | m_fields = {} |
|
Rule | m_listRule |
|
Rule | m_getRule |
|
Rule | m_addRule |
|
Rule | m_updateRule |
|
Rule | m_deleteRule |
|
Class to manage tables metadata like access rules, name, etc.
Allows for table tracking, provisioning of API access and managing cache for created tables for centralized admin management.