v0.9.2 Summary Chapter 3: Database objects 3. Introduction 3.29. Generic SQL objects

3.29. Generic SQL objects

In order to workaround the lack of some database objects pgModeler implements the generic SQL objects which are nothing more than custom commands wrapped as a database model object. The user can virtually use any valid command as a generic SQL object thus when the model is exported to a script file or to a database server the internal code of all generic SQL objects in the model will be included in the resulting SQL code of the whole database model.

Generic SQL objects are more flexible than the custom SQL commands because they are completely independent and don't need to be attached to any other object in database model to have the code included in the final result. In the image below we are creating a foreign data wrapper by using a generic SQL object. Note that FDWs aren't not supported by pgModeler yet but you still have a way to register objects of this kindt on your model.

It's important to note that generic SQL objects are used only in the export process and can't be reverse engineered moreover they are completely ignored in the database diff operation. In the example below the FDW once created on the database server can't be imported or compared because pgModeler can't handle that kind of object.

Attribute Description
SQL code A valid set of SQL commands to be used as a single database model object.

Jan 3, 2020 at 12:33