Lightweight 0.20260303.0
Loading...
Searching...
No Matches
Lightweight::SqlSchema::EventHandler Class Referenceabstract

Callback interface for handling events while reading a database schema. More...

#include <SqlSchema.hpp>

Public Member Functions

 EventHandler ()=default
 Default constructor.
 
 EventHandler (EventHandler &&)=default
 Default move constructor.
 
 EventHandler (EventHandler const &)=default
 Default copy constructor.
 
EventHandleroperator= (EventHandler &&)=default
 Default move assignment operator.
 
EventHandleroperator= (EventHandler const &)=default
 Default copy assignment operator.
 
virtual void OnTables (std::vector< std::string > const &tables)=0
 Called when the names of all tables are read.
 
virtual bool OnTable (std::string_view schema, std::string_view table)=0
 
virtual void OnPrimaryKeys (std::string_view table, std::vector< std::string > const &columns)=0
 Called when the primary keys of a table are read.
 
virtual void OnForeignKey (ForeignKeyConstraint const &foreignKeyConstraint)=0
 Called when a foreign key constraint is read.
 
virtual void OnColumn (Column const &column)=0
 Called for each column in a table.
 
virtual void OnExternalForeignKey (ForeignKeyConstraint const &foreignKeyConstraint)=0
 Called when an external foreign key referencing this table is read.
 
virtual void OnIndexes (std::vector< IndexDefinition > const &indexes)=0
 Called when the indexes of a table are read.
 
virtual void OnTableEnd ()=0
 Called when a table's schema reading is complete.
 

Detailed Description

Callback interface for handling events while reading a database schema.

Definition at line 148 of file SqlSchema.hpp.

Member Function Documentation

◆ OnTable()

virtual bool Lightweight::SqlSchema::EventHandler::OnTable ( std::string_view  schema,
std::string_view  table 
)
pure virtual

Called for each table. Returns true to process this table, false to skip it.

Parameters
schemaThe schema the table belongs to.
tableThe name of the table.

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