KDbAlterTableHandler::InsertFieldAction
#include <KDbAlter.h>

Public Member Functions | |
InsertFieldAction () | |
InsertFieldAction (const InsertFieldAction &action) | |
InsertFieldAction (int fieldIndex, KDbField *newField, int uid) | |
QString | debugString (const DebugOptions &debugOptions=DebugOptions()) override |
const KDbField * | field () const |
int | index () const |
void | setField (KDbField *field) |
void | setIndex (int index) |
void | simplifyActions (ActionDictDict *fieldActions) override |
tristate | updateTableSchema (KDbTableSchema *table, KDbField *field, QHash< QString, QString > *fieldHash) override |
![]() | |
FieldActionBase (const QString &fieldName, int uid) | |
QString | fieldName () const |
void | setFieldName (const QString &fieldName) |
int | uid () const |
![]() | |
void | debug (const DebugOptions &debugOptions=DebugOptions()) |
bool | isNull () const |
ChangeFieldPropertyAction & | toChangeFieldPropertyAction () |
InsertFieldAction & | toInsertFieldAction () |
MoveFieldPositionAction & | toMoveFieldPositionAction () |
RemoveFieldAction & | toRemoveFieldAction () |
Protected Member Functions | |
InsertFieldAction (bool null) | |
tristate | execute (KDbConnection *conn, KDbTableSchema *table) override |
void | updateAlteringRequirements () override |
![]() | |
FieldActionBase (bool null) | |
![]() | |
ActionBase (bool null) | |
int | alteringRequirements () const |
void | setAlteringRequirements (int alteringRequirements) |
virtual bool | shouldBeRemoved (ActionDictDict *fieldActions) |
Protected Attributes | |
int | m_index |
![]() | |
int | m_fieldUID |
Detailed Description
Defines an action for inserting a single table field.
Definition at line 360 of file KDbAlter.h.
Constructor & Destructor Documentation
◆ InsertFieldAction() [1/3]
KDbAlterTableHandler::InsertFieldAction::InsertFieldAction | ( | const InsertFieldAction & | action | ) |
copy ctor
Definition at line 559 of file KDbAlter.cpp.
◆ InsertFieldAction() [2/3]
KDbAlterTableHandler::InsertFieldAction::InsertFieldAction | ( | ) |
Creates null action.
Definition at line 566 of file KDbAlter.cpp.
◆ InsertFieldAction() [3/3]
|
explicitprotected |
, used for constructing null action
Definition at line 571 of file KDbAlter.cpp.
Member Function Documentation
◆ execute()
|
overrideprotectedvirtual |
Performs physical execution of this action.
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 703 of file KDbAlter.cpp.
◆ simplifyActions()
|
overridevirtual |
Legend: A,B==fields, P==property, [....]==action, (..,..,..) group of actions, <...> internal operation.
Case 1: there are "change property" actions after the Insert action. -> change the properties in the Insert action itself and remove the "change property" actions. Examples: [Insert A] && [rename A to B] => [Insert B] [Insert A] && [change property P in field A] => [Insert A with P altered] Comment: we need to do this reduction because otherwise we'd need to do psyhical altering right after [Insert A] if [rename A to B] follows.
- Todo:
- not checked
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 624 of file KDbAlter.cpp.
◆ updateAlteringRequirements()
|
overrideprotectedvirtual |
- Todo:
- sometimes add DataConversionRequired (e.g. when relationships require removing orphaned records) ?
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 591 of file KDbAlter.cpp.
◆ updateTableSchema()
|
overridevirtual |
- Todo:
- add it only when there should be fixed value (e.g. default) set for this new field...
Reimplemented from KDbAlterTableHandler::ActionBase.
Definition at line 692 of file KDbAlter.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Sep 27 2023 04:08:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.