diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..122aa84e74 --- /dev/null +++ b/.clang-format @@ -0,0 +1,74 @@ +--- +# Configuração do clang-format para pgmodeler +# Baseado no estilo LLVM com customizações para o projeto + +# Estilo base +BasedOnStyle: LLVM + +# Indentação e tabs +IndentWidth: 4 +UseTab: Always +TabWidth: 4 + +# Alinhamento de parâmetros +AlignAfterOpenBracket: DontAlign +BinPackParameters: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowAllArgumentsOnNextLine: true + +# Estilo de chaves (Allman - chaves em nova linha) +BreakBeforeBraces: Allman + +# Limite de colunas +ColumnLimit: 0 + +# Alinhamentos +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignTrailingComments: true + +# Funções e statements curtos +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortBlocksOnASingleLine: Empty + +# Quebras de linha +BreakBeforeBinaryOperators: NonAssignment +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon + +# Espaçamento +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: Never +SpaceInEmptyParentheses: false + +# Ponteiros e referências +PointerAlignment: Right +ReferenceAlignment: Right + +# Includes +SortIncludes: true +IncludeBlocks: Preserve + +# Comentários +ReflowComments: true + +# Macros e defines +IndentPPDirectives: None + +# Namespace +NamespaceIndentation: None + +# Access modifiers (public, private, protected) +AccessModifierOffset: -4 + +# Continuação de linhas +ContinuationIndentWidth: 16 +IndentWrappedFunctionNames: false +AlignOperands: DontAlign + +# Parâmetros específicos para C++ +Standard: c++17 \ No newline at end of file diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..8c8eebc617 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,81 @@ +--- +# clang-tidy configuration for pgModeler +# This file is read by clang-tidy during compilation (CMake build) +# The .clangd file is read by clangd LSP for editor analysis + +# Checks to enable/disable +# Use 'category-*' to enable all checks in a category +# Use '-check-name' to disable specific checks +Checks: > + -*, + -misc-*, + -misc-header-include-cycle, + -misc-include-cleaner, + clang-*, + -clang-analyzer-optin.cplusplus.VirtualCall, + -clang-analyzer-cplusplus.NewDeleteLeaks, + -clang-analyzer-optin.core.EnumCastOutOfRange, + -clang-analyzer-core.CallAndMessage, + cplusplus.*, + bugprone.*, + misc-definitions-in-headers, + misc-misleading-bidirectional, + misc-misleading-identifier, + misc-misplaced-const, + misc-new-delete-overloads, + misc-non-copyable-objects, + misc-override-with-different-visibility, + misc-redundant-expression, + misc-static-assert, + misc-throw-by-value-catch-by-reference, + # misc-unconventional-assign-operator, + misc-uniqueptr-reset-release, + misc-unused-alias-decls, + misc-unused-parameters, + misc-unused-using-decls, + misc-use-anonymous-namespace, + misc-use-internal-linkage, + modernize-loop-convert, + modernize-return-braced-init-list, + modernize-type-traits, + modernize-use-bool-literals, + modernize-use-equals-default, + modernize-use-equals-delete, + # modernize-use-nullptr, + modernize-use-override, + modernize-use-using, + readability-delete-null-pointer, + readability-duplicate-include, + readability-else-after-return, + readability-enum-initial-value, + readability-inconsistent-declaration-parameter-name, + # readability-magic-numbers, + readability-math-missing-parentheses, + # readability-misleading-indentation, + readability-misplaced-array-index, + readability-redundant-casting, + readability-redundant-control-flow, + readability-redundant-declaration, + readability-redundant-function-ptr-dereference, + readability-redundant-inline-specifier, + readability-redundant-member-init, + readability-redundant-parentheses, + readability-redundant-preprocessor, + readability-reference-to-constructed-temporary, + # readability-static-accessed-through-instance, + readability-static-definition-in-anonymous-namespace, + readability-use-concise-preprocessor-directives, + +# Treat warnings as errors (empty = no errors) +WarningsAsErrors: '' + +# Regex to filter which headers to analyze +# Only analyze headers from pgModeler project directories +# This regex matches absolute paths containing /pgmodeler/ followed by apps, libs, or priv-plugins +HeaderFilterRegex: '.*/pgmodeler/(apps|libs|plugins|priv-plugins)/.*\.(h|hpp|cpp)$' + +# Enable all checks by default in system headers (off for performance) +SystemHeaders: false + +# Format style for fix suggestions (follow .clang-format if available) +FormatStyle: file diff --git a/.clangd b/.clangd new file mode 100644 index 0000000000..e918d7ff71 --- /dev/null +++ b/.clangd @@ -0,0 +1,38 @@ +CompileFlags: + # Use compile_commands.json from cmake-build directory + CompilationDatabase: cmake-build + +Diagnostics: + # clangd will read clang-tidy configuration from .clang-tidy file + # This ensures consistency between editor analysis and build-time analysis + ClangTidy: + # No checks specified here - they are all defined in .clang-tidy + # This allows a single source of truth for all clang-tidy configuration + Add: [] + Remove: [] + + # Suppress warnings from system headers and dependencies + UnusedIncludes: Strict + + # clangd respects the HeaderFilterRegex from .clang-tidy + # No additional suppression needed here + Suppress: [] + +InlayHints: + # Show inline hints for better code understanding + Enabled: Yes + ParameterNames: Yes + DeducedTypes: Yes + Designators: Yes + +Hover: + ShowAKA: Yes + +Completion: + AllScopes: Yes + +Index: + # Background indexing mode: Build (index as you build) or Skip (no background indexing) + Background: Build + + StandardLibrary: Yes diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..c92d4c8bdb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +--- +github: [pgmodeler] +custom: ["https://pgmodeler.io/#donationForm"] diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 0000000000..4d054a0f2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,38 @@ +--- +name: Report a bug +about: Instructions on how to report pgModeler bugs. Before report any bug please + check if someone already has submited issues similiar to yours. Duplicated issues + will be ignored. + +--- + +**Bug description** +_A clear and concise description of what the bug is._ + +**How to reproduce** +_Please, if the bug can be reproduceable describe the steps in full details. If possible provide a sample model and/or a SQL dump for test purposes._ + +**Expected behavior** +_A clear and concise description of what you expected to happen._ + +**Screenshots** +_If applicable, add screenshots to help explain your problem._ + +**Info about your desktop** + - OS: + - Version: + - Window manager: + - pgModeler version: + - Qt version: + +**Stacktrace / Debug info** +_If pgModeler crashed after the bug raised attach the stacktrace below_ + +``` + + Put the stacktrace here! + +``` + +**Additional info** +_Add any other information that you may find useful to help in the problem solving._ diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md new file mode 100644 index 0000000000..219c04f5c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Custom.md @@ -0,0 +1,8 @@ +--- +name: General discussion +about: For any discussion not related to bugs or feature requests please use this + one. + +--- + + diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 0000000000..f3ad5eb15b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,14 @@ +--- +name: Feature request / improvement +about: Give your suggestions for improvements to this project. + +--- + +**Feature description** +_A clear and concise description of what the problem is._ + +**Sample image** +_If the feature requested is a visual improvement, please, attach some images to make it clear._ + +**Additional info** +_Add any other context or screenshots about the feature request here._ diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..484b2f2825 --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,449 @@ +# pgModeler Copilot Instructions + +This file contains guidelines for generating code consistent with pgModeler's codebase style and patterns. + +## Architecture and Structure + +### Directory Organization +- **libs/**: Contains main libraries organized by functionality + - `libcore/`: Business logic and data model + - `libgui/`: Graphical interface and widgets + - `libutils/`: Shared utilities + - `libcanvas/`: Graphical canvas and rendering + - `libconnector/`: Database connectivity + - `libparsers/`: SQL/XML parsers + - `libcli/`: Command line interface +- **apps/**: Executable applications +- **plugins/**: Plugins and extensions +- **assets/**: Resources (configurations, schemas, samples) + +### File Patterns +- Headers always with guards: `#ifndef HEADER_NAME_H` / `#define HEADER_NAME_H` / `#endif` +- Each class in its own file pair (.h/.cpp) +- Organized includes: system headers first, then Qt, then local +- Standard copyright header in all files + +## Formatting Style + +### Indentation and Spacing +- **USE TABS**, not spaces for indentation +- No spaces in templates: `std::vector` (not `std::vector`) +- Spaces around operators: `a = b + c;` +- No space between function name and parentheses: `functionName(args)` +- No space between control/loop instructions and parentheses: `if(condition)` `while(condition)` `for(...)` +- No space between cast and parentheses: `static_cast(value)` +- No space between unary operators and variable: `!flag`, `++index` +- No space between variable name and asterisk when dereferencing pointers: `*ptr` +- No space between variable name and ampersand when referencing: `&ref` +- Space after function return type or function arguments and asterisk/ampersand, asterisk joined at variable/func name: `Type *func`, `Type &func`, `func(Type *arg, Type &arg2)` +- No space between function name and angle brackets for templates: `func(arg)` +- No space between class name and angle brackets for templates: `Class obj;` +- No space between angle brackets in nested templates: `std::map>` +- No space between namespace and scope resolution operator: `Namespace::Class` +- No space between class name and scope resolution operator: `Class::method()` +- No space between function name and scope resolution operator: `func::method()` +- Space after commas: `func(arg1, arg2, arg3)` + +### Braces and Blocks +```cpp +// Classes and functions - opening on same line +class MyClass { +private: + int member; + +public: + void method() { + // body + } +}; + +// Control structures - opening on new line +if(condition) +{ + // code +} +else +{ + // code +} + +for(auto &item : container) +{ + // code +} +``` + +### Naming +- **Variables and methods**: `snake_case` + ```cpp + bool is_protected; + void setCodeInvalidated(bool value); + std::vector object_refs; + ``` + +- **Classes**: `PascalCase` + ```cpp + class BaseObject; + class DatabaseModel; + ``` + +- **Enums**: `PascalCase` with `enum class` + ```cpp + enum class ObjectType: unsigned { + Column, + Constraint, + Function + }; + ``` + +- **Constants**: `CamelCase` for `constexpr` and `UPPER_CASE` for constants defined with `#define` + ```cpp + static const QString EntityAmp("&"); + static constexpr double DefaultRadius = 9.0; + ``` + +- **Namespaces**: `PascalCase` + ```cpp + namespace UtilsNs { + // content + } + ``` + +## C++17 Patterns + +### Strongly Typed Enums +```cpp +// ALWAYS use enum class +enum class ConstraintType: unsigned { + PrimaryKey, + ForeignKey, + Check, + Unique, + Exclude +}; + +// Use enum_t() for conversion when needed +unsigned type_id = enum_t(ObjectType::Table); +``` + +### Templates and Type Traits +```cpp +// Use std::enable_if_t and std::is_base_of_v for constraints +template, bool> = true> +void configureWidget(Widget *widget); + +// Use if constexpr for conditional branching +template +void processWidget(Class *widget) { + if constexpr (std::is_base_of_v) { + // specific logic + } +} +``` + +### Auto and Type Deduction +```cpp +// Use auto for iterators and obvious types +auto itr = container.begin(); +auto end = container.end(); + +// Range-based for loops with auto& +for(auto &item : container) { + // process item +} +``` + +### Using Aliases +```cpp +// Prefer using over typedef +using attribs_map = std::map; +``` + +### Constexpr +```cpp +// Use constexpr for compile-time constants +static constexpr unsigned ObjectTypeCount = enum_t(ObjectType::BaseTable) + 1; +static constexpr double MinScaleFactor = 0.100000; +``` + +## Qt-Specific Patterns + +### Signals and Slots +```cpp +// Use new connect syntax +connect(sender, &SenderClass::s_signal, receiver, &ReceiverClass::slot); + +// For slots that can throw exceptions, use special macros +connect(sender, &SenderClass::s_signal, context, __slot(receiver, ReceiverClass::method)); +``` + +### Meta Types +```cpp +// Register enums as Qt MetaType when needed +Q_DECLARE_METATYPE(ObjectType) +``` + +### Qt Inheritance +```cpp +class MyWidget: public QDialog, public Ui::MyWidget { + Q_OBJECT + // implementation +}; +``` + +## Error Management and Debug + +### Exception Handling +```cpp +// Use standard macros for debug info +throw Exception(ErrorCode::SomeError, PGM_FUNC, PGM_FILE, PGM_LINE); + +// Re-throw preserving stack trace +catch(Exception &e) { + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); +} +``` + +### Parameter Validation +```cpp +void MyClass::setObject(BaseObject *obj) { + if(!obj) + throw Exception(ErrorCode::OprNotAllocatedObject, PGM_FUNC, PGM_FILE, PGM_LINE); + + // method logic +} +``` + +## Cache and Invalidation Patterns + +### Code Invalidation Pattern +```cpp +void MyClass::setSomeProperty(bool value) { + setCodeInvalidated(this->property != value); // Invalidate cache if value changed + this->property = value; +} +``` + +### Cached Attributes +```cpp +// Use arrays for multiple cache versions +QString cached_code[2]; // SQL and XML +QString cached_names[3]; // RawName, FmtName, Signature + +enum CachedNameId: unsigned { + RawName, + FmtName, + Signature +}; +``` + +## Data Structures + +### STL vs Qt Containers +```cpp +// Prefer STL containers for internal data +std::vector objects; +std::map attributes; + +// Qt containers when Qt integration is needed +QStringList items; +``` + +### Initialization +```cpp +// Use uniform member initialization +MyClass::MyClass() : + is_protected(false), + system_obj(false), + code_invalidated(true) { + // constructor code +} +``` + +## Documentation and Comments + +### Doxygen Headers +```cpp +/** +\ingroup libcore +\brief Implements operations to manipulate database tables. +\note Creation date: 17/09/2006 +*/ +``` + +### Inline Comments +```cpp +//! \brief Indicates if the object is protected +bool is_protected; + +/*! \brief This method performs specific operation + * Detailed description of what the method does */ +void specificOperation(); +``` + +### Multiline Comments +```cpp +/* This is a multiline comment + * explaining complex logic or decisions + * in the code. */ +``` + +## Build System (CMake) + +### Library Configuration +```cmake +pgm_add_library(mylib + src/file1.cpp src/file1.h + src/file2.cpp src/file2.h +) + +set(CMAKE_AUTOUIC OFF) +set(CMAKE_AUTOMOC ON) +``` + +### C++17 Standard +```cmake +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +``` + +## Anti-Patterns to Avoid + +### ❌ DON'T Do +```cpp +// Don't use assignement in conditionals +if((value = getValue()) > 0) // BAD +{ + +} + +value = getValue(); +if(value > 0) // GOOD +{ + // use value +} + +// Don't use single line ifs +if(condition) statement; // BAD + +if(condition) + statement; // GOOD + +// Don't use a single line between brackets in ifs and other structures +if(condition) +{ + statement; // BAD +} + +if(condition) + statement; // GOOD + +// Don't use #include for Qt classes, use instead +#include // BAD +#include // GOOD + +// Don't use typedef +typedef std::map AttribsMap; + +// Don't repeat unnecessary declarations +void func(); +void func(); // DUPLICATE + +// Don't use spaces for indentation +class MyClass { + int member; // Use TABS here +} + +// Don't use duplicated data type declarations +QColor bg_color; // BAD +QColor border_color; // BAD + +QColor bg_color, border_color; // GOOD + +// Avoid declarations of scope-only variables. Check if variable can be declared outside the scope or if it is already declared, before creating. +if(condition) +{ + int temp_var; // BAD + // use temp_var +} + +int temp_var; // GOOD + +if(condition) +{ + // use temp_var +} + +// Don't use C-Style casts use static_cast/dynamic_cast/reinterpret_cast instead +int value = (int)some_double; // BAD +int value = static_cast(some_double); // GOOD +``` + +### ✅ DO This +```cpp +// Use using +using AttribsMap = std::map; + +// Use enum class +enum class ObjectType: unsigned { Table, Column }; + +// Templates without extra spaces +std::vector objects; + +// One declaration per method +void func(); + +// Use tabs for indentation +class MyClass { + int member; // TAB here +} +``` + +## Specific Guidelines for Generation + +0. **When possible use modern C++17 code** +1. **Always check if a method/attribute already exists before creating** +2. **Maintain consistency with existing patterns in the class** +3. **Use the same prefixes/suffixes from related classes** +4. **Implement cache invalidation methods when appropriate** +5. **Follow logical order: private -> protected -> public** +6. **Include appropriate error handling with PGM_* macros** +7. **Use const-correctness where appropriate** +8. **Implement comparison operators when needed** + +## Complete Class Example + +```cpp +#ifndef MY_CLASS_H +#define MY_CLASS_H + +#include "baseobject.h" +#include + +class __libcore MyClass: public BaseObject { + private: + bool some_flag; + std::vector objects; + + protected: + void validateObject(BaseObject *obj); + + public: + MyClass(); + virtual ~MyClass(); + + void setSomeFlag(bool flag); + bool isSomeFlagSet(); + + void addObject(BaseObject *obj); + void removeObject(unsigned idx); + BaseObject *getObject(unsigned idx); + unsigned getObjectCount(); + + virtual QString getSourceCode(SchemaParser::CodeType def_type) final; +}; + +#endif +``` + +Following these guidelines, the generated code will be consistent with the established style and patterns in pgModeler's codebase. \ No newline at end of file diff --git a/.github/workflows/linuxbuild.yml b/.github/workflows/linuxbuild.yml new file mode 100644 index 0000000000..4eedd1c636 --- /dev/null +++ b/.github/workflows/linuxbuild.yml @@ -0,0 +1,34 @@ +name: Linux build + +on: + push: + branches: [ main, develop, 1.* ] + tags: 1.* + + pull_request: + branches: [ main, develop, 1.* ] + +jobs: + build: + runs-on: ubuntu-22.04 + + strategy: + matrix: + qt: ['6.4.3', '6.5.3', '6.6.3', '6.7.3', '6.8.0'] + + steps: + - uses: actions/checkout@v2 + + - name: Installing Qt framework + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt }} + + - name: Running qmake + run: cd $GITHUB_WORKSPACE; qmake pgmodeler.pro -r PREFIX=$GITHUB_WORKSPACE/build CONFIG+=debug + + - name: Building pgModeler + run: make -j6 + + - name: Deploying pgModeler + run: make install diff --git a/.github/workflows/macosbuild.yml b/.github/workflows/macosbuild.yml new file mode 100644 index 0000000000..2b6efb50b3 --- /dev/null +++ b/.github/workflows/macosbuild.yml @@ -0,0 +1,39 @@ +name: macOs build + +on: + push: + branches: [ main, develop, 1.* ] + tags: 1.* + + pull_request: + branches: [ main, develop, 1.* ] + +jobs: + build: + runs-on: macos-latest + + strategy: + matrix: + qt: ['6.4.3', '6.5.3', '6.6.3', '6.7.3', '6.8.0'] + + steps: + - uses: actions/checkout@v2 + + - name: Installing PostgreSQL + uses: tj-actions/install-postgresql@v3 + with: + postgresql-version: 16 + + - name: Installing Qt framework + uses: jurplel/install-qt-action@v3 + with: + version: ${{ matrix.qt }} + + - name: Running qmake + run: cd $GITHUB_WORKSPACE; qmake pgmodeler.pro -r PREFIX=/Applications/pgModeler.app/Contents PGSQL_INC=`pg_config --includedir` PGSQL_LIB=`pg_config --libdir`/libpq.dylib CONFIG+=debug + + - name: Building pgModeler + run: make -j6 + + - name: Deploying pgModeler + run: make install diff --git a/.github/workflows/windowsbuild.yml b/.github/workflows/windowsbuild.yml new file mode 100644 index 0000000000..a5bc994dd4 --- /dev/null +++ b/.github/workflows/windowsbuild.yml @@ -0,0 +1,48 @@ +name: Windows build + +on: + push: + branches: [ main, develop, 1.* ] + tags: 1.* + + pull_request: + branches: [ main, develop, 1.* ] + +jobs: + build: + runs-on: windows-latest + + strategy: + matrix: + qt: ['6.x'] + + defaults: + run: + shell: msys2 {0} + + steps: + - uses: actions/checkout@v2 + + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + install: base-devel mingw-w64-x86_64-make mingw-w64-x86_64-clang mingw-w64-x86_64-postgresql mingw-w64-x86_64-qt6 + + # Workaround: Instead of using $GITHUB_WORKSPACE in PREFIX we actually use the path converted to unix-like + # since we're running the building inside msys2 + - name: Running qmake + run: | + cd $GITHUB_WORKSPACE; + qmake-qt6 pgmodeler.pro -spec win32-clang-g++ -r PREFIX=D:/a/pgmodeler/pgmodeler/build \ + XML_INC=$(cygpath -m /mingw64/include/libxml2) \ + XML_LIB=$(cygpath -m /mingw64/bin/libxml2-2.dll) \ + PGSQL_INC=$(cygpath -m /mingw64/include) \ + PGSQL_LIB=$(cygpath -m /mingw64/bin/libpq.dll) \ + CONFIG+=debug + + - name: Building pgModeler + run: mingw32-make -j6 + + - name: Deploying pgModeler + run: mingw32-make install diff --git a/.gitignore b/.gitignore index ca413d0a72..15a8c3b585 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,79 @@ +.qmake.stash +.DS_Store + +*.tmp *.[oa] +*.dll +*.exe *.so.* *.so -ui_*.h +*.dylib* +*.user* +*.directory +*.run +*.Debug +*.Release +*.old +*-old +*.moc + moc_*.cpp -obj/* -moc/* +moc_*.h +qrc_*.cpp +ui_*.h +*.log Makefile +SQtCQg.json + +.qtc_clangd/* +*qmake2cmake* +*CMakeFiles* +*autogen* +CMakeLists.gen.txt +.qt/* +*meta_types* +cmake_install.cmake +CMakeCache.txt +cmake-build/* + + +*_BACKUP* +*_LOCAL* +*_REMOTE* +*_BASE* + build/* -*.pro.user -*.directory -*.run +dist/* +moc/* +obj/* +plugins +plugins/* +priv-*/* +release/* +apps/pgmodeler-se/pgmodeler-se +apps/pgmodeler/pgmodeler +apps/pgmodeler-ch/pgmodeler-ch +apps/pgmodeler-sc/pgmodeler-sc +apps/pgmodeler-cli/pgmodeler-cli +tests/src/main/runtests +tests/src/basefunctiontest/basefunctiontest +tests/src/databasemodeltest/databasemodeltest +tests/src/servertest/servertest +tests/src/proceduretest/proceduretest +tests/src/csvparsertest/csvparsertest +tests/src/foreigndatawrappertest/foreigndatawrappertest +tests/src/schemafilessyntaxtest/schemafilessyntaxtest +tests/src/syntaxhighlightertest/syntaxhighlightertest +tests/src/linenumberstest/linenumberstest +tests/src/testkeywordquotes/Makefile +tests/src/testkeywordquotes/testkeywordquotes +tests/src/baseobjecttest/baseobjecttest +tests/src/roletest/roletest +tests/src/fileselectortest/fileselectortest +tests/src/schemaparsertest/schemaparsertest +tests/src/partrelationshiptest/baseobjecttest +tests/src/partrelationshiptest/partrelationshiptest +tests/src/xmlparsertest/xmlparsertest +tests/src/datadicttest/datadicttest +tests/src/usermappingtest/usermappingtest +tests/src/transformtest/transformtest diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..61123da25a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,46 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug w/ Qt6 Printers (LLDB)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/bin/pgmodeler", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}/build", + "environment": [], + "externalConsole": false, + "MIMode": "lldb", + "setupCommands": [ + { + "description": "Enable pretty-printing for LLDB (Qt printers etc.)", + "text": "settings set target.pretty-print-children true", + "ignoreFailures": true + }, + { + "description": "Limit number of array/children elements shown", + "text": "settings set target.max-children-count 200", + "ignoreFailures": true + }, + { + "description": "Limit string summaries (caracteres máximos)", + "text": "settings set target.max-string-summary-length 200", + "ignoreFailures": true + }, + { + "description": "Limit summary depth (evita expansão recursiva infinita)", + "text": "settings set target.max-summary-depth 1", + "ignoreFailures": true + } + ], + "limitVariables": 100, + "showDisplayString": true, + "logging": { + "engineLogging": false, + "trace": false, + "traceResponse": false + } + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..ed92aae4b7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,229 @@ +{ + "cmake.parallelJobs": 22, + "cmake.buildDirectory": "${workspaceFolder}/cmake-build", + "cmake.generator": "Unix Makefiles", + "cmake.configureSettings": { + "PLUS_VERSION": "ON", + "PGM_PREFIX": "${workspaceFolder}/build", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "USE_CLANG_TIDY": "OFF", + "CLANG_TIDY_PATH": "/opt/qt/Tools/QtCreator/libexec/qtcreator/clang/bin/clang-tidy" + }, + + // Intelisense configurations + "C_Cpp.default.compileCommands": "${workspaceFolder}/cmake-build/compile_commands.json", + "C_Cpp.intelliSenseEngine": "disabled", + "C_Cpp.autocomplete": "disabled", + "C_Cpp.autocompleteAddParentheses": true, + "C_Cpp.hoverEnabled": false, + "C_Cpp.errorSquiggles": "disabled", + + // Delay para sugestões de código (menos intrusivo) + "editor.quickSuggestionsDelay": 1000, // Delay de 1000ms (1s) antes de mostrar sugestões + "editor.suggestOnTriggerCharacters": false, // Não mostrar sugestões ao digitar caracteres especiais + "editor.acceptSuggestionOnCommitCharacter": false, // Não aceitar sugestão ao digitar . ou ( + "editor.quickSuggestions": { + "other": "on", + "comments": "on", + "strings": "on" + }, + + // Desabilitar auto-completar chaves/colchetes/parênteses + "editor.autoClosingBrackets": "never", + "editor.autoClosingQuotes": "never", + "editor.autoClosingDelete": "never", + "editor.autoSurround": "never", + + // GitHub Copilot - delays e controles + "github.copilot.editor.enableAutoCompletions": true, + "editor.inlineSuggest.enabled": true, + "github.copilot.enable": { + "*": true, + "yaml": false, + "plaintext": false, + "markdown": false + }, + + "C_Cpp.commentContinuationPatterns": [ + { + "begin": "/*", + "continue": " * " + } + ], + + "C_Cpp.default.compilerPath": "/usr/bin/clang++", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++17", + "C_Cpp.default.intelliSenseMode": "linux-clang-x64", + "files.associations": { + "*.embeddedhtml": "html", + "ostream": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "cctype": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "source_location": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "format": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "numbers": "cpp", + "semaphore": "cpp", + "shared_mutex": "cpp", + "span": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stdfloat": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cinttypes": "cpp", + "typeinfo": "cpp", + "variant": "cpp", + "filesystem": "cpp", + "qtoolbar": "cpp", + "bitset": "cpp" + }, + + // Hiding build artifacts and moc generated files from the explorer + "files.exclude": { + "**/moc/**": true, + "**/obj/**": true, + "**/CMakeFiles/**": true, + "**/*.o": true, + "**/*.a": true, + "**/*.so*": true, + ".qtc_clangd": true, + "**/build/**": true, + "**/cmake-build/**": true, + ".qt": true + }, + + "files.watcherExclude": { + "**/moc/**": true, + "**/obj/**": true, + "**/CMakeFiles/**": true, + "**/*.o": true, + "**/*.a": true, + "**/*.so*": true, + ".qtc_clangd": true, + "**/build/**": true, + "**/cmake-build/**": true, + ".qt": true + }, + + "editor.tokenColorCustomizations": { + "textMateRules": [ + { + "scope": [ + "comment.block", + "comment.block.documentation", + "comment.line.double-slash" + ], + "settings": { + "foreground": "#808080", + } + } + ] + + }, + + // Clang-format file settings (see .clang-format in project's root) + "C_Cpp.formatting": "clangFormat", + "C_Cpp.clang_format_style": "file", + "editor.formatOnType": false, + "editor.autoIndent": "none", + "[cpp]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnType": false, + "editor.formatOnSave": false, + "editor.autoIndent": "none", + "editor.insertSpaces": false, + "editor.detectIndentation": false, + "editor.tabSize": 2 + }, + "[c]": { + "editor.defaultFormatter": "ms-vscode.cpptools", + "editor.formatOnType": false, + "editor.formatOnSave": false, + "editor.autoIndent": "none", + "editor.insertSpaces": false, + "editor.detectIndentation": false, + "editor.tabSize": 2 + }, + + // clangd memory and performance optimizations + "clangd.arguments": [ + "--compile-commands-dir=${workspaceFolder}/cmake-build", + + // Limit memory usage to prevent system freezes + // Adjust based on your available RAM (in MB) + "--limit-results=50", + + // Reduce number of worker threads (default is number of cores) + // Lower values = less memory but slower indexing + "-j=10", + + // Disable expensive background indexing features + "--background-index=false", + + // Limit preamble size (parsed headers cache) + "--pch-storage=memory", + + // Enable more aggressive memory cleanup + "--malloc-trim", + + // Reduce completion cache + "--completion-style=detailed", + + // Log memory usage (helpful for debugging) + "--log=error" + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..d6b2becdfc --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,34 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "CMake Install", + "type": "shell", + "command": "cmake", + "args": [ + "--install", + "${workspaceFolder}/cmake-build" + ], + "problemMatcher": [], + "group": "build" + }, + { + "label": "CMake Dist Clean", + "type": "shell", + "command": "rm", + "args": [ + "-rf", + "${workspaceFolder}/cmake-build" + ], + "problemMatcher": [], + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + } + } + ] +} \ No newline at end of file diff --git a/BuildConfs.cmake b/BuildConfs.cmake new file mode 100644 index 0000000000..e81a9d05d4 --- /dev/null +++ b/BuildConfs.cmake @@ -0,0 +1,276 @@ +set(CMAKE_WARN_DEPRECATED OFF) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +# set(CMAKE_VERBOSE_MAKEFILE ON) + +# By default the compiler used is clang/clang++ +if(LINUX) + set(CMAKE_C_COMPILER /usr/bin/clang) + set(CMAKE_CXX_COMPILER /usr/bin/clang++) +elseif(WIN32) + set(CMAKE_C_COMPILER C:/msys64/mingw64/bin/clang) + set(CMAKE_CXX_COMPILER C:/msys64/mingw64/bin/clang++) +endif() + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Importing Qt6 components +# Forcing a version >= 6.4.0. If no suitable version is found the script aborts +find_package(Qt6 6.4.0 REQUIRED COMPONENTS Core Gui Network PrintSupport Svg Widgets) + +qt_standard_project_setup() + +# Disabling deprecated Qt code of version below 6.4 +add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060400) + +link_libraries( + Qt::Core + Qt::Gui + Qt::Network + Qt::PrintSupport + Qt::Svg + Qt::Widgets) + +# Private plugins/core code source detection +# If the folder where the sources are stored exist we configure a +# set of variables and compiler defs that instruct cmake to +# include private code and resources +set(PRIV_PLUGINS_DIR priv-plugins) +set(PRIV_PLUGINS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/${PRIV_PLUGINS_DIR}) +set(PRIV_PLUGINS_RES ${PRIV_PLUGINS_ROOT}/res) + +set(PRIV_CORE_DIR priv-core) +set(PRIV_CORE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/${PRIV_CORE_DIR}) + +# Check if we are building DEMO version with PLUS resources +# DEMO_VERSION: only includes priv-core assets (logoicons.qrc and resources.qrc) +# but NO license checking code - no OpenSSL needed +if(DEMO_VERSION AND EXISTS ${PRIV_CORE_ROOT}) + # Enabling only priv-core assets (logo and icons) for demo + set(BUILD_PRIV_ASSETS ON) + set(PRIV_CORE_SRC ${PRIV_CORE_ROOT}/src) + # NO license checking symbols for demo version + # NO OpenSSL for demo version +elseif(NOT DEMO_VERSION AND PLUS_VERSION AND EXISTS ${PRIV_PLUGINS_ROOT}) + # PLUS version: include full private code and resources + # Specific logic to add OpenSSL support on macOS + # We expect that the the library and its headers is on the + # folder openssl_build in the root of pgModeler's source + if(APPLE) + set(OPENSSL_ROOT_DIR "${CMAKE_SOURCE_DIR}/openssl_build") + # Forcing the static usage of OpenSSL + set(OPENSSL_USE_STATIC_LIBS TRUE) + + # Hiding OpenSSL symbols in pgModeler code to avoid + # conflicts with other libs or plugins + set(LIB_SSL "${OPENSSL_ROOT_DIR}/lib/libssl.a") + set(LIB_CRYPTO "${OPENSSL_ROOT_DIR}/lib/libcrypto.a") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-load_hidden,${LIB_SSL} -Wl,-load_hidden,${LIB_CRYPTO}") + endif() + + # Adding support for OpenSSL + find_package(OpenSSL REQUIRED) + link_libraries(OpenSSL::SSL OpenSSL::Crypto) + + # Enabling the private plugins/core code build (full features with license checking) + set(BUILD_PRIV_CODE ON) + set(BUILD_PRIV_ASSETS ON) + set(PRIV_CORE_SRC ${PRIV_CORE_ROOT}/src) + set(PRIV_PLUGINS_SRC ${PRIV_PLUGINS_ROOT}/src) + add_compile_definitions(PRIV_CODE_SYMBOLS) +endif() + +# Enable the compilation of sample plugins +# if their sources exists in plugins/* +set(PLUGINS_DIR plugins) +set(PLUGINS_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/${PLUGINS_DIR}) + +if(EXISTS ${PLUGINS_ROOT} AND NOT BUILD_PRIV_CODE) + # Enabling the plugins build + set(BUILD_PLUGINS ON) +endif() + +# Adding custom C defs if some cmake variables are set +if(CMAKE_BUILD_TYPE STREQUAL Debug) + add_compile_definitions(PGMODELER_DEBUG) +endif() + +# AddressSanitizer option (can be enabled with -DUSE_ADDR_SANITIZER=ON) +if(USE_ADDR_SANITIZER) + add_compile_options(-fsanitize=address -fno-omit-frame-pointer -g) + add_link_options(-fsanitize=address) +endif() + +if(NOT DEFINED NO_CHECK_CURR_VER) + add_compile_definitions(CHECK_CURR_VER) +endif() + +if(SNAPSHOT_BUILD) + add_compile_definitions(SNAPSHOT_BUILD) +endif() + +if(DEMO_VERSION) + add_compile_definitions(DEMO_VERSION) +endif() + +if(NO_UPDATE_CHECK) + add_compile_definitions(NO_UPDATE_CHECK) +endif() + +if(APPIMAGE_BUILD AND LINUX) + add_compile_definitions(APPIMAGE_BUILD) +endif() + +# This function wraps a call to qt_add_executable and set a +# variable named PGM_TARGET in the parent scope (where the function +# was called). In macOS, the executable is always built as standalone +# not as a application bundle +# The parameter USE_PRIV_EXEC_ICONS when ON indicates that the executable +# icon must be the one available in private resources dir otherwise +# the one in the target's res/ is used instead. This options has +# effect only when building Windows binaries +function(pgm_add_executable TARGET) + list(APPEND _SOURCES ${ARGN}) + + if(WIN32) + set(PRIV_ICO_RES ${PRIV_PLUGINS_RES}/${TARGET}/windows_ico.rc) + + if((PLUS_VERSION OR BUILD_PRIV_ASSETS) AND EXISTS ${PRIV_ICO_RES}) + set(EXEC_ICO_RES ${PRIV_ICO_RES}) + else() + set(EXEC_ICO_RES res/windows_ico.rc) + endif() + + list(APPEND _SOURCES ${EXEC_ICO_RES}) + endif() + + add_executable(${TARGET} ${_SOURCES}) + + # Strip symbols in release builds for security + if(CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_RELEASE "-s") + endif() + + if(WIN32) + set_target_properties(${TARGET} PROPERTIES + WIN32_EXECUTABLE TRUE + LINK_FLAGS "-mwindows") + elseif(APPLE) + set_target_properties(${TARGET} PROPERTIES + MACOSX_BUNDLE FALSE + BUILD_WITH_INSTALL_RPATH TRUE + INSTALL_NAME_DIR "@executable_path/../Frameworks") + endif() + + set(PGM_TARGET ${TARGET} PARENT_SCOPE) +endfunction() + +# This function configure the default includes and link libraries +# as being the libs subprojects sources and generated libs +function(pgm_set_default_inc_libs TARGET) + target_include_directories(${TARGET} PRIVATE + ${LIBCANVAS_INC} + ${LIBCLI_INC} + ${LIBCONNECTOR_INC} + ${LIBCORE_INC} + ${LIBGUI_INC} + ${LIBPARSERS_INC} + ${LIBUTILS_INC}) + + target_link_libraries(${TARGET} PRIVATE + canvas + cli + connector + core + gui + parsers + utils) +endfunction() + +# This function wraps a call to qt_add_library and set a +# variable named PGM_TARGET in the parent scope (where the function +# was called). The library is always built as with option SHARED +function(pgm_add_library TARGET) + string(TOUPPER "${TARGET}_SYMBOLS" LIB_SYMBOLS) + add_compile_definitions(${LIB_SYMBOLS}) + + add_library(${TARGET} SHARED ${ARGN}) + + # Strip symbols in release builds for security + if(CMAKE_BUILD_TYPE STREQUAL Release) + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS_RELEASE "-s") + endif() + + if(APPLE) + set_target_properties(${TARGET} PROPERTIES + BUILD_WITH_INSTALL_RPATH TRUE + INSTALL_NAME_DIR "@executable_path/../Frameworks") + endif() + + set(PGM_TARGET ${TARGET} PARENT_SCOPE) +endfunction() + +# This function configures the deployment settings of a library. +function(pgm_install_library TARGET) + install(TARGETS ${TARGET} + LIBRARY DESTINATION ${PGM_PRIVATELIBDIR} + FRAMEWORK DESTINATION ${PGM_PRIVATELIBDIR} + RUNTIME DESTINATION ${PGM_PRIVATELIBDIR}) +endfunction() + +# This function configures the deployment settings of an executable. +# The IS_PRIVBIN, when true, indicates that the output folder of the binary +# must be the one configured in PGM_PRIVATEBINDIR otherwise will be PGM_BINDIR +function(pgm_install_executable TARGET IS_PRIVBIN) + if(IS_PRIVBIN) + set(DEST ${PGM_PRIVATEBINDIR}) + else() + set(DEST ${PGM_BINDIR}) + endif() + + install(TARGETS ${TARGET} + BUNDLE DESTINATION ${DEST} + RUNTIME DESTINATION ${DEST}) +endfunction() + +# This function includes priv-core sources into the current target. +# It automatically appends source files, forms, and resources to the +# caller's SOURCES, FORMS, and RESOURCES lists (if they exist). +# It also adds the necessary include directories to the current target. +# Parameters: +# TARGET - The target to add sources/includes to +# INCLUDE_SOURCES - If ON, adds sources and UI forms (needed by libgui) +# If OFF, adds only include directories (executables/plugins) +# Note: In DEMO_VERSION mode, only assets (resources) are included, no license code +function(pgm_inc_priv_core_sources TARGET INCLUDE_SOURCES) + if(NOT BUILD_PRIV_ASSETS) + return() + endif() + + # Add include directories to the current target (only if BUILD_PRIV_CODE is ON) + if(DEFINED TARGET AND BUILD_PRIV_CODE) + target_include_directories(${TARGET} PRIVATE ${PRIV_CORE_INC}) + + # Only add sources if INCLUDE_SOURCES is ON (to avoid ODR violation) + if(INCLUDE_SOURCES) + target_sources(${TARGET} PRIVATE ${PRIV_CORE_SOURCES} ${PRIV_CORE_FORMS}) + + # Enable AUTOUIC for this target if there are UI forms + if(PRIV_CORE_FORMS) + set_target_properties(${TARGET} PROPERTIES AUTOUIC ON) + # Set the search path for .ui files + set_property(TARGET ${TARGET} APPEND PROPERTY AUTOUIC_SEARCH_PATHS ${PRIV_CORE_ROOT}/ui) + endif() + endif() + endif() + + # Always add resources if they exist (works for both PLUS and DEMO versions) + if(DEFINED TARGET AND PRIV_CORE_RESOURCES) + target_sources(${TARGET} PRIVATE ${PRIV_CORE_RESOURCES}) + + # Enable AUTORCC for this target + set_target_properties(${TARGET} PROPERTIES AUTORCC ON) + endif() +endfunction() diff --git a/BuildNumDate.cmake b/BuildNumDate.cmake new file mode 100644 index 0000000000..6b976dc222 --- /dev/null +++ b/BuildNumDate.cmake @@ -0,0 +1,39 @@ +# Determining the build date and build number +# The commands changes from OS to OS +if(LINUX OR APPLE) + set(date_cmd date) + set(date_cmd_param +%Y%m%d) + set(build_num_cmd ${CMAKE_SOURCE_DIR}/getbuildnum.sh) +else() + set(date_cmd ${CMAKE_SOURCE_DIR}/getbuildnum.bat) + set(date_cmd_param "") + set(build_num_cmd ${CMAKE_SOURCE_DIR}/getbuildnum.bat) +endif() + +# Running the build date command +execute_process( + COMMAND ${build_num_cmd} + OUTPUT_VARIABLE build_num + RESULT_VARIABLE build_num_res + OUTPUT_STRIP_TRAILING_WHITESPACE) + +if(NOT build_num_res EQUAL 0) + message(FATAL_ERROR "Command failed: ${build_num_cmd}") +endif() + +# Running the build number command +execute_process( + COMMAND ${date_cmd} ${date_cmd_param} + OUTPUT_VARIABLE date + RESULT_VARIABLE date_res + OUTPUT_STRIP_TRAILING_WHITESPACE) + +if(NOT date_res EQUAL 0) + message(FATAL_ERROR "Command failed: ${date_cmd} ${date_cmd_param}") +endif() + +# The output of the commands above are used as the defines +# BUILDNUM and BUILDDATE in .cpp files +add_compile_definitions( + BUILDNUM="${build_num}" + BUILDDATE="${date}") diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ac057b6c7..0b94450640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,28 +1,2537 @@ -Change Log +Changelog --------- +v2.0.0-alpha1 +------ +*Release date: February 13, 2026* + +* [New] Added the class TabOrderManager that automatically configures tab order for editing forms and complex widgets. +* [New] Added the template method GuiUtilsNs::configureWidgetsFont that allows configuring font properties for multiple widgets at once. +* [New] Added the method GuiUtilsNs::createLabeledWidgetLayout to create labeled widget layouts. +* [New] Added support for configuring buddy labels via GuiUtilsNs::configureWidgetsBuddyLabels. +* [New] Added the class CodePreviewWidget as an improved version of SourceCodeWidget for code preview and filtering. +* [New] Added the class ObjectAssociationsWidget to replace ObjectDepsRefsWidget with improved UI for object associations. +* [New] Added busy indicator animation to QProgressBar in CustomUiStyle. +* [New] Added custom UI style hint AltDefaultFrmHint for alternative default frame appearance. +* [New] Added support for comment field in GenericSQL objects. +* [New] Added custom hover effects for input widgets, buttons, checkboxes and radio buttons in CustomUiStyle. +* [New] Added focus border styling for QCheckBox and QRadioButton widgets. +* [New] Added checkbox rendering support for checkable QGroupBox titles in CustomUiStyle. +* [New] Added the method ModelExportHelper::finishExport to properly emit signals when export finishes or is canceled. +* [New] Added experimental support for name quoting disabling, allowing pgModeler to treat object names as case insensitive. +* [New] Added checking in ModelValidationHelper to detect FK with SET NULL action tied to NOT NULL columns. +* [New] Added an optional qint64 parameter to UtilsNs::loadFile to allow loading just a portion of a file in bytes. +* [New] Added support for CLI version-only printing for integration with deployment pipelines. +* [New] Added the method Messagebox::alert as a convenience overload. +* [New] Added multiple icons support in TaskProgressWidget. +* [New] Added convenience layout helpers in GuiUtilsNs to reduce explicit layout instantiation. +* [New] Added custom disabled icon styling with dynamic theme color blending in CustomUiStyle. +* [New] Added support for icon display in ObjectSelectorWidget. +* [Change] Major refactoring of editing forms UI to modern tabbed and vertical layouts. +* [Change] Refactored BaseObjectWidget::configureFormLayout to a template method for better code reusability. +* [Change] Refactored ReferencesWidget UI to modern vertical layout pattern. +* [Change] Improved form sizing and layout calculations in BaseForm. +* [Change] Refactored plugin icon management to support both QIcon and QPixmap. +* [Change] Optimized icon loading by replacing QIcon/QPixmap(GuiUtilsNs::getIconPath()) with GuiUtilsNs::getIcon/getPixmap(). +* [Change] Refactored plugin info UI to use GuiUtilsNs helpers. +* [Change] Improved label consistency and widget organization across configuration widgets. +* [Change] Improved UI consistency in Data Grid filter/limit interface. +* [Change] Improved ModelDbSelectorWidget layout and label consistency. +* [Change] Refactored checkbox font configuration across multiple widgets. +* [Change] Modernized ObjectSearchWidget, SwapObjectsIdsWidget, ObjectRenameWidget interfaces. +* [Change] Improved ModelExportWidget UI with refactored checkbox configurations. +* [Change] Refactored SnippetsConfigWidget and ConnectionsConfigWidget layouts for better consistency. +* [Change] Refactored TabOrderManager to simplify widget discovery logic and improve tab navigation with Shift+Tab support. +* [Change] Minor adjustments in TabOrderManager to exclude hidden widgets from tab order list. +* [Change] Removed unused deprecated method BaseObjectWidget::generateVersionWarningFrame. +* [Change] Improved PgSqlType class to allow user types to have variable length, needed for extension-created types. +* [Change] Minor adjustment in PgSqlType::hasVariableLength. +* [Change] Adjusted MainWindow::changeCurrentView to hide model actions when not in design view. +* [Change] Adjusted MainWindow::closeEvent behavior to discard any unchanged models. +* [Change] Improved UI and code organization in main window and widgets. +* [Change] Refactored view switching logic in MainWindow. +* [Change] Refactored namespace patterns across libraries for better standardization. +* [Change] Refactored CLI help menu with automatic line wrapping and sentence-based breaks. +* [Change] Added the method PgModelerCliApp::printMenuItem for automatic line wrapping in CLI help menu. +* [Change] Moved about text configuration to AboutWidget constructor. +* [Change] Copyright updates on source files. +* [Change] Logo and icon updates for improved visual consistency. +* [Change] Minor adjustments in some CMake scripts. +* [Change] Minor adjustment in TaskProgressWidget::show. +* [Change] Adjusted business logo design. +* [Change] Adjusted the construcutors of ObjectsScene and OperationList to associate a parent object. +* [Change] Centralized private code includes in privcodemacros.h. +* [Change] Improved CustomUiStyle and AppearanceConfigWidget for better theme detection. +* [Change] Fixed QGroupBox frame and content alignment in CustomUiStyle. +* [Change] Removed obsolete code and finalized UI modernization across multiple widgets. +* [Change] Improved connection/database info widgets in DataHandlingForm and SQLExecutionWidget. +* [Fix] Fixed a crash when editing connections while browsing database in SQLToolWidget. +* [Fix] Fixed a crash in ModelExportWidget. +* [Fix] Fixed the method PgModelerCliApp::definePluginsExecOrder that was ignoring valid plugins options. +* [Fix] Fixed a bug in NumberedTextEditor that was copying all text when hitting Ctrl+C with only a portion selected. +* [Fix] Minor fix in TabOrderManager to avoid mixing widgets from different windows in the same tab order sequence. +* [Fix] Fixed a bug in ModelValidationHelper that was not properly swapping ids between table children objects and their dependencies. +* [Fix] Minor adjustment in ObjectsListModel to make the "Id" column the first one in the header. +* [Fix] Minor adjustment in TabOrderManager::configureTabOrder to operate only if the parent widget is active/visible. +* [Fix] Minor adjustment in ModelExportHelper::finishExport to check if the database model still exists. +* [Fix] Minor fix in DiffToolWidget so the apply diff button can be enabled correctly. +* [Fix] Fixed a bug in DatabaseModel::loadObjectsMetadata that was causing crashes in some circumstances. +* [Fix] Fixed a bug in DatabaseModel::updateExtensionObjects that was not setting the dependency between data type and extension correctly. +* [Fix] Minor fix in displaying the splash screen. +* [Fix] Minor fix in build process for Windows. +* [Fix] Minor adjustment in sqlexecutionwidget.ui to display long error messages. +* [Fix] Fixed heap-use-after-free by clearing object dependencies before destruction. +* [Fix] Minor adjustment in .gitignore. + +v1.2.3 +------ +Release date: February 6, 2026
+ +* [New] Added the method TaskProgressWidget::setNoProgressState. +* [Change] Refactored MainWindow initialization by moving startup timers to a new startOtherTimers method. +* [Change] Improved MainWindow initialization control by overriding the showEvent method. +* [Change] Updated AboutWidget and WelcomeWidget UI layouts. +* [Change] Updated GlobalAttributes with new site URL. +* [Fix] Fixed a bug in DatabaseModel::loadObjectsMetadata that was causing crashes in some circumstances. +* [Fix] Fixed a bug in NumberedTextEditor that was copying all text when hitting Ctrl+C when there was only a portion of the text selected. +* [Fix] Fixed a bug in ModelValidationHelper that was not properly swapping ids between table children objects and their dependencies (e.g., trigger -> function). +* [Fix] Fixed a bug in the Connection class that was creating an invalid connection string when other params were manually specified. + +v2.0.0-alpha +------ +*Release date: October 30, 2025* + +* [New] Added initial support for PostgreSQL 18. +* [New] Added the message box type Success and the static method Messagebox::success. +* [New] Added the enum StyleHint and the method setStyleHint in CustomUiStyle that renders frames background and border in a contextual way. +* [New] Added support for hiding empty object groups in database object trees in DatabaseExplorerWidget and DatabaseImportWidget. The hidden status is persisted in general.conf file. +* [New] Added a button in ModelFixWidget to generate output filename based on the input filename. +* [New] Added support for grid duplication in DataGridWidget. +* [New] Added a button to browse the selected table in DataHandlingForm. +* [New] Moved the entire build system from qmake to CMake on all platforms. +* [New] Added support for diffing two models in CLI and GUI. +* [New] Added the method ModelDbSelectorWidget::clearSelection. +* [New] Added the method Catalog::getServerVersion. +* [New] Created the method updateConnections in ModelValidationWidget, DatabaseImportWidget, DiffToolWidget and SQLToolWidget. +* [New] Added the class ModelDbSelectorWidget that encapsulates features to select models or databases to be used where models or databases need to be selected. +* [New] Created the function GuiUtilsNs::createWidgetInParent. +* [New] Added the method ModelWidget::setInteractive that toggles the interaction over the model. +* [New] Created aliases PGM_FILE, PGM_LINE and PGM_FUNC that refer respectively to macros __FILE__, __LINE__ and __PRETTY_FUNCTION__. +* [New] Added a dedicated icon for the Welcome view. +* [New] Added the widget FixToolsWidget, integrated into main window, that runs both the model fix and metadata handling operations. +* [Change] Adjusted the build to use clang-tidy to identify where code can be modernized. +* [Change] Applied a full refactor to the code based on clang-tidy checks. +* [Change] Refactored the class ResultSet to avoid copying the PGresult; instead, it will reuse it during initialization. +* [Change] Renamed the files palette.conf to theme.conf. +* [Change] Removed the method AppearanceConfigWidget::isDarkUiTheme and replaced its usage with CustomUiStyle::isDarkPalette. +* [Change] Moved the usage of CustomUiStyle to Application class. +* [Change] Renamed the enum IconType in Messagebox to MessageType. +* [Change] Removed the method Messagebox::setMessageFrameColor. +* [Change] Allowed tool/config widgets to be resized via splitter. +* [Change] Changed the attributes foreground-color and background-color to fg-color and bg-color in *-highlight.conf files. +* [Change] Replaced the filter options checkboxes in SQLExecutionWidget with tool buttons. +* [Change] Adjusted the column filter routine when filtering using regular expressions. +* [Change] Improved English grammar in internationalization strings across multiple files. +* [Change] Adjusted the rendering of QTableWidget/QTableView grids via polish. +* [Change] Rearranged the UI of AboutWidget and UpdateNotifierWidget. +* [Change] Adjusted the position and size of tab bar scroll buttons. +* [Change] Adjusted the minimum size of MainWindow. +* [Change] Adjusted the rendering of arrows in scroll buttons of tab bars. +* [Change] Fixed the position of scroll buttons of the SQL execution tab widget. +* [Change] Added missing SQL keywords to sql-highlight.conf. +* [Change] Added the style hint SuccessFrmHint in CustomUiStyle. +* [Change] Adjusted the rendering of frames with hint DefaultFrmHint. +* [Change] Adjusted the themes stylesheets. +* [Change] Adjusted CustomUiStyle and AppearanceConfigWidget for better theme detection. +* [Change] Added custom rendering routines for multiple Qt widgets in CustomUiStyle including QToolTips, QScrollBars, QTabBar, QProgressBar, QHeaderView, and others. +* [Change] Refactored various rendering methods in CustomUiStyle to improve code reusability and maintainability. +* [Change] Added support for smart theme detection in AppearanceConfigWidget. +* [Change] Added support for loading color palette from theme folder, file theme.conf. +* [Change] Adjusted the rendering of disabled checkboxes and radio buttons. +* [Change] Fixed the rendering of editable comboboxes. +* [Change] Adjusted the dark palette colors and rendering of various UI components. +* [Change] Implemented enhanced CustomUiStyle with bitwise corner flags for flexible corner control. +* [Change] Added custom disabled icon styling with dynamic theme color blending in CustomUiStyle. +* [Change] Adjusted the UI of GeneralConfigWidget. +* [Change] Adjusted the initial sizes of splitters in tools/config widgets. +* [Change] Refactored the ui-style.conf to remove duplicate styles. +* [Change] Forcing the Qt version to >= 6.4.3 in find_packages(). +* [Change] Refactored parts of the UI in ModelExportWidget to include a ModelDbSelectorWidget instance. +* [Change] Renamed MetadataHandlingForm to MetadataHandlingWidget. +* [Change] MetadataHandlingWidget is now part of FixToolsWidget. +* [Change] Renamed the method PgModelerCliApp::diffModelDatabase to diffModels. +* [Change] Minor adjustment in GeneralConfigWidget::resetAlertChoices to reset the Attributes::AlertApplyMetadata parameter. +* [Change] Minor UI adjustment in RelationshipConfigWidget. +* [Change] Minor UI adjustment in SchemaEditorForm. +* [Change] Minor UI adjustment in SchemaEditorForm. +* [Change] Minor UI adjustment in MetadataHandlingWidget. +* [Change] Minor UI adjustment in ConfigurationWidget. +* [Change] Minor UI adjustment in PluginsConfigWidget. +* [Change] Minor UI adjustment in SnippetsConfigWidget. +* [Change] Minor UI adjustment in AppearanceConfigWidget. +* [Change] Minor UI adjustment in GeneralConfigWidget. +* [Change] Minor UI adjustment in MainWindow. +* [Change] Renamed the class ModelFixForm to ModelFixWidget since it now runs integrated into FixToolsWidget. +* [Change] Adjusted the display of the Fix view in MainWindow. +* [Change] Minor size adjustment in ConfigurationWidget. +* [Change] Minor adjustment in DatabaseImportWidget::s_importFinished to send a bool flag indicating whether the signal was sent during import error. +* [Change] Minor adjustment in DiffToolWidget to disable the import options group when the user selects model -> model diff. +* [Change] Adjusted the method Application::copyFilesRecursively to ignore the diff-presets.conf from previous versions of pgModeler. +* [Change] Minor improvement in DiffToolWidget presets saving and loading. +* [Change] Adjusted the invalidated model alert display in ModelExportWidget. +* [Change] Removed the tab "Partial diff" and moved all controls related to it to the main tab in DiffToolWidget. +* [Change] Reorganized the diff widget UI. +* [Change] Removed unused components in DiffToolWidget. +* [Change] Minor adjustment in DatabaseImportWidget and ModelExportWidget to block changes in the model while the operations are running. +* [Change] Adjustments to MainWindow to start/stop timers when a diff, import or export operation starts/stops. +* [Change] The diff tool is now integrated into the main window via "Diff view". +* [Change] The import tool is now integrated into the main window via "Import view". +* [Change] The export tool is now integrated into the main window via "Export view". +* [Change] Adjusted some icon sizes in icons-*.conf files. +* [Change] Converted ModelExportWidget export mode radio buttons into tool buttons. +* [Change] Renamed the method exec() to setModel() in ModelExportWidget. +* [Change] Adjusted MainWindow::updateConnections to update the diff, import and export widgets connections. +* [Change] Adjusted the UI of ModelObjectsWidget and OperationListWidget. +* [Change] Changed some QToolButtons to QPushButton for better semantics. +* [Change] Adjustments in the light themes. +* [Change] Finished the UI adjustments in DataHandlingForm. +* [Change] Started the adjustments to DataHandlingForm. +* [Change] Adjusted the ui-style.conf. +* [Change] Adjusted the behavior of MainWindow::closeEvent to discard any unchanged models. +* [Change] Adjusted some class destructor declarations. +* [Change] Removed the class ConfigurationForm. +* [Change] Minor adjustment in ConnectionsConfigWidget::openConnectionsConfiguration. +* [Change] Removed the use of the deprecated method ConfigurationWidget::getConfigurationWidget(int). +* [Change] Minor improvement to BaseConfigWidget. +* [Change] In MainWindow, if the user changes the settings without applying them, a confirmation message will be displayed so the changes can be applied or reverted before switching the current view. +* [Change] Adjusted the tab close button icon. +* [Change] Adjusted the border radius of table objects. +* [Change] Modified the default color of canvas objects in dark theme. +* [Change] Adjusted the layout classes used to arrange the view widgets in MainWindow's stack widget. +* [Change] Adjusted the default colors of the dark palette. +* [Change] Updated the window icons of all app subprojects. +* [Change] Minor adjustment in logo images. +* [Change] Adjusted the splash screen display. +* [Change] Adjusted the logo design/color to match the icon set colors. +* [Change] Minor adjustment in resource files. +* [Change] Updated the icon colors for a flatter and more vivid style. +* [Change] Adjusted the Windows version build. +* [Change] Changed the deprecated define Q_OS_MAC to Q_OS_MACOS. +* [Fix] Fixed a bug in the connection class that was creating an invalid connection string when other params were manually specified. +* [Fix] Fixed a bug that was causing collations assigned to columns not to be reflected in SQL and XML codes. +* [Fix] Fixed a bug that was causing collations to be saved always as deterministic even when the user unchecked the option in the editing form. +* [Fix] Fixed the function PgSqlVersions::parseString to return the default version as a fallback when a major server version is not yet recognized by the tool. +* [Fix] Fixed a bug in XMLParser that was not configuring the DTD file path correctly. +* [Fix] Fixed a bug in ObjectsScene that was causing value overflow when aligning points to grid in some cases. +* [Fix] Fixed a bug in ModelWidget::protectObject. +* [Fix] Fixed the rendering of QTableView/QTableWidget item borders. +* [Fix] Minor fix in the crash handler to load the appearance settings and keep the UI uniform. +* [Fix] Fixed the method CustomUiStyle::setStyleHint to accept only QFrames. +* [Fix] Minor fix in DiffToolWidget. +* [Fix] Minor fix in relationshipconfigwidget.ui. +* [Fix] Minor fix in databaseimportwidget.ui. +* [Fix] Fixed the warning icon display in FileSelectorWidget. +* [Fix] Fixed a bug that was causing columns that were part of PKs not to be removed by the user. +* [Fix] Minor fix in difftoolwidget.ui. +* [Fix] Fixed a bug in DatabaseImportWidget that was allocating threads every time the showEvent was triggered. +* [Fix] Minor fix in the build process. +* [Fix] Fixed the catalog query for constraints for PostgreSQL 17. +* [Fix] Minor fix in libcli/CMakeLists.txt. + +v1.2.0 +------ +*Release date: May 9, 2025* + +* [New] Setup a wait cursor when loading a diff code in the SQL tool. +* [New] Added the static methods isAccepted, isRejected, and isCanceled to Messagebox. +* [New] Added the enum Messagebox::ResultId +* [New] Added support for multiple objects code preview in SourceCodeWidget. +* [New] Added the methods BaseObject::setPgOid and BaseObject::getPgOid. +* [New] Added a confirmation message in DataHandlingForm when the user tries to close the dialog even without uncommitted data. +* [New] Graphical objects added to the ModelWidget will now blink and the viewport will center on them to indicate to the user where they were put. +* [New] Added a copy action in NumberedTextEditor that copies all the text to the clipboard +* [Change] Improved the SyntaxHighlighter and the sql-highlight files so the regular expressions for each group don't take too much to process strings +* [Change] Messagebox::exec now calls qApp->restoreOverrideCursor +* [Change] Removed unneeded calls to qApp->restoreOverrideCursor +* [Change] Changed the return type of all create methods in DatabaseImportHelper to their respective object classes. +* [Change] In DatabaseImportHelper::createObject the OID is automatically assigned to the object created from XML code. +* [Change] Minor adjustment in ObjectsScene::addItem. Added an optional parameter to blink added objects. +* [Change] Adjusted pgmodeler-cli to raise errors when the ignore export error options are used in transactional export mode. +* [Change] Minor adjustment in ModelDatabaseDiffForm by making transactional mode mutually exclusive with ignore export errors options. +* [Change] Adjusted the use of Messagebox in several portions of the tool. +* [Change] Replaced the calls to Messagebox::result() == result_code by the respective isAccepted, isRejected or isCanceled methods. +* [Change] Adjusted the ModelWidget::configureFadeMenu to stop reallocating new actions on each call. +* [Change] Removed unused class attribute in ModelObjectsWidget. +* [Change] Removed the method SourceCodeWidget::setSourceCodeTab. +* [Change] Forcing the option "Ignore import errors" when the import to working model option is set on DatabaseImportHelper and DatabaseImportForm. +* [Change] Improved the reverse engineering so columns can also be imported using the option "Import to the working model" in DatabaseImportForm. +* [Fix] Minor fix in FileSelectorWidget that was not applying correctly the palette colors in the line edit field. +* [Fix] Minor fix in DatabaseModel::updateExtensionObjects to ignore duplicated schemas and use the ones already available in the model. +* [Fix] Minor fix in SchemaParser::resetParser to clear include info so the error location in schema code can be correctly informed. +* [Fix] Fixed a bug in the data dictionary generation for views. +* [Fix] Fixed a bug in the SQL generation of database model SQL related to an unknown database attribute. +* [Fix] Fixed the text stack trace in the message box class. +* [Fix] Fixed the code display for functions in DatabaseExplorerWidget. +* [Fix] Fixed a bug when importing composite types having attributes using arrays of other user-defined types. +* [Fix] Fixed a bug when displaying the source, in Database Explorer, of a composite type that has one or more attributes referencing used-defined types. +* [Fix] Fixed a bug in SyntaxHighlighter::highlightEnclosingChars. +* [Fix] Fixed a bug in ResultSet::accessTuple that was generating errors when running catalog queries of some objects in older versions of PostgreSQL. +* [Fix] Fixed a bug in PgModelerCliApp::diffModelDatabase that was informing invalid forced filtered types. +* [Fix] Minor fix in DatabaseModel::getChangelogDefinition to avoid returning an empty string when the changelog is not persisted to the dbm file. +* [Fix] Fixed a bug in ModelObjectsWidget::selectObject. +* [Fix] Minor fix in CodeCompletionWidget to list columns on "Order By". + +v1.2.0-beta1 +------ +*Release date: March 31, 2025* + +* [New] Added the method AppearanceConfigWidget::isDarkUiTheme. +* [New] Added per-instance control of line numbers and action buttons visibility in NumberedTextEditor (previously global-only). +* [New] Added an integrated search/replace widget in NumberedTextEditor. +* [New] Added a debug tab in DatabaseImportForm and ModelDatabaseDiffForm to display debug messages during reverse engineering. +* [New] Added support for force object re-creation in pgmodeler-cli's diff operation. +* [New] Added a popup menu in ModelDatabaseDiffForm to select object types for forced re-creation. +* [New] Added a flag in DatabaseModel to control inclusion of disabled SQL code in generated scripts. +* [New] Added support for toggling disabled objects' code generation in database model properties. +* [New] Added an attribute in .dbm files to persist system schemas' rectangle visibility. +* [New] Added the methods Extension::setObjectNames and Extension::getObjectNames. +* [New] Added struct Extension::ExtObject to manage child objects' metadata. +* [New] Added support for permission editing for system objects. +* [Change] Adjusted the UI in SQLExecutionWidget to reorganize action buttons. +* [Change] Adjusted the NumberedTextEditor internal widgets when the horizontal scrollbar is visible. +* [Change] Adjusted the class ModelFixForm to use DebugOutputWidget. +* [Change] Adjusted the object selection in ModelObjectsWidget (ALT + click highlights graphical objects). +* [Change] Adjusted the query filters in ModelDatabaseDiffForm to exclude only system objects during comparison. +* [Change] Improved ExtensionWidget to support custom schema names in data types. +* [Change] Refactored DatabaseImportHelper::createExtension to correctly import extension-owned types/schemas. +* [Change] Refactored DatabaseModel to use Extension::ExtObject when handling extensions. +* [Change] Simplified the function behavior types by removing redundant STRICT (merged with RETURNS NULL ON NULL INPUT). +* [Change] Moved Q_OBJECT macro to the top of class declarations. +* [Change] Updated catalog queries for indexes to retrieve comments. +* [Change] Removed redundant search/replace widget from SourceCodeWidget (now integrated in NumberedTextEditor). +* [Change] Removed unused checkbox from databaseimportform.ui. +* [Change] Minor adjustments in UtilsNs::saveFile and UtilsNs::loadFile. +* [Change] Minor adjustments in .pro/.pri files for private plugin assets. +* [Change] Minor schema adjustments in sql/dbmodel.sch. +* [Change] Fixed DatabaseImportForm to remain open in debug mode for output inspection. +* [Fix] Fixed crashes when diffing databases containing extension-created tables. +* [Fix] Fixed the importing of columns that use arrays of user-defined types. +* [Fix] Fixed the persistence of time zone state in timestamp types. +* [Fix] Fixed false-positive diffs for functions with comments or STRICT behavior. +* [Fix] Fixed reverse engineering of types with uppercase letters in names. +* [Fix] Fixed a crash in identifier relationships with FK indexes. +* [Fix] Fixed DatabaseImportHelper::createPermission to skip permissions whose references unavailable system roles. +* [Fix] Fixed ModelExportHelper::exportBufferToDBMS edge cases. +* [Fix] Fixed XML code generation for Extension class to include child objects. +* [Fix] Fixed SQL/XML code exclusion for protected schemas in DatabaseModel::getSourceCode. +* [Fix] Fixed SQL syntax highlighting files. +* [Fix] Minor fixes in LineNumbersWidget and NumberedTextEditor. +* [Fix] Minor fixes in PgModelerCliApp::fixObjectAttributes. + +v1.2.0-beta +------ +*Release date: February 10, 2025* + +* [New] Added the enum PgModelerGuiPlugin::MenuSectionId that controls where the plugin actions are placed in the context menu in the model widget. +* [New] Added a call to qApp::alert() when the export, import, and diff processes finish so the taskbar blinks when the window is not visible. +* [New] Added the method PgModelerGuiPlugin::isSelectionValid. +* [New] Indexes created by relationships can have their parent relationships opened from a specific action in the context menu of the model widget. +* [New] Added support for the total number of rows in the table being handled in DataHandlingForm. +* [New] Added support for setting the global settings for FK columns index type in RelationshipConfigWidget. +* [New] Adding support for the creation of indexes on FK columns generated by relationships. +* [New] Set the "Stack trace" tab icon in CrashHandlerForm. +* [Change] Adjusted the method ModelWidget::configurePluginsActions to place actions in menu sections according to the plugins' custom menu sections. +* [Change] Minor adjustment in BaseForm::setMainWidget to set the default window icon. +* [Change] Adjusted the plugin API by removing the unnecessary const methods/objects usage. +* [Change] Added icons for tree widgets collapse and expand actions. +* [Change] Adjusted the order of types in IndexingType::types. +* [Change] Minor adjustment in Relationship::setNamePattern. +* [Change] Minor adjustment in ModelWidget::configurePluginsActionsMenu to enable/disable plugin actions based on the call to isSelectionValid of the plugin that owns the action. +* [Change] Updates on icons-*.conf files. +* [Change] Minor layout adjustment in DataGridWidget. +* [Change] Updated the class RelationshipConfigWidget to include FK column index name pattern. +* [Change] Adjusted the code generation of relationships to include FK column indexes. +* [Change] Minor refactor in Relationship::getSourceCode. +* [Change] Minor refactor in DatabaseModel::getCreationOrder. +* [Change] Minor adjustment in LayersWidget to accept Enter/Return to apply settings. +* [Fix] Minor fix in GlobalAttributes::setCustomPaths. +* [Fix] Fixed some shortcut conflicts in the main window. +* [Fix] Minor fix in ModelWidget::configurePluginsActionsMenu +* [Fix] Minor fix in ModelObjectsWidget::show to run in an event loop when configured in simplified view mode. +* [Fix] Minor fix in ObjectsFilterWidget. +* [Fix] Minor fix in the "Open relationship" action in ModelWidget. +* [Fix] Fixed the index catalog queries when using pgModeler in compatibility mode (PG 9.x). +* [Fix] Minor fix in RelationshipWidget to assign FK index pattern to the relationship being handled. +* [Fix] Minor fix in buttons' drop shadows in DataHandlingForm. + +v1.1.6 +------ +*Release date: December 21, 2024* + +* [Fix] Fixed a bug in the FK relationships update routine that was causing more relationships to be deleted than what really needed to be. +* [Fix] Fixed a crash when creating a many-to-many relationship where one or more columns of the involved primary keys use generated default values (GENERATED AS). +* [Fix] Fixed a bug in the routine that updates relationships' generated objects that was causing the application to hang up when importing a simple hierarchy of tables. + +v1.1.5 +------ +*Release date: October 28, 2024* + +* [New] Added support for PostgreSQL 17. +* [Fix] Fixed the catalog queries of collation and domain objects for PostgreSQL 17. +* [Change] Disabling objects' grids in TableWidget when the edited table is protected. + +v1.2.0-alpha1 +------ +*Release date: October 25, 2024* + +* [New] Added support for PostgreSQL 17. +* [New] Added support for tabbed table data handling. +* [New] Added an option in LayersConfigWidget that makes relationships follow tables visibility. +* [New] Added support for quickly creating a new layer and assigning it to the selected objects in ModelWidget. +* [New] Added support for the removal of recent models that aren't accessible anymore. +* [New] Added support for transactional export in pgmodeler-cli. +* [New] Added support for transactional export in ModelExportForm. +* [New] Added support for running diff code in a transaction. +* [New] Added support for displaying FK's update/delete actions in the data dictionary. +* [New] Added a confirmation message in ModelExportForm when exporting to DBMS with one of the drop options set. +* [New] Added the method CodeCompletionWidget::identifyObjectType. +* [New] Added the method CustomTableWidget::setSortingEnabled. +* [New] Added the signal CustomTableWidget::s_rowCountChanged. +* [New] Added support for ccache tool in the compilation process on Linux. +* [New] Added a new version of Messagebox::error. +* [New] Added the method CustomTableWidget::addCustomButton. +* [New] Added the method SQLExecutionHelper::getCommand. +* [New] CustomTableWidget now allows the removal of multiple rows at once. +* [New] Added the method CustomTableWidget::setAddRowOnTabPress. +* [New] Added the methods CustomTableWidget::setVerticalHeaderVisible and CustomTableWidget::updateVerticalHeader. +* [New] Created the slot SQLExecutionWidget::runSQLCommand(QString). +* [New] Created the struct PgModelerGuiPlugin::PluginWidgets. +* [New] Added support for plugin widgets in SQLExecutionWidget. +* [New] Added the methods registerPlugin, createWidgets, getPluginsActions, getPluginsToolButtons on PgModelerGuiPlugin. +* [Change] Removed the support for Qt 6.2 and 6.3. +* [Change] Improved the CodeCompletionWidget in such a way as to correctly suggest names in ALTER/DROP commands depending on the objects being handled. +* [Change] Minor refactor in BaseObject::getChildObjectTypes. +* [Change] Minor change in method BaseObject::getObjectType by adding the paramenter is_sql_name. +* [Change] Minor improvement in CodeCompletionWidget in order to trigger completion in the presence of more keywords. +* [Change] Minor adjustment in sql-highlight.conf. +* [Change] Minor change in methods copySelection and generateBuffer in SQLExecutionWidget. +* [Change] Minor change in CustomTableWidget::addRow that now returns the id of the row added. +* [Change] The file selection dialog now starts on the user's home by default and saves that last accessed directory, using it the next time it is opened. +* [Change] Minor adjustment in DataManipulationForm and TableDataWidget to use signals customContextMenuRequested when displaying items context menus. +* [Change] Changed the signature of some methods in CustomTableWidget. +* [Change] Renamed ObjectsTableWidget to CustomTableWidget +* [Change] Refactored MainWindow, PluginsConfigWidget, SQLToolWidget, and SQLExecutionWidget to use the new structure of PgModelerGuiPlugin for extra features inclusion. +* [Change] Moved the layers selection widget from the popup menu to a standalone dialog. +* [Change] Refactored the GuiUtilsNs::getHoveredWidgetCorner and GuiUtilsNs::resizeFloatingWidget. +* [Change] Materialized views and constraint trigger will ignore the option "Replace modified" option in diff. +* [Change] Avoid adding the "OR REPLACE" keywords to constraint triggers code. +* [Change] Improved the resizing of floating widgets via mouse move by creating the functions GuiUtilsNs::getHoveredWidgetCorner and GuiUtilsNs::resizeFloatingWidget. +* [Change] Minor adjustment in dark theme color palette. +* [Change] Disabling objects' grids in TableWidget when the edited table is protected. +* [Change] Minor adjustment in the diff_opts size in ModelsDiffHelper. +* [Change] Refactoring the SQL schema files including the use of the new special keyword @include to diminish code duplication. +* [Change] Minor update on attributes translations in DatabaseExplorerWidget. +* [Fix] Fixed the catalog queries of collation and domain objects for PostgreSQL 17. +* [Fix] Minor bug fix in code generation of tablespace, database, and user mapping objects. +* [Fix] Minor fix in SQLExecutionWidget::generateBuffer. +* [Fix] Minor fix in SQLExecutionWidget::generateCSVBuffer to consider the check state of items during CSV buffer generation. +* [Fix] Minor fix in SyntaxHighlighter to use default window text color if no foreground color is defined for a group in the syntax highlight config file. +* [Fix] Minor fix to avoid flickering when hiding widgets that lie in splitters. +* [Fix] Minor fix in the object search feature when searching by source/referenced constraint columns. +* [Fix] Minor fix in ObjectListModel to allow sorting the ID column as an integer value. +* [Fix] Fixed a bug in Function that was not resetting SETOF flag when changing to return table mode. +* [Fix] Fixed a malformed markdown code when the table/view has a comment. +* [Fix] Fixed a bug in ModelsDiffHelper that was ignoring changes in columns. +* [Fix] Fixed a crash in DatabaseImportHelper when destroying detached inherited columns. +* [Fix] Fixed a bug in Catalog::getCommentQuery that was crashing the application while trying to retrieve user mapping comments. +* [Fix] Minor fix in SchemaParser to avoid breaking the parsing when there are two or more @include statements on each row. +* [Fix] Fix a bug in the Index class that was preventing the removal of included columns. + +v1.1.4 +------ +*Release date: August 21, 2024* + +* [Fix] Fixed a bug in the function object that was not resetting the SETOF flag when changing the return type to TABLE. +* [Fix] Fixed a crash in the database import process when destroying detached inherited columns. +* [Fix] Fixed a bug in the system catalog query class that was crashing the application while trying to retrieve user mapping comments. +* [Fix] Fix a bug in the index object that was preventing the removal of included columns. + +v1.2.0-alpha +------ +*Release date: June 24, 2024* + +* [New] Added support for @include statements in schema micro language. +* [New] Added the support for Markdown data dictionaries in ModelExportForm. +* [New] Added the option "--markdown" to PgModelerCliApp to allow generating markdown data dictionaries. +* [New] Added support to convert meta chars to escaped (and vice-versa) in pgmodeler-se/SourceEditorWidget. +* [New] Added support for contiguous escaped metachars in schema microlanguage files, e.g., \s\t\n. Contiguous metachar are also allowed, e.g., $tb$sp$br despite the poor readability. +* [New] Created the method GlobalAttributes::getDictSchemaFilePath. +* [New] Added support for using escaped \[ and \] in the middle of plain text expressions in schema microlanguage. +* [New] Added the method TextBlockInfo::removeFragmentInfo. +* [New] Created the struct SyntaxHighlighter::MatchInfo that holds the start and end positions of a match. +* [New] Created the class FragmentInfo that holds some info about formatted text fragments. +* [New] Added support for escaped characters in SchemaParser the valid ones are: \s (space), \t (tab), \n (line feed), \[, \], \{, \}, \$, \#, \%, \@, \&, \\, \*. +* [New] Added support for toggling comments on pgmodeler-se/SourceEditorWidget. +* [New] Added the method GlobalAttributes::getPgModelerBaseVersion. +* [New] Created the variadic template method GlobalAttributes::getFilePath. +* [New] Added the folder datadict/html and datadict/md to separate HTML data dictionaries from MD data dictionaries. +* [New] Added support for data dictionaries in Markdown format. +* [New] Added support for saving the status of the "Replace modified objects" option in diff presets. +* [New] Added the option ModelsDiffHelper::OptReplaceModified that toggles the replacement of objects that accept CREATE OR REPLACE. +* [New] Added the fields in ViewWidget to handle check_option, security_invoker, and security_barrier options +* [New] Objects that can be created with "CREATE OR REPLACE" are now having their DDL generated with "OR REPLACE". +* [Change] Removed the restriction of specifying OUT parameters in procedures. +* [Change] Refactored schema files of HTML data dicts to use the include statement. +* [Change] SourceCodeWidget now generates code on demand, when the current source code type tab changes. +* [Change] Moved the type strings from translation units in libcore/pgsqltypes/* to their respective class definition. +* [Change] Refactored static members initializations to C++17 style, e.g., inline static Type member {value}. +* [Change] Removed static members initialization from translation units. +* [Change] Refactored the syntax highlight config files. +* [Change] Minor adjustment in SyntaxHighlighter::matchExpression to avoid adding duplicated match infos to the list. +* [Change] Removed the "defaults" folder from assets/conf to avoid duplicate files. This directory will be created via make install according to the settings in pgmodeler.pro +* [Change] Adjusted SyntaxHighlighter::highlightBlock to allow nested multiline expressions, e.g. [" "], to replace each other. +* [Change] Several changes in SyntaxHighlighter methods involved highlighting to return key struct in the form of const * to avoid excessive copies. +* [Change] Minor change in source-code-highlight.dtd making the element optional. +* [Change] The SyntaxHighlighter::highlightBlock routine is way more simple, and the configuration file structure has been simplified as well. +* [Change] Removed unused enum and methods in TextBlockInfo +* [Change] Adjusted the format group loading from file in SyntaxHighlighter::loadConfiguration. +* [Change] Converted char attributes in SchemaParser to QChar. +* [Change] Replaced switch statements by ifs in several parts of SchemaParser to handle QChars instead of char. +* [Change] Refactor in ModelExportForm to handle MD format in data dictionaries. +* [Change] Refactored the methods in PgModelerPlugin that returns file paths to use GlobalAttributes::getFilePath. +* [Change] Refactored GlobalAttributes::getTmplConfigurationFilePath and GlobalAttributes::getSchemaFilePath to use GlobalAttributes::getFilePath. +* [Change] Now pgModeler, in the first run, will try to copy the configuration files from a previous major version immediately before the current one. For example, running 1.2 the files to be copied will be from 1.1 not from 0.9.4 anymore. +* [Change] Dropped the support for "Forced object recreate" in ModelDatabaseDiffForm and ModelsDiffHelper. The option was confusing and was generating a diff code that was similar to generating the entire SQL of a model and re-export it to a server. So, it was considered not so useful anymore. +* [Change] Changed the Function::getAlterCode and Procedure::getAlterCode to stop generating CREATE OR REPLACE command, this will now be generated by ModelsDiffHelper. +* [Change] Minor layout adjustment in ViewWidget. +* [Change] Minor adjustment in TemplateType::setType to include extra information when raising exceptions. +* [Change] Minor adjustment in changelog entry validation in DatabaseModel::addChangelogEntry. +* [Fix] Minor fix in Application::createUserConfiguration to avoid trying to copy legacy configs when older version configurations don't exist. +* [Fix] Minor fix in SchemaParser::isSpecialCharacter to include CharStartEscaped as a special char. +* [Fix] Fixed all getDataDictionary methods to be able to generate data dictionaries for both HTML and MD formats +* [Fix] Fixed a bug in SyntaxHighlighter::loadConfiguration that was not properly setting regular expressions as case-sensitive. +* [Fix] Fixed a bug in PgModelerApp::createUserConfiguration that was not copying missing files correctly. +* [Fix] Fixed build process on windows. +* [Fix] Minor fix in SyntaxHighlighter::setFormat and SyntaxHighlighter::highlightBlock. +* [Fix] Fixed a crash in SchemaParser::evaluateComparisonExpr when a portion of a string value is commented out. +* [Fix] Minor adjustment in tooltips in modelexportform.ui. +* [Fix] Minor fix in GlobalAttributes::setSearchPath to set the path from the environment variable APPDIR when building an ApppImage. +* [Fix] Minor fix in CodeCompletionWidget::configureCompletion where the elements of keywords are treated. +* [Fix] Minor fix in HTML data dictionary schema files. +* [Fix] Fixed a bug in SchemaParser that was generating syntax errors when comment character # was put inside the plaintext operator []. +* [Fix] Fixed a bug in SchemaParser::getAttribute. +* [Fix] Minor fix in datadicttest. +* [Fix] Fixed the method SchemaParser::loadBuffer to parse commented lines as empty ones to keep the line numbers from the original buffer/file synchronized with the resulting parsed schema buffer. +* [Fix] Adjusted the syntax highlight conf to be used when loading a file in SourceEditorWidget. +* [Fix] Minor layout adjustment in ModelExportForm. +* [Fix] Minor fix in HtmlItemDelegate::paint when rendering items without icons and with multiple text lines. +* [Fix] Fixed a shortcut conflict in SearchReplaceWidget. +* [Fix] Minor fix in PgModelerCliApp::recreateObjects to warn about invalid changelog entries avoiding aborting the model fix process. +* [Fix] Fixed a bug in Catalog class that was not retrieving comments of sequences causing false-positive to be generated in diff process. + +v1.1.3 +------ +*Release date: May 13, 2024* + +* [New] Added an option to toggle the display of the mouse position, zoom, and object selection information. +* [Change] Minor adjustment in UI stylesheets of the scene info widget. +* [Change] Adjust the scene info widget layout to diminish the components wobbling when moving objects. +* [Change] Minor adjustment in changelog entry validation in the database model. +* [Fix] Fixed a shortcut conflict in the text search/replace widget. +* [Fix] Minor fix in the database model objects recreation process (during model fix operation) to warn about invalid changelog entries avoiding aborting the entire model fix process. +* [Fix] Fixed a bug in the catalog class that was not retrieving comments of sequences causing false-positive to be generated in diff process. + +v1.1.2 +------ +*Release date: April 08, 2024* + +* [New] Added a sample model of the famous northwind database ported to PostgreSQL. +* [Change] Updated the sample model pagila.dbm. Now it uses the table partition feature. +* [Change] Minor adjustment in the SQL execution widget to notify the OS and blink the taskbar after running a SQL command while the main window is minimized. +* [Change] The command-line interface tool had its menu texts reviewed. +* [Change] The view editing form now displays an alert regarding extra semicolons at the end of the definition command. +* [Change] Disabled the cached object code in DatabaseExplorerWidget::loadObjectSource. +* [Fix] Minor text correction in SQLExecutionWidget. +* [Fix] Fixed a bug in the generation of SQL for roles when no option is set. +* [Fix] Fixed a bug in the automatic name truncation/disambiguation for long names in CoreUtilsNs::generateUniqueName. +* [Fix] Minor fix in the code completion widget to select the first visible item in the list. +* [Fix] Fixed a bug in the generation of the command COMMENT ON CONSTRAINT. +* [Fix] Minor fix in libcli/CompatNs::convertToNewView to correctly extract the SQL definition of views with disabled code. +* [Fix] Fixed the generation of view's SQL to ignore extra semicolons at the end of the command. + +v1.1.1 +------ +*Release date: March 14, 2024* + +* [New] Added an XML code searching widget in SourceCodeWidget. +* [New] Added an option to place in random positions objects that are imported to a working model. +* [New] Created the methods Connection::isServerSupported and Catalog::isServerSupported. +* [New] Added alerts on DatabaseImportForm and ModelDatabaseDiffForm about unsupported server versions. +* [Change] Renamed ObjectFinderWidget to ObjectSearchWidget for better semantics. +* [Change] Renamed the button "Find objects" to "Search" in MainWindow. +* [Change] Renamed the widget FindReplaceWidget to SearchReplaceWidget for better semantics. +* [Change] pgModeler will not change the positions of the original objects in a model when importing new objects to that model. +* [Change] Adjusted the split layout that resizes ModelValidationWidget and ObjectFinderWidget in MainWindow. +* [Change] Adjusted the splitters handlers appearance via stylesheets. +* [Change] Minor adjustments on some widgets' layout margins. +* [Change] Minor layout adjustment in modeldatabasediffform.ui by moving the export and import options to dedicated group boxes. +* [Change] Minor improvement in Catalog::getObjectNames to include a signature attribute in the returned attributes map of each object. +* [Change] Minor adjustment in DatabaseExplorerWidget::updateItem. +* [Change] Moved the (set|get)ParentRelationship methods from Column to TableObject. +* [Change] Now in CodeCompletionWidget::adjustNameListSize when the list is empty the widget size will have a minimum size. +* [Change] Minor improvement in CodeCompletionWidget to avoid repeatedly querying system catalogs having the list already filled. The list is cleared and repopulated only if the cursor position gets back to the initial position when the method show() was called. +* [Change] Set the horizontal scroll bar off in the tree widget of ModelObjectsWidget. +* [Fix] Fixed the code generation for policies. +* [Fix] Minor adjustment in the enabled status toggling of several widgets in DatabaseImportForm. +* [Fix] Fixed the behavior of the "Auto browse" attribute of connections in DatabaseImportForm and ModelDatabaseDiffForm. +* [Fix] Fixed the method ModelWidget::eventFilter to force horizontal scene movement when the Shift key is held and the mouse wheel movement is made. +* [Fix] Minor layout fix in referenceswidget.ui. +* [Fix] Minor error message fix on MainWindow::showFixMessage. +* [Fix] Minor fix in MainWindow::loadModels. +* [Fix] Minor fix in Messagebox::alert to include an optional exception to be displayed. +* [Fix] Fixed a crash in TableWidget when handling foreign tables. +* [Fix] Fixed a QObject::connect warning regarding null parameter in ObjectSearchWidget::findObjects. +* [Fix] Fixed the partial diff/import filtering which was ignoring a wildcard pattern and listing all objects. +* [Fix] Minor fix in NumberedTextEditor::pasteCode. +* [Fix] Fixed a bug when importing collations with the ICU provider. +* [Fix] Minor workaround in ObjectRenameWidget to be displayed with the name input focused but the contents of that field deselected. +* [Fix] Minor fix in ModelWidget::pasteObjects. +* [Fix] Fixed the relationship conversion feature to preserve the original layer and line color information on the converted objects. +* [Fix] Minor fix in Relationship class to set the parent relationship attribute on all generated constraints. +* [Fix] Minor fix in CodeCompletionWidget to properly list column names when using non-schema-qualified table names in INSERT/DELETE commands. +* [Fix] Fixed a bug in code generation of generic SQL objects. + +v1.1.0 +------ +*Release date: February 23, 2024* + +* [New] Created the method Application::loadTranslations. +* [New] FindReplaceWidget now accepts ENTER/RETURN to search texts. +* [New] Added the method MainWindow::registerRecentModels. +* [New] Adding support for table name completion on ALTER/DROP commands in CodeCompletionWidget. +* [New] Added the methods PgModelerCliApp::(set|get)ParsedOptValue. +* [New] pgModeler CLI now supports plugins. +* [New] Created the method GuiUtils::updateDropShadow. +* [New] Create the method BaseFunction::isBaseFunction. +* [New] Now during object copy/paste or duplication, in case of name conflict, the user is asked to type a new name for each conflicting object. +* [New] Adding the ability to restore the scene rect from the database model file. +* [New] Adding support to expand canvas rect via the main window. +* [New] Added the method FileSelectorWidget::setAppendSuffix. +* [New] Added support for infinite canvas. +* [Change] Minor adjustment in BaseObjectWidget::configureFormFields. +* [Change] Moved the code that loads plugins' translations from PgModelerApp to Application::loadTranslations. +* [Change] Updated the pgmodeler-intl.pro +* [Change] The libutils/PgModelerPlugin class is now a base class of the new classes libgui/PgModelerGuiPlugin and libcli/PgModelerCliPlugin. +* [Change] The subproject pgmodeler-cli now uses the classes in libcli. +* [Change] Moved PgModelerCliApp to a dedicated library (libcli) to allow the proper creation of plugins for pgmodeler-cli. +* [Change] Removed extra frames in pluginsconfigwidget.ui, connectionsconfigwidget.ui and snippetsconfigwidget.ui. +* [Change] Minor adjustment in GeneralConfigWidget to change the enabled state of the "Reset alerts" button on the widget show. +* [Change] Removed the confirmation dialog in ModelWidget::copyObjects related to copying dependencies. Now the copy of dependencies during the copy of an object is triggered by the shortcut Ctrl+Shift+C (copy selection and dependencies) or Ctrl+Shift+X (cut selection and dependencies). +* [Change] Removed unneeded throw instruction in widget ctors. +* [Change] Minor improvement in ModelObjectsWidget::saveTreeState/restoreTreeState to correctly restore the vertical scrollbar position. +* [Change] Minor adjustment in MainWindow::applyConfigurations to correctly update grid settings on the current model. +* [Change] Minor adjustment in ModelWidget::finishSceneMove. +* [Change] Minor adjustment in ObjectsScene::setSceneRect to emit s_sceneRectChanged only when the new rect differs from the current one. +* [Change] Removed unneeded calls to QGraphicsView::resetCachedContent in ModelWidget. +* [Change] Forcing the drop shadows update in MainWindow::setCurrentModel every time the current model changes. +* [Change] Minor adjustment in debug message related to model loading time. +* [Change] Minor adjustment in ModelWidget::pasteObjects to avoid showing the rename widget when pasting table child objects. +* [Change] Moved the function GuiUtilsNs::formatMessage to UtilsNs. +* [Change] Minor adjustment in the example.dbm. +* [Change] Minor adjustment in ObjectsScene::getPagesForPrinting to return the correct page size so the page delimiters can be displayed on all edges. +* [Change] Refactored the method ObjectsScene::adjustSceneRect to get more accurate results. +* [Change] Adjusted the default size of StyledTextboxView. +* [Change] Changed the method FileSelectorWidget::getSelectedFile in such a way as to append the default suffix when the user types a filename that has no extension. +* [Change] Minor adjument in FileSelectorWidget usage in ModelDatabaseDiffForm, ModelExportForm and ModelFixForm. +* [Change] Changed the parent class of RoundedRectItem from QGraphicsRectItem to QAbstractGraphicsShapeItem due to the incorrect bounding rect returned when the rounded rect is null (all coordinates set to 0). This was causing undesired results when retrieving scene items' bounding rect. +* [Change] Adjusted the method ObjectsScene::getPagesForPrinting to cover infinite canvas. +* [Change] Minor adjustment in the stylesheet of NewObjectOverlayWidget. +* [Change] Removed the origin point locks at (0,0) in ObjectsScene. +* [Change] Changes in ModelOverviewWidget to handle the infinite canvas. +* [Fix] Fixed the plugins' loading process by ignoring the ones that don't implement the correct interface (PgModelerCliPlugin or PgModelerGuiPlugin). +* [Fix] Fixed a bug in MainWindow::loadModel that was not registering the loaded file as a recent model. +* [Fix] Fixed a malformed diff code when adding a column to a partitioned table. +* [Fix] Fixed a bug in MainWindow::updateRecentModelsMenu. +* [Fix] Fixed a bug in GeneralConfigWidget::loadConfiguration to reset alerts when the parameter "use default disambiguation" is absent. +* [Fix] Minor fix in ConnectionsConfigWidget that was preventing connections from being updated in MainWindow after editing them. +* [Fix] Minor fix in ModelWidget to build in Qt 6.2.x. +* [Fix] Minor fix in ModelWidget::pasetObjects to correctly paste table/view child objects in the destination parent table/view. +* [Fix] Fixed the disconnect call in ObjectRenameWidget::setAttributes. +* [Fix] Minor fix in ModelWidget::startSceneMove to reset viewport cached content. +* [Fix] Minor fix on ObjectsScene::drawBackground in order to draw the canvas background in the correct color defined in the settings. +* [Fix] Minor fix on all classes derived from BaseConfigWidget to correctly control the config changed status on loadConfiguration and saveConfiguration. +* [Fix] Fixed a bug that was preventing tables and schemas from being updated graphically when adding/removing relationships in some circumstances. +* [Fix] Fixed a bug in ModelWidget::copyObjects related to copying/pasting multiple objects. +* [Fix] Minor fix in ModelWidget::pasteObjects when pasting copied functions. +* [Fix] Minor fix in graphical objects tooltips in libcanvas. +* [Fix] Fixed the trigger catalog query to avoid referencing tgparentoid field when importing from PostgreSQL 12 or below. +* [Fix] Minor fix in MainWindow to adjust the scene size every time an operation (undo/redo) is performed in the operation list. +* [Fix] Minor fix in ObjectsScene::drawBackground to avoid the undesired shifting on the page delimiters. +* [Fix] Minor fix in SchemaView to avoid leaving the selection rectangle visible in the constructor. +* [Fix] Minor fix in ObjectsScene::expandSceneRect. +* [Fix] Fixed the PNG export process in GUI and CLI to handle infinite canvas. +* [Fix] Fixed a bug in ModelFixForm that was not locating pgmodeler-cli on Windows. +* [Fix] Fixed a bug in ObjectsFilterWidget that was setting wrong object types when doing a partial diff using filters generated from the changelog. +* [Fix] Minor fix in CodeCompletionWidget in order to list columns of tables non-schema qualified. In that case, pg_catalog and public will be used as default schemas. +* [Fix] Columns marked as PK are now restored when handling them in TableWidget. + +v1.1.0-beta1 +------ +*Release date: December 30, 2023* + +* [New] Added the method Operation::getOperationInfo that returns some info (in the form of a struct) of an operation in read-only format. +* [New] Created static methods error, info, and alert in Messagebox. +* [New] Added support for custom font size in NumberedTextEditor/SyntaxHighlighter. This way UI elements that use objects of these classes in database object forms can keep the font size uniform even if the user has configured a different font size for source code inputs in SQL tool, for example. +* [New] Added support for displaying a "Blog post" button in UpdateNotifierWidget. +* [New] Added the method SQLToolWidget::moveExecutionTab. +* [Change] Minor adjustment in ConnectionsConfigWidget openConnectionsConfiguration to return true when the user applies new connection settings or restores original connections by clicking "Cancel". +* [Change] Adjusted the usage of ConnectionsConfigWidget::openConnectionsConfiguration on DatabaseImportForm, ModelDatabaseDiffForm, ModelValidationWidget and SQLToolWidget. +* [Change] Minor improvement on SwapObjectsIdsWidget to preserve the sorting parameters after swapping object ids. +* [Change] Minor change in ConnectionsConfigWidget, ModelExportForm, ModelValidationWidget related to the use of ConnectionsConfigWidget::openConnectionsConfiguration. +* [Change] Minor improvement in Messagebox::error method in order to allow the user to specify the local in the code where the error occurred using __PRETTY_FUNCTION__, __FILE__ and __LINE__. +* [Change] Moved the definition of template method BaseForm::setMainWidget to the outside of the class definition. +* [Change] Refactored OperationListWidget::updateOperationList to use OperationInfo struct. +* [Change] Minor change in operationlistwidget.ui to use icons instead of labels for operation list size and current history position. +* [Change] Refactored the method ModelWidget::openEditingForm(QWidget*,Messagebox::ButtonId) turning it into a template method so the internal call to BaseForm::setMainWidget can be correctly used. +* [Change] Changed the method BaseForm::setMainWidget that takes a BaseObjectWidget instance to be enabled only if a class that is inherited from BaseObjectWidget is passed as a parameter. +* [Change] Refactored signal/slot connections that needed exception handling all over the tool. +* [Change] Minor adjustment in MainWindow::addModel to avoid marking the model as invalidated even if it's new/empty. +* [Change] Minor adjustment in CodeCompletionWidget to include sequences when listing living db objects. +* [Fix] Fixed the catalog query operator.sch so argument data types can have the schema name prepended. +* [Fix] Fixed a crash when trying to display function/procedure source code that references a domain in the parameters. +* [Fix] Fixed the catalog queries for function and procedure to correctly format parameters' data type signatures. +* [Fix] Fixed a problem in SwapObjectsIdsWidget::eventFilter that was not capturing arrow key press on macOS. +* [Fix] Fixed a bug in the importing of partitioned table indexes which was affecting the results produced by the diff process. +* [Fix] Fixed a bug in CodeCompletionWidget that was crashing when trying to list columns of an alias related to a table not schema-qualified. +* [Fix] Fixed a bug in reverse engineering related to the importing of partition tables hierarchy. +* [Fix] Fixed a bug in diff that was generating false-positive results for columns with the same user-defined type. +* [Fix] Fixed a bug in LineNumbersWidget that was not aligning the line numbers with their respective lines when the font size was different from the default. +* [Fix] Minor fix in XmlParser::readBuffer to use a const xmlError * instance instead of non-const. +* [Fix] Minor fix in CodeCompletionWidget to avoid the displaying of the widget in a position that extrapolates the screen limits. +* [Fix] Minor fix in the icon positioning in HtmlItemDelegate. + +v1.1.0-beta +------ +*Release date: November 17, 2023* + +* [New] Added a compatibility code in pgmodeler-cli to enable the conversion of views in the legacy structure to the newer one. +* [New] Added support for handling object references in ViewWidget. +* [New] Added support for NULLS NOT DISTINCT attribute in unique constraints and indexes. +* [New] Added support for overriding the bg color when exporting the model to PNG. +* [New] Added a grid widget in ExtensionWidget to inform the child data type names. +* [New] Added a new method for the application path relocation by using an auxiliary file pgmpaths.conf that holds the env variables that customize assets/executables paths in pgModeler. +* [New] Added a SQL definition tab and a new References tab that will work like references in GenericSqlWidget in ViewWidget. +* [New] Added a step in PgModelerCliApp::fixObjectAttributes to add a tag in that has the deprecated handle-type attribute. +* [New] Added missing pseudo-types. +* [New] Added the class SimpleColumnsWidget to handle the view's columns. +* [New] Added the methods isReferenced and hasDependencies in BaseObject. +* [New] Added the method BaseObject::isDependingOn and BaseObject::isReferencedBy. +* [New] Added the method GenericSQL::addObjectReferences. +* [New] Added the method GenericSQL::setHideDescription that toggles the SQL code comment that indicates the object name/type. +* [New] Added the method ObjectsTableWidget::getCellTextss. +* [New] Added version descriptor for PostgreSQL 16. +* [New] Adding field ref_alias to GenericSQL::ObjectReference. +* [New] Created the method GlobalAttributes::init and added a call to it on all executable subprojects. +* [New] Created the widget ObjectReferencesWidget that handles GenericSQL references. +* [New] DatabaseImportHelper now imports extensions with the child types attached. +* [New] Extension object now stores the name of the child types. +* [New] In DatabaseModel, extension data types are automatically added/removed as the parent extension is added/removed from the model. +* [New] The corner button in SQLToolWidget which adds a new SQL execution tab is now positioned aside from the last tab open. +* [New] Validating the extension child types before adding the extension to the database model. +* [Change] Adjusted objectdepsrefswidget.ui to make the "Display unique results" option checked by default. +* [Change] Adjusted the class GenericSQL::Reference to use reference alias. +* [Change] Adjusted the class ObjectReferencesWidget to use reference aliases. +* [Change] Adjusted the CSV pasting in TableDataWidget. +* [Change] Adjusted the DatabaseExplorerWidget::formatExtensionAttribs to display types related to an extension. +* [Change] Adjusted the DLL export symbols to Reference and SimpleColumn (windows only). +* [Change] Adjusted the DTD and schema file for tag +* [Change] Adjusted the DTD files view.dtd, genericsql.dtd, dbmodel.dtd, object.dtd +* [Change] Adjusted the methods formatOidAttribs, getObjectName, getObjectNames in DatabaseExplorerWidget to accept a list of types. +* [Change] Adjusted the SCH files view.sch, genericsql.sch, reference.sch, object.sch. +* [Change] Changed the struct SimpleColumn into a class due to the increase in the code complexity +* [Change] CodeCompletionWidget now resizes according to the displayed items' width. +* [Change] Code completion will not display a "no items found" popup if no element is found matching the word at the cursor's position. +* [Change] DatabaseModel::updateViewRelationships now use the new view references to create relationships. +* [Change] GenericSQL class now uses tags instead of to store references in XML. +* [Change] GenericSQL::ObjectReferece renamed to GenericSQL::Reference and turned into a class. +* [Change] In relationshipconfigwidget.ui the images change with the selected theme. +* [Change] Minor adjustment in icons-*.conf +* [Change] Minor adjustment in ReferencesWidget to always display the signature of the object in the grid instead of the name. +* [Change] Minor adjustment in the behavior of source code display in DatabaseExplorerWidget. +* [Change] Minor adjustment in themes' appearance.conf +* [Change] Minor adjustment on ui style conf files. +* [Change] Minor change in reverse engineering to avoid importing extension child types into the model since the extension itself, when imported, already creates the types. +* [Change] Minor default size adjustment in TableWidget and ViewWidget. +* [Change] Minor refactor in DatabaseModel::createGenericSQL. +* [Change] Minor refactor in GenericSQL, GenericSQLWidget, ObjectReferencesWidget to use getters of GenericSQL::Reference. +* [Change] Minor refactor in ObjectReferencesWidget/GenericSQL::Referece to use a flag that indicates that view columns must be generated from the references. +* [Change] Minor refactor on View, Reference, and ReferenceWidget classes. +* [Change] Moved GenericSQL::Reference to dedicated source files. +* [Change] Moved the code that set the Qt UI style to the Application class. +* [Change] Refactored GenericSQLWidget in such a way to use ObjectReferencesWidget. +* [Change] Refactored View::generateColumns to generate columns from the new reference object. +* [Change] Removed CTE tab from ViewWidget. +* [Change] Removed deprecated method GenericSQL::getReferencedObjects. +* [Change] Removed the const UserTypeConfig::ExtensionType. +* [Change] Renamed ObjectReferencesWidget.(h|cpp) to ReferencesWidget.(h|cpp) +* [Change] Updated View XML definition to store simple column's code. +* [Fix] Fixed settings storing for the grid options in MainWindow. +* [Fix] Fix a crash that happens only on Windows. +* [Fix] Fixed a bug in the generation of diff commands for identity columns. +* [Fix] Fixed a bug in HtmlItemDelegate::paint that was causing the rendering of artifacts. +* [Fix] Fixed a bug in pgmodeler-cli that was aborting the fix process during the parsing of the model changelog. +* [Fix] Fixed a bug in SchemaParser that would cause an infinite loop when defining attributes via %set instruction combined with plain text operator [] +* [Fix] Fixed a crash when trying to load an invalid model from the recent model's menu. +* [Fix] Fixed sample model structure to the new view's format. +* [Fix] Fixed several bugs in CodeCompletionWidget when completing using live database object names. +* [Fix] Fixed the method BaseTable::updateDependencies() to avoid duplicating dependencies. +* [Fix] Fixed the method DatabaseImportHelper::createView in such a way as to create references to tables/views and the columns that the view owns. +* [Fix] Minor fix in DatabaseImportHelper to correctly make a view reference another. +* [Fix] Minor fix in MainWindow::loadModels. +* [Fix] Minor fix on DatabaseModel::createRelationship to create a relationship between two views. + +v1.0.6 +------ +*Release date: October 17, 2023* + +* [New] Added version descriptor for PostgreSQL 16. +* [Fix] Fixed a crash when trying to load an invalid model from recents models menu. +* [Fix] Fixed a bug in generation of diff commands for identity columns. +* [Fix] Minor fix in PgModelerCliApp::extractObjectXML to restore correctly the layers names and count. +* [Fix] Fixed a crash when double-clicking the overview widget. + +v1.1.0-alpha1 +------ +*Release date: September 29, 2023* + +* [New] Added version descriptor for PostgreSQL 16. +* [New] Added support for highlighting table child objects in ObjectFinderWidget. +* [New] Added the method BaseTableView::setChildSelected. +* [New] Added support for resizing the text boxes in the model using Shift + mouse movement. +* [New] Created the method generateHashCode in TableObject and its derived classes. +* [New] Added the method BaseObject::getLinkedObjects. +* [New] Added the method AppearanceConfigWidget::getUiLightness. +* [New] Created the utility function CoreUtilsNs::filterObjectsByType. +* [New] Added the method BaseObject::setClearDepsInDtor to determine whether the dependencies/references should be undone when destroying an object. +* [New] Created a simplified mechanism for mapping dependencies and references between objects improving the performance of several parts of the tool. +* [New] Created the function UtilsNs::getStringHash and replaced all uses of QCryptographicHash by that function. +* [New] Added an option to ObjectDepsRefsWidget that toggles the display of unique results. +* [New] Created the class CustomSortProxyModel that preserves the vertical header line number when sorting an ObjectsListModel. +* [New] Created the method GuiUtilsNs::updateObjectsTable(QTableView *, std::vector). +* [New] Created the method ObjectsListModel::fillModel. +* [New] Added the methods BaseObject::getSearchAttributeI18N and BaseObject::getSearchAttributesI18N. +* [New] Added the method BaseObject::acceptsComment. +* [New] Added support for caching the object names to avoid unnecessary formatting/validation. +* [New] Added the method BaseGraphicObject::setUpdatesEnabled to control whether the *::configureObject must be called to configure the graphical objects. +* [New] Added support for inksaver color theme. +* [New] Added support for using object comments as aliases in database import. +* [New] Added an option in GeneralConfigWidget to reset the exit alert display status. +* [New] Added the method GeneralConfigWidget::appendConfigurationSection. +* [New] Created the class ObjectsListModel to be used by any QTableView that is supposed to display objects listing. +* [New] Add support for remembering decisions on the alerts regarding unsaved models/open SQL tabs. +* [New] Added the method SQLToolWidget::ignoreAutoBrowseFlag. +* [New] Added the method SQLExecutionWidget::getSQLCommand. +* [New] Added the methods SQLToolWidget::getExecutionTabs. +* [New] pgModeler now asks the user about closing SQL execution tabs that are not empty (with typed commands). +* [New] Added a basic form to inspect changelog XML code. +* [New] Added a static method AppearanceConfigWidget::getUiThemeId that returns the current configured theme. +* [New] Added missing multirange types. +* [New] Added shortcuts Shift+Up and Shift+Down to control the Z-stack operations in ModelWidget. +* [Change] Adjusted the objects' movement using arrow keys in the object scene. +* [Change] Adjusted the PostgreSQL Version to 15 in pgmodeler.pri (only macos). +* [Change] Minor adjustment in ModelDatabaseDiffForm to exclude columns when using "any" filter. +* [Change] Replaced the use of DatabaseModel::getObjectReferences by BaseObject::getReferences +* [Change] All objects' dependencies/references retrieval methods were removed from DatabaseModel due to the new way to control/retrieve dependencies/references via the BaseObject class. +* [Change] Refactored DatabaseImportHelper::destroyDetachedColumns to use BaseObject::getReferences. +* [Change] Removed the method DatabaseModel::validateColumnRemoval. +* [Change] Changed DatabaseModel::__removeObject to use the new BaseObject::getReference. +* [Change] Changed ModelValidationHelper::validateModel to use BaseObject::getReference. +* [Change] Changed ModelWidget::copyObjects to use BaseObject::getDependencies. +* [Change] Minor adjustment in ModelWidget destructor. +* [Change] Minor adjustment in DatabaseModel destructor. +* [Change] Adjusted several virtual methods signatures. +* [Change] Refactored UserTypeConfig and PgSqlType to make use of BaseObject/DatabaseModel pointers instead of raw (void) pointers to configure user-defined types based on database model objects. +* [Change] Adjusted the font size for layer rects. +* [Change] Minor adjustment in DatabaseModel::validateSchemaRenaming. +* [Change] Improved the relationship point addition via mouse clicks. +* [Change] Minor adjustment in DatabaseModel::setObjectsModified. +* [Change] The "dot" grid mode is now the default in the appearance.conf file due to better drawing performance. +* [Change] Created a mechanism in Relationship to reuse allocated objects instead of deleting them and allocating them again every time the relationship is connected/disconnected. +* [Change] Improved the scene background (grid, delimiter, limits) drawing speed for big models. +* [Change] Refactored DatabaseImportForm in such a way as to use QTableView instead of QTableWidget to list filter results. +* [Change] Refactored ModelDatabaseDiffForm in such a way as to use QTableView instead of QTableWidget to list filter results. +* [Change] Minor adjustment in ObjectsListModel to accept a list of attributes map to fill the table model. +* [Change] Refactored SwapObjectsIdsWidget in such a way as to use QTableView instead of QTableView. +* [Change] Refactored ObjectDepsRefsWidget by replacing QTableWidget with QTableView to display model objects. +* [Change] Minor adjustment in ObjectFinderWidget filter items order. +* [Change] Minor adjustment in GuiUtilsNs::updateObjectsTable(QTableView *) to create a QSortFilterProxyModel in the QTableView allowing sorting. +* [Change] Refactored ObjectFinderWidget to use QTableView instead of QTableWidget to display search results. +* [Change] Removed the QTableWidget instance in ModelObjectsWidget for performance reasons and for being a widget almost unused. +* [Change] Minor adjustment in BaseRelationship::connectRelationship. +* [Change] Adjusted BaseObjectWidget::applyConfiguration to avoid crashing when the general attributes of the widget are in a non-visible tab like in TableWidget. +* [Change] Reduced the number of times BaseGraphicObject::setModified is called consequently reducing the excessive objects' rendering. +* [Change] Minor adjustment in ObjectsScene::drawBackground to avoid rendering the grid and page delimiters during corner/scene move. +* [Change] Moved the table's general attributes to a dedicated tab which opened more space for displaying columns and other children's objects. +* [Change] Refactored GuiUtilsNs::updateObjectTable to accept a QTableView instead of QTableWidget. +* [Change] Updated the pgmodeler-cli menu to include the "any" filter explanation. +* [Change] Removed the plugin's configuration menu from the main toolbar. +* [Change] Improving the objects' filtering in reverse engineering by adding an "any" filter type. +* [Change] Minor adjustment on SQLToolWidget +* [Change] Improved the import error message when it's not possible to create/import permission that references a predefined PostgreSQL role. +* [Change] Minor improvement on ChangelogWidget layout. +* [Change] Minor code refactor in ObjectsScene and DatabaseModel. +* [Change] DataManipulationForm now shows a confirmation message before closing when items are pending save. +* [Change] Moved the method AppearanceConfigWidget::updateDropShadows to GuiUtilsNs::updateDropShadows +* [Change] Refactored the usage of AppearanceConfigWidget::updateDropShadows to use GuiUtilsNs::updateDropShadows +* [Change] Minor adjustments in swapobjectsidswidget.ui layout. +* [Change] Several minor widget adjustments. +* [Change] Renamed the methods startPanningMove and finishPanningMove to, respectively, startSceneMove and finishSceneMove. +* [Fix] Minor fix in ObjectFinderWidget to avoid disconnecting a null selection model in findObjects. +* [Fix] Minor fix in ModelWidget to hide new objects overlay when moving a selection of objects. +* [Fix] Minor fix in GuiUtilsNs::disableObjectSQL. +* [Fix] Minor fix in RelationshipView::configureBoundingRect and RelationshipView::configureLine. +* [Fix] Minor fix in ModelWidget::removeObjects that was not erasing an object in case it shared the same name or other objects in the same schema. +* [Fix] Minor fix in DatabaseModel::__addObject that validates the layer of the object being added. If one or more layers are invalid the object will be moved to the default layer 0 +* [Fix] Fixed the bounding rect calculation for RelationshipView. +* [Fix] Fixed a bug in DatabaseModel::findObject that was not parsing correctly the search filters with the "any" keyword. +* [Fix] Fixed the icons-*.conf to include QTableView class. +* [Fix] Minor fix in PgModelerCliApp::extractObjectXML to restore correctly the layers name/count. +* [Fix] Fixed a bug in partial reverse engineering that was not correctly importing functions in some specific conditions. +* [Fix] Fixed a bug in partial reverse engineering that was not importing some dependencies correctly. +* [Fix] Fixed a bug in AppearanceConfigWidget that was not updating the example model colors when changing the UI theme. +* [Fix] Fixed a crash when double-clicking the overview widget. +* [Fix] Fixed data dictionaries schema files for tables and views. +* [Fix] Fixed a bug in DatabaseModel that was causing FK relationships of a hidden layer to be displayed after loading the model. +* [Fix] Fixed a bug in MainWindow that was causing the plugin's config action icon to disappear when triggering validation. +* [Fix] Fixed the headers inclusion chain in all subproject sources. +* [Fix] Fixed a bug in scene move that was causing the grid to not be displayed after a panning/wheel move. + +v1.0.5 +------ +*Release date: July 26, 2023* + +* [New] Added shortcuts to Z-stack operations in ModelWidget. +* [New] Added missing PostgreSQL multirange types +* [Change] Improved the import error message when it's not possible to create/import a permission which references a predefined PostgreSQL role. +* [Change] Minor code refactor in ObjectsScene and DatabaseModel. +* [Fix] Fixed Qt 6.2 release in linuxbuild.yml and macosbuild.yml. +* [Fix] Fixed a bug in DatabaseModel that was causing FK relationships of a hidden layer to be displayed after loading the model. +* [Fix] Fixed a bug in MainWindow that was causing the plugins config action icon to disappear when triggering validation. +* [Fix] Fixed a bug in PgModelerCliApp::fixModel that was causing the generation of empty models when the input file had no tag . + +v1.1.0-alpha +------ +*Release date: June 09, 2023* + +* [New] Added support for drag & drop files in the main window to load models. +* [New] Added NOBYPASSRLS keyword to sql-highlight.conf. +* [New] Added OS type information in AboutWidget. +* [New] Added support for hiding objects' shadows in the settings. +* [New] Added support for installing tool buttons created by plugins in DatabaseExplorerWidget. +* [New] Added support for code completion based on living database object names in CodeCompletionWidget. It is now possible to list column/table names in the middle of the INSERT/DELETE/TRUNCATE/UPDATE commands. +* [New] Added support for exporting results in CSV and plain text format in DataManipulationForm and SQLExecutionWidget. +* [New] Added support for highlighting enclosing characters (),{},{} in SyntaxHighlighter. +* [New] Added the action NumberedTextEditor::pasteCode which tries to remove unneeded string concatenation chars ", ', + and . in the clipboard text before inserting it in the input field. This is useful for developers that copy SQL code in the middle of a programming language source code and want to test it in the database. +* [New] Added the button id Messagebox::CloseButton that creates a message box with only a close button. +* [New] Added the class CustomUiStyle to control global settings for pixel metrics of UI elements. +* [New] Added the method BaseForm::adjustMinimumSize. +* [New] Added the method CodeCompletionWidget::setConnectionParams. +* [New] Added the method PgModelerPlugin::getTmplPluginFilePath. +* [New] Added the methods setFileMustExist, setCheckExecutionFlag, setFileIsMandatory, and setNamePattern to FileSelectorWidget. +* [New] Added the options in GeneralConfigWidget that controls the column data truncation in the results grid. +* [New] Added support for setup name color of schema objects. +* [New] Added support to convert to XML entities the characters in attribute values in SchemaParser. +* [New] Added support for switching the current user when successfully connecting to a database via SET ROLE command. +* [New] Created the method DatabaseImportForm::listDatabases(Connection,QComboBox). +* [New] Enabling the displaying of byta column data in the results grid. +* [New] Now any SQL result grid header will display an icon according to the data type of each column. +* [New] Removed the method FileSelectorWidget::setFileMode and created to FileSelectorWidget::setDirectoryMode that toggles the selection of directories instead of files (the default behavior). +* [Change] Minor adjustment in FileSelectorWidget::validateSelectedFile. +* [Change] Added a wait cursor during the code preview in SourceCodeWidget. +* [Change] Added a wait cursor while searching objects in ObjectFinderWidget. +* [Change] Adjusted the access modifier in PgModelerPlugin methods. +* [Change] Adjusted the object catalog queries to include a general-purpose field named extra_info in the object list catalog query. +* [Change] Adjusted the warning icon size in FileSelectorWidget. +* [Change] Disabled the usage of keywords in the code completion instance of DataManipulationForm filter field. +* [Change] Dropped the use of syntax-hl-theme in appearance.conf. +* [Change] Improved the behavior of the "System default" UI theme. +* [Change] Improved the methods GuiUtilsNs::selectAndSaveFile, GuiUtilsNs::selectAndLoadFile. +* [Change] Improvements in LineNumbersWidget and NumberedTextEditor to correctly draw line numbers on text with the word wrap option activated. +* [Change] In data manipulation form when editing a single element with column data edit dialog, the form will display the current column's value. +* [Change] Change to medium the UI icons size of default settings. +* [Change] Minor adjustment in aboutsewidget.ui and aboutwidget.ui. +* [Change] Minor adjustment in the minimum size of Messagebox. +* [Change] Minor adjustment in Catalog::isConnectionValid. +* [Change] Minor adjustment in file coreutilsns.cpp. +* [Change] Minor adjustment in ModelFixForm to display pgmodeler-cli selector when the provided path to the executable is not valid. +* [Change] Minor adjustment in generalconfigwidget.ui. +* [Change] Minor adjustment in ObjectFinderWidget. +* [Change] Minor adjustment in schemaeditorform.ui. +* [Change] Minor refactor in TableObjectView, Connection, SchemaParser. +* [Change] Moved the copy actions in SQL results grid context menu to an action named the "Selection" in the same menu. +* [Change] Now the ColumnDataEditWidget instances have their geometry saved/restored. +* [Change] Replace the QPlainTextEdit by NumberedTextEditor in ColumnDataWidget. +* [Change] Refactored DatabaseImportHelper::createObject in such a way to use a map of bind methods to perform operations instead of using a long list of switch/case to determine which method must be called to create the object during reverse engineering. +* [Change] Refactored DatabaseModel::createObject, DatabaseModel::addObject, and DatabaseModel::removeObject in such a way to use a map of bind methods to perform operations instead of using a long list of if/else to determine which method must be called. +* [Change] Removed the get*Action and getDbExplorerButton methods in PgModelerPlugin and created the methods getAction and getWidget instead. +* [Change] Removed the method Catalog::getObjectCount(bool) and created a version that accepts a list of object types. +* [Change] Removed unneeded use of QString(""). +* [Change] Removed unused frame in modelfixform.ui. +* [Change] Renamed BulkDataEditWidget to ColumnDataWidget +* [Change] Replaced QApplication::setOverrideCursor/restoreOverrideCursor by qApp- >setOverrideCursor/restoreOverrideCursor. +* [Change] The method DatabaseExplorerWidget::addPluginToolButton passes the current connection id and database name as the plugin button property to be read in the click/triggered slots implemented in the plugin. +* [Change] Update all schema files that generate XML code to use &{} attribute form where there's the need to convert chars to their XML entities counterparts. +* [Change] When retrieving objects from the database CodeCompletionWidget will not display keywords and snippets in the popup list. +* [Fix] Addition fix in CodeCompletionWidget in such a way to preserve cursor position when inserting the selected word after a special char. +* [Fix] Fix a bug in PgModelerCliApp::fixModel that was causing the generation of empty models when the input file had no tag +* [Fix] Fixed a bug in Catalog::getObjectsCount. +* [Fix] Fixed a bug in DatabaseModel that could lead to an "unknown exception caught" error. +* [Fix] Fixed a bug in NumberedTextEditor::identSelection. +* [Fix] Fixed a bug in SqlExecutionWidget::fillResultsTable. +* [Fix] Fixed a bug in TableDataWidget::generateDataBuffer that was causing the generation of malformed CSV in some circumstances. +* [Fix] Fixed a crash in the SQL tool when closing a database explorer instance that owns a plugin tool button. +* [Fix] Fixed CodeCompletionWidget::retrieveColumnNames when referencing a table via an alias. +* [Fix] Fixed problems with comments on a database having the same OIDs of different types of objects +* [Fix] Fixed the diff process on legacy database versions. +* [Fix] Fixed the line selection operation in LineNumbersWidget. +* [Fix] Fixed the undefined reference error when building on Windows. +* [Fix] Minor fixes in the catalog queries for column, cast, collation, and role. +* [Fix] Minor fix in GeneralConfigWidget when using NO_UPDATE_CHECK. +* [Fix] Minor fix in process output capturing in ModelFixForm. +* [Fix] Minor tooltip fix in DataManipulationForm. + +v1.0.4 +------ +*Release date: May 19, 2023* + +* [New] Now pgModeler selects the UI element colors based upon the system's default colors set (light/dark). +* [New] pgModeler now restores the default settings in case of some configuration file is corrupted/incompatible and causes the initialization to fail. +* [New] Allowing sequences to be assigned to columns with numeric type. +* [New] Created the methods GuiUtilsNs::saveFile and GuiUtilsNs::loadFile. +* [Change] Removed the deprecated attribute partial-match from configuration files in conf/defaults. +* [Change] Minor adjustment in output messages in PgModelerCliApp::createConfigurations. +* [Change] SyntaxHighlighter when in single-line mode will strip any line break char in the input field. +* [Change] Minor adjustment in SyntaxHighlighter to force no line wrap in the parent input when single_line_mode is activated. +* [Change] Changed the behavior of TableDataWidget::populateDataGrid. Instead of failing and never opening the dialog again for the user to try to import another file, the method now ask for saving the current (corrupted data) to a file and opens an empty grid to a new CSV import. +* [Change] Removed unused constant PhysicalTable::DataLineBreak. +* [Fix] Fixed a false-positive diff result when comparing numeric columns. +* [Fix] Minor fix in the name pattern of the settings backup folder in PgModelerCliApp::createConfigurations. +* [Fix] Fixed bug in reverse engineering that was happening during the creation of object permissions. +* [Fix] Minor fixes in the catalog queries for cast, collation, and role. +* [Fix] Fixed the wrong usage of cached names and signatures in DatabaseImportHelper. +* [Fix] Additional fix in CsvParser::parseBuffer to append a line break character at the end of the buffer in case it is missing so the parsing can be done correctly. + +v1.0.3 +------ +*Release date: April 24, 2023* + +* [New] pgmodeler-cli now logs objects that fail to be recreated in fix process into a log file stored in pgModeler's temp directory. +* [New] Added a progress bar to model fix form and a cancel button which allows aborting the fix operation without close that form. +* [New] Added a specific icon for CSV load button in CsvLoadWidget. +* [New] Added the methods Trigger::getColumns and Trigger::addColumns. +* [Change] Adjusted the behavior of hide and close events of model fix form. +* [Change] Minor adjustment in pgmodeler-cli model fix messages. +* [Change] Refactored TriggerWidget to use an instance of ColumnPickerWidget. +* [Fix] Fixed the database model file header validation for huge models in pgmodeler-cli. +* [Fix] Fixed a bug in TableDataWidget::generateDataBuffer that was causing the generation of malformed CSV in some circumstances. +* [Fix] Fixed the PluginsConfigWidget::initPlugins in such a way to remove the plugins that failed to load from the plugins grid. +* [Fix] Fixed a bug in BaseRelationship::canSimulateRelationship11 that was wrongly returning true. + +v1.0.2 +------ +*Release date: March 14, 2023* + +* [Fix] Fixed a bug related to importing referenced tables of FKs in partial import mode. +* [Fix] Fixed the attributes toggler item border style in partition tables. +* [Fix] Fixed a regression that was preventing the canvas color to be changed. +* [Fix] Fixed a bug in BaseObjectWidget::finishConfiguration that was preventing the creation of a role and a table with the same names. +* [Fix] Fixed the generation of DROP command for policy, trigger, and rule. +* [Fix] Fixed a bug that was causing objects to be selected in the sample model at appearance settings. +* [Fix] Forcing the usage of Qt 6.x due to problems on Windows when compiling with Qt 5. +* [Fix] Minor adjustment in CodeCompletionWidget stylesheet. +* [Fix] Saving/restoring the painter settings after drawing the background in ObjectsScene. +* [Fix] Fixed a malformed diff code for policies. + +v1.0.1 +------ +*Release date: February 17, 2023* + +* [New] AppearanceConfigWidget now adjusts the drop shadows on tool buttons according to the current theme. +* [Change] pgModeler will now ask for PK columns uncheck when removing a primary key in the Constraints tab at TableWidget +* [Change] Disabling catalog query for transform objects in PG9.x +* [Change] Improving the visibility of some elements in QMenu and AboutWidget +* [Fix] Fixed the assignment of layer colors when loading the model in compatibility mode. +* [Fix] Minor fix in ModelWidget::toggleSchemasRectangles +* [Fix] Fixed the disable state change for delimiter scale lock action when changing the current main window view. +* [Fix] Fixed the method FileSelectorWidget::openFileExternally. + +v1.0.0 +------ +*Release date: February 1, 2023* + +* [New] Added an option in GeneralConfigWidget to allow pgModeler to connect to older PostgreSQL server versions, below 10 using a minimum (not reliable) compatibility mode. +* [New] Added an option to change ObjectsScene grid pattern. Available options are square and dot. +* [New] Added an option to lock the page delimiters resize during zoom out (<100%) to allow the user to place more objects on one page. +* [New] Added the ability to print models with a specified scale factor. +* [New] Added the method MainWindow::updateWindowTitle. +* [New] Created the method ObjectsTableWidget::setRowColors. +* [New] Added the public slot ObjectsTableWidget::resizeContents. +* [New] Added the signal MainWindow::s_modelLoadRequested. +* [New] Added the method PgModelerPlugin::postInitPlugin which is called when the main window initialization is ready. +* [New] Added the method MainWindow::registerRecentModel. +* [New] Added the method PgModelerPlugin::getPluginFilePath. +* [New] Created the method DatabaseModel::setDatabaseModelAttributes. +* [New] Added the class ObjectTypesListWidget that implements a QListWidget specialization for object types handling. +* [New] Added the method PgModelerPlugin::getPluginIconPath. +* [New] Added the method MainWindow::getCurrentModel. +* [Change] Minor adjustment in the factor applied to delimiter lines in ObjectsScene::setGridSize. +* [Change] Minor tooltip adjustment in generalconfigwidget.ui +* [Change] pgModeler now allows to import and diff in PostgreSQL versions below 10 using the minimum compatibility mode without guaranteeing reliable results. +* [Change] Moved the Q_DECLARE_METATYPE macro call to the header files of classes that use it. +* [Change] Dropped outdated UI translations. +* [Change] Minor adjustment in ModelWidget::printModel to hide scene boundary lines when printing model. +* [Change] Minor adjustment in ObjectsScene::finishObjectsMove and ModelWidget::adjustSceneSize to give extra size to the scene rectangle. +* [Change] The scene rectangle is now always resized to the current objects' bounding rectangle. +* [Change] Overloaded the method QGraphicsScene::drawBackground in ObjectsScene to draw the grid, page delimiters, and scene limits instead of using pixmap-based background. +* [Change] Minor adjustment in the plugins' actions in the toolbar. +* [Change] Minor adjustment in the data retrieving message in DataManipulationForm. +* [Change] Allowing plugins to insert actions in the top toolbar at the main window via PgModelerPlugin::getToolbarAction. +* [Change] Replaced the object type filter in ModelObjectsWidget with an instance of ObjectTypesListWidget. +* [Change] Moved the method ObjectFinderWidget::updateObjectTable to GuiUtilsNs. +* [Change] Minor refactor by replacing hardcoded references to .dbm extension by GlobalAttributes::DbModelExt. +* [Change] Changed the location where the MainWindow::s_modelSaved signal is emitted. +* [Change] Minor adjustment in the plugin's info dialog. +* [Change] Minor adjust in icons CSS. +* [Change] Changed the position of the recent model actions. +* [Change] Minor adjustment in mainwindow.ui. +* [Change] Minor refactor in MainWindow and WelcomeWidget. +* [Change] Removed the overloaded version of getSignature from Trigger, Policy, and Rule. +* [Change] Minor adjust in pgmodeler.pri. +* [Change] Replaced the clunky filter options in ObjectFinderWidget with a menu action associated with the "Filter" button. +* [Change] Changed the behavior of DatabaseModel::findObjects. Now it treats BaseRelationship and Relationship as the same object type to make the search results more accurate. +* [Change] Renamed some GlobalAttributes consts *Dir to *Path for a better semantics. +* [Change] Removed unused variable in DatabaseModel::findObjects. +* [Change] Adjusted Constraint::configureSearchAttributes to create a "signature" attribute in the form schema.table.name. +* [Change] Changed getPluginIconPath to retrieve icons from .qrc file instead of from the filesystem. +* [Change] Minor improvement in HtmlItemDelegate. Now one can construct this object by opting to ignore the HTML tags in sizeHint calculation. +* [Change] Refactored PgModelerPlugin by removing methods hasMenuAction, hasConfigurationForm, and getPluginShortcut. +* [Change] Refactored PluginsConfigWidget::installPluginsActions to receive only a QMenu instance. +* [Change] Removed MainWindow::executePlugin slot since the plugin execution must be triggered by the plugin itself via menu action or model action. +* [Change] Minor improvement in PluginsConfigWidget to force the unloading of plugins that do not meet a version requirement. +* [Fix] Fixed a bug in ModelOverviewWidget that was causing generated pixmap to be blurry on hi-dpi screens. +* [Fix] Fixed a crash when the user tried to browse a DB in PostgreSQL 15. +* [Fix] Fixed how printer settings are changed compared to the default one and triggers a message box so the user can decide which conf to use. +* [Fix] Fixed the use of zoom factor in the PNG export process. +* [Fix] Fixed the ConnectionsConfigWidget::handleConnection alias desambiguation routine. +* [Fix] Minor fix in the BaseForm::setButtonConfiguration signature. +* [Fix] Fixed a bug that was causing relationship name patterns to be loaded in the wrong order. +* [Fix] Fixed the generation of the COMMENT command for constraints. +* [Fix] Fixed the class ObjectTypesListWidget by adding __libgui directive (Windows only). +* [Fix] Minor fix in HtmlItemDelegate to display text in the correct position. +* [Fix] Minor fix in CodeCompletionWidget. +* [Fix] Fixed a bug in the generation of the ALTER OWNER command for materialized views. +* [Fix] Minor fix in ObjectRenameWidget and TaskProgressWidget window style. +* [Fix] Minor fix in PgModelerCliApp to properly restore special objects when fixing models. + +v1.0.0-beta1 +------ +*Release date: November 25, 2022* + +* [New] Added the file themes/light/extra-ui-style.conf that holds extra style for the light theme. +* [New] Added dllexport symbol __lib* to functions and static attributes declarations in all namespaces. +* [New] Created defines for each library name __lib[NAME] in file [NAME]global.h which wraps Q_DECL_EXPORT/Q_DECL_IMPORT to export or import symbols of the libraries (needed for Windows). +* [New] Added the ability to toggle the magnifier tool in the main window. +* [New] Added a text search widget in the diff code preview on ModelDatabaseDiffForm. +* [New] Added unary operators for enum operations: |= , &= , ^= +* [New] Added a new implementation of CSV file loading based on RFC4180. Now the classes CsvParse and CsvDocument are responsible for parsing CSV files. +* [Change] Disabled unneeded conditional code in MainWindow. +* [Change] Adjusted the font weight in toolbar actions. +* [Change] Minor text adjustment in DonateWidget. +* [Change] Minor adjustments in UI stylesheets. +* [Change] Refactored TemplateType and all its derived classes to avoid the error "explicit specialization of 'type_names'" when building with clang. +* [Change] Adjusted the zoom in/out actions enabled state according to the current model's zoom factor. +* [Change] Adjusted AppearanceConfigWidget to load the extra-ui-style.conf. +* [Change] Adjusted the behavior of the magnifier action in MainWindow. +* [Change] Minor adjustment in MainWindow::setBottomFloatingWidgetPos to take into account the main menu bar height when visible. +* [Change] Changed the MetadataHandlingForm's Apply and Cancel actions to Execute and Close. +* [Change] Minor refactor in ModelFixForm to remove clangd warning. +* [Change] Adjusted the icon of the current input model/DB in the partial diff tab in ModelDatabaseDiffForm. +* [Change] Adjusting the context object in thread signal/slot connections in ModelExportForm. +* [Change] Adjusted plugins and arranged object actions in the main menu. +* [Change] Adjusted the captured variables in lambda slots avoiding default capturing [&]. +* [Change] Added a context object parameter in connect() which receives lambda slots. +* [Change] Refactored MainWindow signal/slot connections to the new syntax. +* [Change] Refactored ModelWidget signal/slot connections to the new syntax. +* [Change] Refactored ModelDatabaseDiffForm signal/slot connections to the new syntax. +* [Change] Refactored ModelExportForm signal/slot connections to the new syntax. +* [Change] Refactored ModelObjectsWidget signal/slot connections to the new syntax. +* [Change] Refactored ModelValidationWidget signal/slot connections to the new syntax. +* [Change] Refactored SQLExecutionWidget signal/slot connections to the new syntax. +* [Change] Refactored TableDataWidget signal/slot connections to the new syntax. +* [Change] Refactored SourceCodeWidget signal/slot connections to the new syntax. +* [Change] Refactored UpdateNotifierWidget signal/slot connections to the new syntax. +* [Change] Refactored OperationListWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectsTableWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectsFilterWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectSelectorWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectRenameWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectFinderWidget signal/slot connections to the new syntax. +* [Change] Refactored ObjectDepsRefsWidget signal/slot connections to the new syntax. +* [Change] Refactored NumberedTextEditor signal/slot connections to the new syntax. +* [Change] Refactored NewObjectOverlayWidget signal/slot connections to the new syntax. +* [Change] Refactored ModelOverviewWidget signal/slot connections to the new syntax. +* [Change] Refactored ModelNavigationWidget signal/slot connections to the new syntax. +* [Change] Refactored LineNumbersWidget signal/slot connections to the new syntax. +* [Change] Refactored LayersWidget signal/slot connections to the new syntax. +* [Change] Refactored LayersConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored FindReplaceWidget signal/slot connections to the new syntax. +* [Change] Refactored FileSelectorWidget signal/slot connections to the new syntax. +* [Change] Refactored CustomSQLWidget signal/slot connections to the new syntax. +* [Change] Refactored CsvLoadWidget signal/slot connections to the new syntax. +* [Change] Refactored ColorPickerWidget signal/slot connections to the new syntax. +* [Change] Refactored CodeCompletionWidget signal/slot connections to the new syntax. +* [Change] Refactored ChangelogWidget signal/slot connections to the new syntax. +* [Change] Refactored SQLToolWidget signal/slot connections to the new syntax. +* [Change] Disabled custom font size for hint boxes in BaseObjectWidget, ModelDatabaseDiffForm, ModelFixForm, and ModelWidget. +* [Change] Refactored SwapObjectsIdsWidget signal/slot connections to the new syntax. +* [Change] Refactored ModelValidationHelper signal/slot connections to the new syntax. +* [Change] Refactored ModelRestorationForm signal/slot connections to the new syntax. +* [Change] Refactored ModelFixForm signal/slot connections to the new syntax. +* [Change] Refactored ModelExportHelper signal/slot connections to the new syntax. +* [Change] Refactored MetadataHandlingForm signal/slot connections to the new syntax. +* [Change] Refactored DataManipulationForm signal/slot connections to the new syntax. +* [Change] Refactored DatabaseImportForm signal/slot connections to the new syntax. +* [Change] Refactored DatabaseExplorerWidget signal/slot connections to the new syntax. +* [Change] Refactored BugReportForm signal/slot connections to the new syntax. +* [Change] Refactored SnippetsConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored RelationshipConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored BaseForm::setMainWidget to use the new signal/slot connections to syntax +* [Change] Refactored PluginsConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored GeneralConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored ConnectionConfigWidget signal/slot connections to the new syntax. +* [Change] Refactored Messagebox signal/slot connections to the new syntax. +* [Change] Refactored ViewWidget signal/slot connections to the new syntax. +* [Change] Refactored TypeWidget signal/slot connections to the new syntax. +* [Change] Refactored TriggerWidget signal/slot connections to the new syntax. +* [Change] Refactored TextboxWidget signal/slot connections to the new syntax. +* [Change] Refactored TableWidget signal/slot connections to the new syntax. +* [Change] Refactored SequenceWidget signal/slot connections to the new syntax. +* [Change] Refactored RuleWidget signal/slot connections to the new syntax. +* [Change] Refactored RoleWidget signal/slot connections to the new syntax. +* [Change] Refactored RelationshipWidget signal/slot connections to the new syntax. +* [Change] Refactored ReferenceWidget signal/slot connections to the new syntax. +* [Change] Refactored ProcedureWidget signal/slot connections to the new syntax. +* [Change] Refactored PolicyWidget signal/slot connections to the new syntax. +* [Change] Refactored PgSqlTypeWidget signal/slot connections to the new syntax. +* [Change] Refactored PermissionWidget signal/slot connections to the new syntax. +* [Change] Refactored ParameterWidget signal/slot connections to the new syntax. +* [Change] Refactored OperatorClassWidget signal/slot connections to the new syntax. +* [Change] Minor refactor in CoreUtilsNs::isReservedKeyword. +* [Change] Removed Qt::WindowContextHelpButtonHint from default window flags in BaseForm constructor. +* [Change] Refactored IndexWidget signal/slot connections to the new syntax. +* [Change] Refactored GenericSqlWidget signal/slot connections to the new syntax. +* [Change] Refactored FunctionWidget signal/slot connections to the new syntax. +* [Change] Refactored EventTriggerWidget signal/slot connections to the new syntax. +* [Change] Refactored ElementWidget signal/slot connections to the new syntax. +* [Change] Refactored ElementsTableWidget signal/slot connections to the new syntax. +* [Change] Refactored DomainWidget signal/slot connections to the new syntax. +* [Change] Refactored ConstraintWidget signal/slot connections to the new syntax. +* [Change] Refactored ColumnWidget signal/slot connections to the new syntax. +* [Change] Refactored ColumnPickerWidget signal/slot connections to the new syntax. +* [Change] Refactored CollationWidget signal/slot connections to the new syntax. +* [Change] Refactored BaseObjectWidget signal/slot connections to the new syntax. +* [Change] Refactored BaseFunctionWidget signal/slot connections to the new syntax. +* [Change] Refactored AggregateWidget signal/slot connections to the new syntax. +* [Change] Refactored BaseForm signal/slot connections to the new syntax. +* [Change] Refactored SchemaView signal/slot connections to the new syntax. +* [Change] Refactored TableView signal/slot connections to the new syntax. +* [Change] Refactored TextboxView signal/slot connections to the new syntax. +* [Change] Refactored RelationshipView signal/slot connections to the new syntax. +* [Change] Refactored ObjectsScene signal/slot connections to the new syntax. +* [Change] Refactored GraphicalView signal/slot connections to the new syntax. +* [Change] Refactored BaseObjectView signal/slot connections to the new syntax. +* [Change] Refactored SourceEditorWidget signal/slot connections to the new syntax. +* [Change] Refactored SchemaEditorForm signal/slot connections to the new syntax. +* [Change] Refactored PgModelerCliApp signal/slot connections to the new syntax. +* [Change] Refactored CrashHandlerForm signal/slot connections to the new syntax. +* [Change] Removed the files basetype.h and basetype.cpp. +* [Change] Moved all the code from BaseType to TemplateType. +* [Change] Renamed getCodeDefinition, getAlterDefinition, and getDropDefintion to respectively getSourceCode, getAlterCode, and getDropCode. +* [Change] Moved the element type ids in XmlParser to XmlParser::ElementType. +* [Change] Removed unused constants in SourceCodeWidget. +* [Change] Moved config widget ids constants in ConfigurationForm to ConfigurationForm::ConfWidgetsId. +* [Change] Moved main window view ids to MainWindow::MWViewsId. +* [Change] Moved table buttons and item color constants in ObjectsTableWidget to ObjectsTableWidget::ButtonConf and ObjectsTableWidget::TableItemColor. +* [Change] Moved index attributes (buffering, concurrent, unique) constants to Index::IndexAttribs. +* [Change] Moved relationship break mode ids in ModelWidget to ModelWidget::RelBreakMode. +* [Change] Moved validation info type constants in ValidationInfo to ValidationInfo::ValType. +* [Change] Moved diff type constants in ObjectsDiffInfo to ObjectsDiffInfo::DiffType. +* [Change] Moved diff options constants in ModelsDiffHelper to ModelsDiffHelper::DiffOptions. +* [Change] Moved thread ids constants in ModelDatabaseDiffForm to ModelDatabaseDiffForm::ThreadId. +* [Change] Moved row operation ids constants in DataManipulationForm to DataManipulationForm::OperationId. +* [Change] Moved object attribute ids in DatabaseImportForm to DatabaseImportForm::ObjectAttrId +* [Change] Moved icon types and button ids constants in Messagebox to, respectively, Messagebox::IconType and Messagebox::ButtonsId. +* [Change] Moved tab id constants in RelationshipWidget to RelationshipWidget::TabId. +* [Change] Moved pending operations ids in MainWindow to MainWindow::PendingOpId. +* [Change] Minor adjustment in cached name/signature checking in DatabaseImportHelper::getObjectName. +* [Change] Minor improvement in DatabaseImportHelper::getObjectName to cache names and signatures to avoid repeatedly configuring names on each call. +* [Change] Moved the type function ids constants in Type to Type::FunctionId. +* [Change] Moved the type config constants in Type to Type::TypeConfig. +* [Change] Moved font factor constants in namespace GuiUtils to GuiUtilsNs::FontFactorId. +* [Change] Moved transition table ids in Trigger to Trigger::TransitionTableId. +* [Change] Moved transform functions constants in Transform to Transform::FunctionId. +* [Change] Moved text attributes constants in Textbox to Textbox::TextAttribs. +* [Change] Minor change in ModelWidget::saveModel to create a backup file in the same places as the original model file. +* [Change] Refactored BaseObjectView to use ColorId enum. +* [Change] Moved the Tag::ColorId to the global scope in basegraphicobject.h since the enum usage is not exclusive to tags. +* [Change] Fixed the underlying type of some enums. +* [Change] Moved role type and options constants from Role to, respectively, Role::RoleType and Role::RoleOpts. +* [Change] Moved name pattern constants in Relationship to Relationship::PatternId. +* [Change] Moved SQL type constants in Reference to Reference::SqlType. +* [Change] Moved the reference type constants in Reference to Reference::ReferType. +* [Change] Moved privileges ids constants in Permission to Permission::PrivilegeId. +* [Change] Moved operator class element type constants in OperatorClassElement to OperatorClassElement::ElementType. +* [Change] Moved constants related to argument ids and operators ids in Operator to, respectively, Operator::ArgumentId and Operator::OperatorId. +* [Change] Minor change in databaseimportform.ui, moved the tool buttons that control items selection/collapsing to the top of the section. +* [Change] Moved function ids constants in Operator to Operator::FunctionId. +* [Change] Moved chain type constants in Operation to Operation::ChainType. +* [Change] Moved operation types in Operation to Operation::OperType. +* [Change] Moved function constants in Language to Language::FunctionId. +* [Change] Moved version constants in Extension to Extension::VersionId. +* [Change] Moved the sorting constants of Element to Element::SortOrder. +* [Change] Moved DatabaseModel change log constants to DatabaseModel::LogFields. +* [Change] Moved DatabaseModel metadata attributes constants to DatabaseModel::MetaAttrOptions. +* [Change] Moved the code generation mode constants of DatabaseModel to DatabaseModel::CodeGenMode. +* [Change] Moved CopyOptions constants to CopyOptions::CopyOpts and CopyOptions::CopyMode. +* [Change] Moved SpatialType variation constants to enum SpatialType::VariationId. +* [Change] Moved UserTypeConfig type config constants to enum UserTypeConfig::TypeConf. +* [Change] Moved Constraint columns constants to enum Constraint::ColumnsId. +* [Change] Moved Constraint actions events constants to enum Constraint::ActionEvent. +* [Change] Moved Conversion constants to enum Conversion::EncondingId. +* [Change] Moved constants Collation::Lc* to Collation::LocaleId. +* [Change] Moved Cast::*Type to enum Cast::DataTypeId. +* [Change] Move cast type constants to enum Cast::CastType. +* [Change] Moved BaseTable::*Section constants to BaseTable::TableSection. +* [Change] Constants related to relationship type and label ids were moved, respectively, to enums BaseRelationship::RelationshipType and BaseRelationship::RelationshipLabel +* [Change] Moved the Aggregate::*Func constants to Aggregate::FunctionId enum. +* [Change] Moved all ResultSet::*Tuple constants to the enum ResultSet::TupleId. +* [Change] Moved the Catalog query filter constants to Catalog::QueryFilter enum. +* [Change] Created bitwise operators for enums in enumtype.h. +* [Change] Moved the constants ObjDescriptor, NameLabel, TypeLabel, and ConstrAliasLabel of TableObjectView to TableObjectView::ChildObjectId. +* [Change] Moved the constants Connection::Op* to the enum Connection::ConnOperation. +* [Change] Moved RoundRectItem corner constants to RoundedRectItem::RectCorners. +* [Change] Moved the global enum CollapseMode to BaseTable::CollapseMode. +* [Change] The static attributes ObjectsScene::Layer*Color were moved to LayerAttributes scoped enum. +* [Change] Renamed the enum_cast() to enum_t and moved to enumtype.h. +* [Change] Moved the constexpr attributes that reference toggler buttons to enum AttributesTogglerItem::TogglerButton. +* [Change] Reunited all row editing actions in DataManipulationForm in a single menu under "Edit" action. +* [Change] In SQLToolWidget when requesting the source code display of an object in the objects' tree, the source code pane will be popped up if not being shown. +* [Change] Minor improvement in CsvParser::parserBuffer to replace Windows/MacOs line breaks (\r\n and \r) by Unix only line break (\n). +* [Change] Refactored PhysicalTable::getInitialDataCommands to use CsvParser/CsvDocument. +* [Change] Minor adjustment in CsvParser to raise an exception on the malformed document due to missing close text delimiter. +* [Change] Fixes the loading of complex CSV files in TableDataWidget. +* [Change] Changed the way pgModeler imports CSV files to be used as initial table data. +* [Fix] Minor fix in MainWindow when building with DEMO_VERSION flag. +* [Fix] Fixed a bug in AppearanceConfigWidget that was randomly changing the UI theme when the user tweaks the UI style form. +* [Fix] Additional fix for false-positive diffs when functions were using an array of user-defined types. +* [Fix] Fixed a crash happening in the moment a renamed object got its source reloaded in DatabaseExplorerWidget. +* [Fix] Fixed a bug in CopyOptions that was not initializing attributes in the default constructor. +* [Fix] Minor fix in BugReportForm message box text. +* [Fix] Fixed the tool button style of plugins action in model_actions_tb in MainWindow. +* [Fix] Minor fix in FileSelectorWidget and ObjectSelectorWidget to capture mouse press instead of focus to display the respective selection dialogs. +* [Fix] Fixed a bug in StyledTextboxView that was not emitting s_objectDimensionChanged when (re)configuring it. +* [Fix] Fixed UpdateNotifierWidget style for the dark theme. +* [Fix] Fixed a bug in Catalog::getCatalogQuery that was not placing the custom filter in the right place in the query. +* [Fix] Fixed a bug that was resetting the fade-out state of objects. +* [Fix] Fixed a bug in database import that was failing to import operators in certain cases. +* [Fix] Fixed a bug when importing functions that contain parameters composed of arrays of user-defined types. +* [Fix] Fixed a bug in AppearanceConfigWidget that was not persisting changes in minimum opacity and attributes numbers per page spin boxes. +* [Fix] Minor fix in DatabaseModel::getObject(QString,ObjectType) to search for an object by its signature and name. + +v1.0.0-beta +------ +*Release date: September 10, 2022* + +* [New] Added data dictionary entry for indexes, triggers, and sequences. +* [New] Columns, indexes, triggers, and constraints now have their own method to generate their data dictionaries. +* [New] Created the objects.sch to be reused when generating data dictionaries for columns, constraints, indexes, triggers, and sequences. +* [New] Added split SQL code generation modes to export form. +* [New] Added the ability to export dependencies or children SQL in split mode at CLI. +* [New] Added code generation options to DatabaseModel::saveSplitSQLDefinition. +* [New] Added a fix step in CLI to remove encrypted attribute from tag. +* [New] Added an info message in the FindReplaceWidget reporting the search status (not found, cycle search, replacements made, etc). +* [New] Added a text search widget in SourceCodeWidget. +* [Change] Tab order adjustments in several forms and widget. +* [Change] Adjusted the stylesheet of the data dictionary. +* [Change] pgModeler CLI menu and messages fixed/improved. +* [Change] Improved the interaction between the magnifier tool and the canvas area. Now the user can select multiple objects, move, and control the zoom with the magnifier tool activated. +* [Change] Adjusted the size of the magnifier frame according to the primary screen size. +* [Change] Improved the XMlParser exceptions raised to point the file that generated the error. +* [Change] Dropped the support for PostgreSQL 9.x. +* [Change] Dropped the attribute "Encrypted" from the role form. +* [Change] Connection class now aborts the connection to PostgreSQL 9.x servers. +* [Change] Changed the shortcut key of the magnifier tool from Ctrl + Alt to F9. +* [Change] Changed the "edit item" icon on ObjectsTableWidget. +* [Change] Changed the default size of splash screen on screens with device pixel ratio = 1. +* [Fix] Fix a crash in macOS when right-clicking a blank portion of the canvas when there are objects selected. +* [Fix] Minor fix the warning icon size and position in FileSelectorWidget. +* [Fix] Fixed a bug in BaseObject::isValidName that was not considered valid a name in the format schema."object". +* [Fix] Fixed the diff generation for materialized views. +* [Fix] Fixed a bug in CLI that was not correctly fixing domains in models created in 0.8.2. +* [Fix] Fixed the appearance of the about widget in pgmodeler-se. +* [Fix] Fixed the CLI in such a way to use QRegularExpression correctly on large text buffers. +* [Fix] Minor fix in standalone connection dialog to alert the user about unsaved connection configuration. +* [Fix] Minor fix in ConnectionsConfigWidget to avoid adding connections with duplicated aliases. + +v1.0.0-alpha1 +------ +*Release date: June 21, 2022* + +* [New] Added PostgreSQL 15 as the default version for code generation. +* [New] Added a workaround in MainWindow constructor to force the application of UI themes on Windows and Mac. +* [New] Added the methods GlobalAttributes::getConfigParamFromFile and GlobalAttributes::setCustomUiScaleFactor. +* [New] Add support for custom UI scaling and UI icons size selection in AppearanceConfigWidget. +* [New] Created the method Relationship::updateGeneratedObjects. +* [New] pgModeler now saves and restores the QFileDialog instances geometry/state in the file filedlg.conf. +* [New] Created the method QApplication::loadTranslation to reuse translation loading routines. +* [Change] Minor adjustment in assets/schemas/catalog/database.sch in order to retrieve the last system oid from pg_depend. +* [Change] Removed the class CustomMenuStyle since its use is not needed anymore. +* [Change] Refactored MainWindow constructor by creating small methods for specific initialization tasks. +* [Change] Changed the references to STL classes/algorithms by using the namespace std::. +* [Change] Removed global "using namespace std" to avoid breaking the building on mingw64. +* [Change] Replaced QtCompat classes with Qt 6 specific code. +* [Change] Adjusted the layout spacing in all *.ui files. +* [Change] Updated several icon sizes due to Qt 6 improved auto-scale factor. +* [Change] Replaced deprecated attribute QPalette::Foreground in TableDataWidget. +* [Change] Minor improvement in DatabaseExplorerWidget::dropObject to show the complete location of the object being dropped (schema, table, DB). +* [Change] In DatabaseImportHelper::createSchema if the schema to be created is public or pg_catalog, pgModeler will just ignore them because these schemas already exist in the model being imported. +* [Change] When printing a model with page numbers enabled pgModeler now will add the column and row info of the current page being printed. +* [Change] Moved from deprecated QPrinter API to newer one in Qt 6. +* [Change] Adjusted the behavior of ObjectFinderWidget, now "Exact match" option is only enabled when using regular expressions. +* [Change] Adjusted the generation of CDATA elements in XML schema files. +* [Change] Adjusted the syntax highlighting conf files. +* [Change] Adjusted the XML highlighting conf files. +* [Change] Removed the support to partial-match attribute in syntax highlight conf files. +* [Change] Removed partial matching from SyntaxHighlighter. +* [Change] SyntaxHighlighter will raise an error if an invalid regex pattern is detected during file loading. +* [Change] Replaced all QRegExp usages by QRegularExpression due to the deprecation of the former class in Qt 6. +* [Change] Forcing C++17 building and the deprecation of any API before Qt 6. +* [Change] Minor improvement in Relationship::addColumnsRelGenPart to allow the creation of missing columns only as part of the routines in Relationship::updateGeneratedObjects. +* [Change] Minor change in DatabaseModel::validateRelationships to update tables and schemas geometry only at the end of the method. +* [Change] Disabling the extra relationship validation in DatabaseModel::loadModel. +* [Change] Improved the procedure that tries to recreate invalid relationships in DatabaseModel::validateRelationships. +* [Change] Refactored the way relationships are validated in DatabaseModel improving the overall operation speed. +* [Change] Changing the catalog query filter in PgModelerCliApp::importDatabase and ModelDatabaseDiffForm::importDatabase to avoid retrieving and creating system objects unnecessarily. +* [Change] Minor adjustments in pen width factor in RelationshipView::getDefaultPenWidth. +* [Change] Minor change in identifier relationship rendering. +* [Change] Removed the unneeded use of QString("") instantiation in several parts. +* [Change] The delete operation on ModelWidget now displays a wait cursor while running. +* [Fix] Fixed a bug in ConnectionsConfigWidget::openConnectionsConfiguration that was preventing reloading the original conf file when the user clicked cancel. +* [Fix] Fixed a bug in AppearanceConfigWidget that was applying the font style correctly to the source code preview. +* [Fix] Fix splitters handler sizes. +* [Fix] Fixed the QMenu configuration in several parts to use the new API of Qt 6. +* [Fix] Minor fix in LineNumbersWidget to render numbers in the correct height. +* [Fix] Fixed the resizing and positioning of the code completion widget in the first show. +* [Fix] Fixed a signal/slot connection in GeneralConfigWidget. +* [Fix] Fix a crash in ObjectsScene::mousePressEvent when building with Qt 6. +* [Fix] Fixed a typo in the error message in Tablespace::setDirectory. +* [Fix] Minor fix in Catalog::parseRuleCommands. +* [Fix] Minor fix in ModelObjectsWidget::updateObjectsList. Instead of using an empty pattern, we needed to force the wildcard * so the search returns all objects. +* [Fix] Fixed a bug in the column propagation mechanism that was failing to (re)create columns properly when the model was using lots of identifier relationships. +* [Fix] Minor fix in ElementsTableWidget to display "Default" in Sorting and Nulls columns instead of a blank text when no sorting method is defined for an element. +* [Fix] Fixed a bug in PhysicalTable::setColumnsAttribute that was ignoring exclude constraints when determining the use of the last comma in the table's SQL code. +* [Fix] Import process now correctly configures sorting options for excluding constraints and indexes. +* [Fix] Minor fix in RelationshipView to use the method getDefaultPenWidth when configuring lines and descriptors. +* [Fix] Fixed the scattered objects arrangement mode to make tables less sparse over the canvas. +* [Fix] Fixed a crash when trying to swap relationships in SwapObjectsIdsWidget. +* [Fix] Fixed blurry icons on TaskProgressWidget. + +v1.0.0-alpha +------ +*Release date: April 11, 2022* + +* [New] pgModeler 1.0 will now copy compatible config files from 0.9.x if the older configuration dir is found on the first execution. +* [New] Added extra constants to ObjectsTableWidget to control the coloring of items in DataManipulationForm according to the theme in use. +* [New] Added an extra tab in Messagebox stack trace info called "Extra info" that displays only error's extra info to quickly help to identify any problem. +* [New] AppearanceConfigWidget now switches between light/dark themes on-the-fly. +* [New] Added custom appearance config files in conf/themes for each theme color. +* [New] Added support for customizing objects' shadow color. +* [New] Textboxes are now rounded at corners. +* [New] Created the files ui-medium.conf and ui-small.conf that controls the ui style in medium (2k) and small (1080p and below) screen sizes. +* [New] Added the class CustomMenuStyle that configures a custom size for QMenu icons. +* [New] Added an implementation for SimpleColumn::operator = to avoid compiler warnings. +* [New] Added an icon for update found notification in MainWindow. +* [New] Adding cool new icons and project logo. +* [New] CLI now restores the changelog during the fix operation. +* [New] Added the instruction $$QMAKE_LIBS_EXECINFO to apps/pgmodeler/pgmodeler.pro +* [Change] Minor adjustment in pgmodeler.pri to accept custom XML_??? and PGSQL_??? vars on Linux +* [Change] Removed the code generation of rules/indexes/triggers in the "Code preview" tab at ViewWidget since these objects' codes aren't appended to the parent view's code. +* [Change] Removed the icon of the QToolBar's extended button via CSS. +* [Change] ColorPickerWidget color button is now resized according to the tool button icon size. +* [Change] ObjectSelectorWidget was simplified to keep UI more uniform. Now it uses a QLineEdit instead of a QPlainTextEdit. +* [Change] Removed all files suffixed as _grp.png from resources and code. +* [Change] The routine that applies the UI stylesheet was moved from PgModelerApp to AppearanceConfigWidget. +* [Change] Improved the Messagebox resizing during the first show. +* [Change] Disabling Qt 5.15.x and below due to the starting of the transition to Qt 6.x +* [Change] Minor layout adjustment in pgmdoeler-se/SchemaEditorForm. +* [Change] Gridlines and delimiters lines now follow the objects' border width. +* [Change] Adjusted the colors of database objects in the dark theme. +* [Change] Minor adjustment in cursor icon when adding new graphical objects to the model. +* [Change] Messagebox will hide "Extra info" tab when the exception does not carry extra error info. +* [Change] ObjectsScene's relationship addition line now follows the page delimiter colors. +* [Change] Updated icns files in apps/pgmodeler/res. +* [Change] The configuration files directory in macOS is now named pgmodeler-1.0 to follow the same pattern as in other OSes. +* [Change] Removed the use of attributes Qt::AA_UseHighDpiPixmaps and Qt::AA_EnableHighDpiScaling. +* [Change] Floating widgets like LayersConfigWidget, AboutWidget, ChangelogWidget, and DonateWidget had CSS changed to obey QPalette changes when using themes. +* [Change] pgModeler default UI theme is now the dark one. +* [Change] Moved the constants ProtRowBgColor, ProtRowFgColor, RelAddedRowBgColor, RelAddedRowFgColor from GuiUtilsNs to ObjectsTableWidget. +* [Change] Update the signal/slot connections in AppearanceConfigWidget to the new syntax connect(obj, &Class::signal, obj1, &Class1::slot) (Experimental) +* [Change] Updated the relationship sample images in RelationshipConfigWidget. +* [Change] Updated the icons of the operations' modes in ModelExportForm. +* [Change] Minor component size adjust in GeneralConfigWidget. +* [Change] Removed unused stylesheet images. +* [Change] The configuration files renamed. Changes pgmodeler.conf -> general.conf, objects-style.conf -> appearance.conf. +* [Change] AppearanceConfigWidget now can handle settings in the file appearance.conf. +* [Change] Minor improvement in BaseConfigWidget::loadConfiguration. +* [Change] DataManipulationForm now deactivates tool buttons' texts according to the dialog height compared to the screen's height. +* [Change] Moved the appearance settings from GeneralWidget to AppearanceWidget. +* [Change] Minor adjustments in sample models. +* [Change] Improved the logic used to load extra stylesheet files in PgModelerApp. +* [Change] Changed the default source code font to 12pt. +* [Change] Adjusted the sizes of descriptors in RelationshipView, BaseTableView, and AttributesTogglerItem to reflect the new default font size. +* [Change] Changed default font size in canvas to 11pt. +* [Change] pgModeler 1.0 configuration directory was renamed from "pgmodeler" to "pgmodeler-1.0" since some config files are now incompatible with 0.9.x. +* [Change] Updated the Windows icons for the apps. +* [Change] Minor size adjustments in pgmodeler-se subproject. +* [Change] Changed the configuration dir name to pgmodeler-1.0 to avoid conflicts with 0.9.x confs. +* [Change] UI stylesheets are now selected depending on the screen size. +* [Change] Changed default icon size of combo boxes. +* [Change] Several layout margins/spacing adjustments in UI files. +* [Change] Size adjustments in ui/settings/*.ui +* [Change] Size adjustments in ui/tools/bugreportform.ui,databaseexplorerwidget.ui,metadatahandlingform.ui,modeldatabasediffform.ui +* [Change] Adjusted the size of icons in tool buttons. +* [Change] Standardization of layout spacing/margin in widgets. +* [Change] Tool buttons resize and layout spacing adjustments. +* [Change] Minor ui component resizes in several forms/widgets. +* [Change] Adjusted sizes in mainwindow.ui welcomewidget.ui. +* [Change] Adjusted ui components on sqlexecutionwidget.ui, modelobjectswidget.ui, operationlistwidget.ui. +* [Change] Adjusted the splash screen asset. +* [Change] Minor icons size adjustment in mainwindow.ui, sceneinfowidget.ui, welcomewidget.ui, modelnavigationwidget.ui. +* [Change] Minor update on toolbars title in MainWindow. +* [Change] Removed *_big* icons. +* [Change] Renamed general_tb to tools_acts_tb and controls_tb to model_acts_tb. +* [Change] Adjustment in the toolbars icon sizes in MainWindow. +* [Change] Adjustment in the stylesheets for the new UI style. +* [Change] Improved the mechanism that guesses if an FK relationship can be rendered as 1:1 or 1:N. +* [Change] Minor adjust in CLI so the "hide-ext-attribs" property in models created before 0.9.2 can be correctly replaced by "collapse-mode" during the model fix operation. +* [Change] PostgreSQL 14 is now the default version for code generation. +* [Change] Disabling the usage of the flag QGraphicsItem::ItemClipsChildrenToShape in BaseTableView to avoid wrong clipping of column items during export to PNG. +* [Change] The workaround in CLI that forces the loading of the offscreen plugin will now be triggered only in the absence of $DISPLAY env var. +* [Change] Isolated the variables common to executables subproject in the file apps/apps.pri. +* [Fix] Fixed the detection of ENTER/RETURN press to find objects in ObjectFinderWidget. +* [Fix] Fixed a bug in ModelWidget that was causing the scene to not recover from blocked signal status if an exception was thrown in ModelWidget::protectObject. +* [Fix] Minor fix in different places that QScreen instances are used. Instead of getting the screen where the active window is, we get the primary screen of the application. +* [Fix] Minor fix in CodeCompletionWidget to resize correclty according to the contents. +* [Fix] Fixed a critical bug that was preventing the importing of data types in CamelCase form. +* [Fix] Minor fix in SyntaxHighlighter to set the correct height of the parent QPlainTextEdit when using single-line mode. +* [Fix] Fixed the configuration of the shadow object in RelationshipView. +* [Fix] Fixed a bug in RelationshipWidget that was not allowing the duplication of attributes and constraints. +* [Fix] Fixed a bug in AttributesTogglerItem that was not resizing buttons when the user changed the font factor. +* [Fix] Fixed an exception in ObjectFinderWidget when searching using attributes different from the name, comment, and schema. +* [Fix] Fixed the long name of foreign-data wrappers. +* [Fix] Fixed a bug when comparing serial and integer columns on diff that was not reusing sequences or changing types properly. +* [Fix] Fixed the SVG exporting process avoiding truncating the resulting graphics. + +v0.9.4 +------ +*Release date: December 17, 2021* + +* [New] Added a fix step in CLI to reconstruct enum types XML code in new format. +* [Change] Changed the way XML code for enum types is generated and loaded. +* [Change] Minor improvement in reverse engineering to import enum types in the new format. +* [Change] Minor adjust in the demo version warning message. +* [Change] Minor adjustment in permission id generation. Now the object's signature is used instead of name. +* [Change] Minor refactor in the reconstruction of XML related to enum types in CLI. +* [Fix] Minor fix in deployment script to support new libicui versions. +* [Fix] Minor fix in order to set read/write permissions when copying configuration files with read-only permissions. +* [Fix] Minor fix in CLI to avoid the usage of '-platform offscreen' when calling the application. +* [Fix] Fixed a bug in file selectors on ModelExportForm that was not allowing to select output folders on Windows and macOs. + +v0.9.4-beta1 +------ +*Release date: November 08, 2021* + +* [New] Added extra PostGiS data types to PgSQLType. +* [New] Created the method PgSqlType::isPostGiSType() which returns true if the current type is a PostGiS one. +* [New] Created the method PgSqlType::reset() that clears some attributes of the type. +* [New] Added the built-in type pg_lsn in order to make databases using timescaledb extension to be imported correctly. +* [Change] Minor adjustment in windowsdeploy.sh to create zip packages. +* [Change] Minor adjustment in demo version warning messages. +* [Change] Adjusted the catalog query filters in ModelDatabaseDiffForm to retrieve system and extension objects according to the checkboxes "Import system objects" and "Import extension objects". +* [Change] Adjusted the reverse engineering in such a way that the table children will follow the SQL disabled state of their parent tables. +* [Change] Allowing importing pg_lsn attributes in usertype.sch. +* [Change] Allowing the use of commas in enum type labels. +* [Change] Improved the output of model fix operation in CLI. +* [Change] The constants DataSeparator, UnescValueStart, UnescValueEnd, WildcardChar, FilterSeparator, FilterWildcard, FilterRegExp were moved from CoreUtilsNs to UtilsNs in order to be used in the parsers module. +* [Change] In SchemaParser the meta char $ds (dollar sign) was renamed to $ms (money sign). Also, a new meta char $ds (data separator) was added and translates to the special data separator character UtilsNs::DataSeparator. +* [Change] Minor adjustments in table.sch and foreigntable.sch schema files. +* [Change] Improved DatabaseModel::getUserDefTypesReferences in order to get all references to postgis data types. +* [Change] Improved ModelValidationHelper in order to set postgis extension a default comment when automatically creating it. +* [Change] PgSQLTypeWidget now can be configured in such a way to disallow the configuration of type qualifiers like length, precision, interval, and some other. This is useful when configuring data types for objects that don't require such attributes in the data type like parameter, aggregates, transforms, casts, operators. +* [Change] Changed the behavior of Parameter::getCodeDefinition when generating SQL code. Now, any type qualifier (except dimension descriptor []) will be discarded. +* [Fix] Fixed the catalog query that lists policies. +* [Fix] Added a minor workaround in DatabaseImportHelper::getType in order to treat the "any" pseudo-type correctly. +* [Fix] Minor fix in DatabaseImportForm in order to disable option buttons when no connection is selected. +* [Fix] Fixed a segfault when importing domains with long expressions. +* [Fix] Fixed the broken SQL generation for tables with columns/constraints disabled. +* [Fix] Fix the name of the checkbox related to updates checking to avoid breaking the building when enabling NO_UPDATE_CHECK via qmake. +* [Fix] Fixed the shortcuts of Copy/Paste actions in DataManipulationForm. + +v0.9.4-beta +------ +*Release date: September 20, 2021* + +* [New] Added the shortcut Alt+C to trigger the cancel action in DatabaseImportForm ModelDatabaseDiffForm and ModelExportForm. +* [New] Added support for the generation of GRANT/REVOKE commands to control roles memberships via the diff process. +* [New] Added a fix step to reconfigure roles membership considering the deprecation of Role:RefRole attribute. +* [New] Added support for included columns on indexes. +* [New] Added the ability to reference view columns on indexes. +* [New] Added support to use view's SimpleColumn in ColumnPickerWidget as well as Index. +* [New] Added .dtd extension to SchemaEditorForm::showFileDialog. +* [New] Created the widget ColumnPickerWidget by isolating the code that handles constraint columns in ConstraintWidget for reusing in other portions of the tool. +* [New] Added the method Constraint::addColumns(). +* [New] Two buttons were added aside the date input fields in partial diff tab (ModelDatabaseDiffForm) in order to allow the quick assignment of the first and last modification dates. +* [New] Added support for toggling update notifications for alpha/beta versions. +* [New] Added support for save and restore the tree state in DatabaseExplorerWidget. +* [Change] Minor improvement in ModelsExportHelper by adding more breaking points related to export canceled. +* [Change] Minor improvement in ObjectRenameWidget in such a way to fill the new name field with the object's name in the first show when a single object is selected for renaming. +* [Change] Dropped the support for MemberOf (Role::RefRoles) in order to make the diff between two roles more precise. +* [Change] In RoleWidget the tab "Member Of" now works only as a convenience feature that adds the role being edited to the ones listed in that tab. +* [Change] Restored the file pgmodeler.appdata.xml. +* [Change] Refactored BaseObject::isCodeDiffersFrom (and its variants in children classes) to use QStringList instead of vector as parameters. +* [Change] Allowing swap cluster level object ids in SwapObjectsIdsWidget when the objects are of the same kind. +* [Change] Minor refactoring in RoleWidget, Role and DatabaseModel to use Role::RefRole, Role::MemberRole and Rele::AdminRole constants as loop indexes. +* [Change] Minor adjustment in demo features. +* [Change] Minor refactoring in Role::setRoleAttribute. +* [Change] Minor improvement in ModelExportHelper::exportToDbms to send the SQL command via a signal when creating roles and the database. +* [Change] Improvements in pgmodeler-se in such a way to control syntax highlighting settings per open editor. +* [Change] Avoided the use of a working dir in .desktop file when installing mime types system-wide. +* [Change] Improved the way layers rectangles are updated after undoing/redoing operations in OperationListWidget. +* [Change] Isolated SimpleColumn struct on its own file for reusing in other modules. +* [Change] Moved the constants ProtRowBgColor, ProtRowFgColor, RelAddedRowBgColor, RelAddedRowFgColor from BaseObjectWidget to GuiUtilsNs. +* [Change] Changed the default match type in foreign key constraint to MATCH SIMPLE. +* [Change] Minor adjustment in the ModelWidget::updateSceneLayers to force the update of all schemas. +* [Change] Avoided a lambda function call when checking updates to prevent segfaults. +* [Change] Exceptions raised in BugReportForm when the "lastmodel" file isn't found are now ignored. +* [Change] Minor change in ModelValidationHelper to use table's signature instead of name during the name validation process. +* [Change] Avoided calling the functions xmlInitParser() and xmlCleanupParser() more than once per app execution in XmlParser class to avoid unexpected behavior. +* [Change] Minor adjustment in viewport drawing mode in order to redraw objects by bounding rect changes. +* [Change] Minor improvements in the changelog widget in order to display the first modification date. +* [Change] Refactored Connection::requestCancel in order to avoid using PQrequestCancel which is deprecated. +* [Fix] Fixed a glitch when drawing StyledTextboxView instaces. +* [Fix] Fix the diff between columns using PostGiS datatypes. +* [Fix] The attributes Qt::AA_UseHighDpiPixmaps and Qt::AA_EnableHighDpiScaling are now correctly set before the instantiation of Application based classes. +* [Fix] Fixed a crash in diff process caused by the ModelExportHelper instance when canceling the export to DBMS when an exception was raised. +* [Fix] Fixed a crash in SwapObjectsIdsWidget when the user tried to swap objects using arrow keys. +* [Fix] Fixed the tab names in RoleWidget. +* [Fix] Minor fix in DatabaseExplorerWidget to display view's children source code. +* [Fix] Fixed the building of IndexWidget on Qt 5.14 and below. +* [Fix] Fixed the problem on ModelDatabaseDiffForm that was not accepting pressing Return/Esc to respectively run the diff and close the dialog due to a conflict with the event loop instance in ModelDatabaseDiffForm::exec(). +* [Fix] Minor fix in the configuration of ObjectGroupId element in DatabaseImportForm::updateObjectsTree in order to avoid crashes when no root element is specified. +* [Fix] Fixed the generation of aggregate functions when they use functions that contain parameters in which data type have spaces (double precision, character varying). +* [Fix] Fixed a segfault that can happen when changing the number of parameters of a function already associated with an aggregate. +* [Fix] Additional fix for layers not being correctly loaded from dbm file. + +v0.9.4-alpha1 +------ +*Release date: July 19, 2021* + +* [New] The bulk editing form now can be confirmed by the Ctrl+Return shortcut. +* [New] The CLI now is capable of fixing models created before 0.9.4-alpha1 that have columns, functions, and other objects that reference extension types with simple names instead of schema-qualified names. +* [New] Added an option to GeneralConfigWidget to toggle the displaying of schema names of columns data types on design view. This option affects only the rendering of objects, the code generation will keep displaying user-defined type names in a schema-qualified way. +* [New] Created the DeletableItemDelegate which draws a delete button aside combobox items. +* [New] Added the ability to drop databases from the database listing in SQLToolWidget. +* [New] Added support to strikeout attribute in SyntaxHighlighter. +* [New] Created an auxiliary tool called pgModeler Schema Editor in order to help to edit *.sch files as well as validate their syntax. +* [New] GeneralConfigWidget now restores the sch-highlight.conf to default. +* [New] Added the environment variable name for schema editor app in GlobalAttributes. +* [New] Added a specific icon for CLI on Windows. +* [New] Added the methods SchemaParser::getCurrentColumn and SchemaParser::getCurrentLine. +* [New] Added signal s_hideRequested to FindReplaceWidget to notify connected slots that the close button on that widget was clicked. +* [New] Added an attribute capture-nearby to the word-separators tag that is read by SchemaParser to indicate if word separators must be capture altogether in the same word if they appear contiguously. +* [New] Added options to create only missing config files or recreate all config file in CLI. +* [New] Added support for saving SQL definition in split files. +* [New] Added support for split SQL generation in CLI. +* [New] Added the ability to cancel the SQL file export process in GUI. +* [New] Created the methods UtilsNs::saveFile and UtilsNs::loadFile in order to replace repetitive save/load code by them. +* [New] Created the function PgSqlVersions::parseString that checks the forced PostgreSQL version is valid, returning a fallback version when needed or raising an error if the version is malformed or is unsupported. +* [New] Added new metacharacter to SchemaParser: $hs for #, $ps for %, $at for @, $ds for $. +* [New] Added the option --force to the mime type handling operation on CLI. +* [Change] Changed the behavior of column click on DataManipulationForm. Now, the sorting is triggered by holding control and clicking the desired column. Clicking a column without holding control will select all the items in that column. +* [Change] Changed the behavior of extension types registration, now they will be forcibly registered with complete name (schema.name) in order to follow the same rule of user-defined data types so the reverse engineering can work properly for both types handled by extensions and those not. +* [Change] Improved the type searching on PgSqlTypeWidget in such a way to display a popup with the data types matching the text typed by the user. +* [Change] Improved TableObjectView to be rendered with/without schema names appended to user-defined data type names. +* [Change] Minor adjustment on icon size of QTreeWidget instances. +* [Change] Improved the NewObjectOverlayWidget in such a way to allow only one action to be executed at a time. +* [Change] Several clean-ups in the source code root. Removed unused files. +* [Change] The subproject libpgmodeler was renamed to libcore and now moved to libs/ +* [Change] The subproject libpgmodeler_ui was renamed to libgui and now moved to libs/ +* [Change] The subproject libobjrenderer was renamed to libcanvas and now moved to libs/ +* [Change] The main executable subproject was renamed to pgmodeler and now moved to apps/ +* [Change] The main-cli executable subproject was renamed to pgmodeler-cli and moved to apps/ +* [Change] The crashhandler subproject was renamed to pgmodeler-ch and moved to apps/ +* [Change] Created a subfolder called "assets" to store all deployed files that aren't libraries or executables: conf, lang, schemas, samples, etc. +* [Change] Refactored all .pro/.pri files in order to reference pgModeler libraries from variables $$LIB[LIBNAME] instead of relative paths. +* [Change] Renamed all icons that were in Portuguese to English. +* [Change] In SnippetsConfigWidget replaced the SQL highlight by Schema micro-language highlighting. +* [Change] Renamed BlockInfo class to TextBlockInfo and moved to a dedicated source file. +* [Change] Changed the workflows to build any *fix, *change, *support branches. +* [Change] Minor improvement on QMainWindow to resize general toolbar buttons. +* [Change] Widgets that were emitting the signal s_visibilityChanged(bool) only on hide event no emit s_hideRequested instead. The s_visibilityChanged(bool) is now reserved to widgets that need to notify visibility changes passing the current state to slots (hidden/displayed) in for of a bool parameter. +* [Change] Minor hint text typos fixes. +* [Change] Improved the syntax error messages in SchemaParser. +* [Change] Minor adjustment in the minimum width of the general toolbar when resizing the buttons. +* [Change] BaseForm::setMainWidget(QWidget *) version will use the same icon as the widget being inserted. +* [Change] Adjusting the general toolbar width according to the screen DPI. +* [Change] Renamed the namespace PgModelerUiNs to GuiUtilsNs. +* [Change] Renamed the namespace PgModelerNs to CoreUtilsNs +* [Change] Source files and ui files in libgui were reorganized by contexts (widgets, tools, settings, utils, dbobjects) +* [Change] Applied an automatic indentation to all schema files. +* [Change] pgModeler will now create missing config files in the startup. +* [Change] Replaced duplicated code that saves files and raises exception by UtilsNs::saveFile +* [Change] The class Schema now has its own id interval (4000 - 4999) in order to make the split code generation be done properly. +* [Change] Minor adjustment in AppearanceConfigWidget to enable scrollbars in the viewport so users on small screens can see the entire model. +* [Fix] Fixed the crash handler and bug report form in such a way to load the last modified model opened before their execution. +* [Fix] Fixed the column positions in ObjectDepsRefsWidget. +* [Fix] Fixed a crash when the database import process fails to create an inheritance relationship somehow. +* [Fix] Fixed a bug in the database import process that not correctly setting up the data type name of columns when the types were handled by extensions. Types handled by extension don't need to have the schema name prepended. +* [Fix] Minor fix in database import process in such a way to properly update the table rendering to hide schema names from title box. +* [Fix] Fixed a malformed SQL code when configuring timestamptz in PgSqlType. +* [Fix] Fixed the reference to libutils in deploy scripts. +* [Fix] Fixed doxygen references for libraries and executables. +* [Fix] Fixed the path to globalattributes.cpp in deploy scripts. +* [Fix] Added missing file windows_ico.qrc. +* [Fix] Fixed a bug in SyntaxHighlighter that was wrongly highlighting the entire document when a multiline group had a line break as the final expression. +* [Fix] Fixed the syntax highligting files (xml, sql). +* [Fix] Minor fix in CLI in order to associate .sch files to the scheditor. +* [Fix] Fixed a bug that was causing all layers to be active even if there was some inactive (invisible) when adding a new layer. +* [Fix] Fixed the method PgModelerCliApp::handleWindowsMimeDatabase to properly insert sch file association in Windows registry. +* [Fix] Fixed the "iCCP: CRC error" in PNGS at libs/libgui/res/icons +* [Fix] Minor fix in SyntaxHighlighter in order to return unformatted word when the group can't be forcibly defined in all exception cases when the word doesn't match any group. +* [Fix] Fixed the description of the option --output in CLI. +* [Fix] Fixed a bug in CLI that could lead to segfault when using diff option and a database model as input. +* [Fix] Fix broken build on Qt 5.11.x. +* [Fix] Minor fix in PgSQLTypeWidget to capture the text changing signal on data type combo so the type format input can be properly updated when the user types the desire data type. + +v0.9.4-alpha +------ +*Release date: May 12, 2021* + +* [New] Added compatibility code that allows loading models created in versions before 0.9.4-alpha without losing layers and active layers information. +* [New] Added an option to the metadata handling operation that serves to indicate if duplicated objects (textboxes, tags, generic sql) must be merged or not. +* [New] Added support for configuration parameters and transform types on functions and procedures. +* [New] Added the compatibility method QtCompat::horizontalAdvance(QFont, QString). +* [New] Added the ability to rename the default layer. +* [New] DatabaseModel now stores in XML code all the new settings related to layers (rect and name colors, rect and names display status). +* [New] Added several methods in ObjectsScene to handle layer colors that helps to save and restore colors from database model files. +* [New] Add support for custom layer colors in LayerConfigWidget. +* [New] Added the class LayerItem to create custom items for displaying layout rects in canvas. +* [New] Added an option to toggle layers rectangles and names from LayerConfigWidget. +* [New] Added support for setup, in general settings, the custom color for grid lines, canvas area and page delimiter lines. +* [New] Added support for multiple layers on the model. +* [New] Added support for PARALLEL attribute to functions. +* [Change] Minor improvement on "Forced filtering" option on ObjectsFilterWidget in order to use a list widget instead of single actions for each object type. +* [Change] Adjusted the default Qt version to 5.15.2 in the deployment scripts. +* [Change] Minor adjustments on Messagebox resizing during first display. +* [Change] Minor improvement on Messagebox in order to display the stack trace toggle button in a more intuitive way. +* [Change] Changed the behaviour of the method ObjectsScene::removeLayers, now it'll allow the resetting or not the layers of the objects. +* [Change] Minor adjustment on QTableWidget vertical header size on DataManipulationForm, ObjectsTableWidget and SqlExecultionWidget. +* [Change] Minor size adjustment policy in the comboboxes in DataManipulationForm, ModelNavigationWidget and ModelValidationWidget. +* [Change] Minor improvement in DatabaseImportHelper::setBaseFunctionAttribs in such a way to discover the name of the functions transform types from their oids. +* [Change] Isolated the duplicated code in DatabaseModel::createFunction and DatabaseModel::createProcedure in the method DatabaseModel::setBasicFunctionAttributes. +* [Change] Adjusted the minimum size of the main window to 640x480 so it can fit in smaller screens. +* [Change] Minor refactoring on SchemaView::configureObject to avoid unecessary calculations when the layers are not visible. +* [Change] Added forced updates of schema rectangles after setting layers to children objects. +* [Change] Change on the search path for PluginsDir to use getPathFromEnv(). +* [Change] LayersConfigWidget will now emit a signal when toggling layer rects/names so the overview widget on mainwindow is properly updated. +* [Change] DatabaseModel will now create a default layer in the constructor. +* [Change] The database model will add the default layer to the loaded model if there isn't a single layer identified. +* [Change] DatabaseModel when loading older database model files will generate random layer colors. +* [Change] The scene now will update layer rects when catching the signal s_objectDimensionChanged from tables and textboxes. +* [Change] Adjust the ObjectsScene to resize layer rects when one or more layers are removed. +* [Change] Improved the window title of DataManipulationForm in sucha a way to display the currently browsed table. +* [Change] Improved the selection of layers to be associated to object in context menu (Quick > Set layers). Now a floating widget is use to select multiple layers for the object selection in the canvas area. +* [Change] Updated the sample models to use "layers" attributes on graphical objects. +* [Change] Changed the value separator for attributes layers and active-layers on from semi-colon to comma. +* [Change] pgModeler CLI will now rename "layer" attributes to "layers" in order to reflect the multiple layers support for older models. +* [Change] Minor copyright updates. +* [Change] The option "Truncate before alter columns" in the diff process was removed since its use is discouraged and dangerous in some situations. +* [Fix] Minor fix in the table's catalog query in order to avoid setting up a partitioning strategy when the table is not a partitioned one. +* [Fix] Minor fix in database import in such a way to update scene layers info before adding it to the main window. +* [Fix] Fixed the layers configuration of example.dbm. +* [Fix] Minor fix in function.sch in order to generate transform types only for PostgreSQL >= 9.5. +* [Fix] Fixed DatabaseModel::getUserDefTypesReferences in such a way to detect that procedures and functions are referencing a user-defined type from their list of transform types. +* [Fix] Fixed ObjectsTableWidget in such a way to control whether the ResizeColsButton can be displayed or not via ObjectsTableWidget::setButtonConfiguration. +* [Fix] Minor fix to avoid black canvas when using settings from 0.9.3 or below on 0.9.4-alpha. +* [Fix] Minor fix in BaseObjectView in such way to avoid the adjustment of its position to the scene grid when the object is not selected. This can avoid undesired adjustment when moving a schema box and having only a portion of its children selected. +* [Fix] Minor fix in ObjectsScene in such a way to update layer rects when the grid alignment option is toggled. +* [Fix] Fixed the buttons shortcuts on LayerConfigWidget. +* [Fix] Minor fix on SchemaView to compute the last position any time the object is reconfigured. +* [Fix] Minor fix in BaseObjectWidget to avoid mark the object as modified in finishConfiguration() before adding it to the parent. +* [Fix] Fixed the key combination to trigger the magnifier tool. +* [Fix] Fixed LayerItem in order to build in Qt 5.9. +* [Fix] Minor fixes in ModelWidget, MainWindow to update scene layer settings correctly. +* [Fix] Fixed the CLI in such a way to update scene layer settings so the exporting processes can generate graphical files correctly. +* [Fix] Minor fix in LayersConfigWidget in such a way to mark the correct active layers when setting up the model to operate on. +* [Fix] Fixed a bug in the layers removal process that was causing objects to be placed in a incorrect layer index after the removal. +* [Fix] Fixed the "Fix" menu in main tool bar. +* [Fix] Fixed a bug in ModelWidget that was causing overlay to be displayed when a textbox object was selected. +* [Fix] Fixed wrong text in collationwidget.ui. +* [Fix] Fixed a bug during the loading of changelog entries. +* [Fix] Fixed the display of warnings during export in ModelExportForm. +* [Fix] Fixed the display of warning messages during export in ModelDatabaseDiffForm. +* [Fix] Fixed a malformed SQL code for triggers. +* [Fix] Fixed typos in README.md. +* [Fix] Fixed the broken build on Qt 5.9.x. +* [Fix] Fixed a bug that was preventing special PKs to be properly configured. +* [Fix] Fixed the SQL generation of functions based on internal language. + +v0.9.3 +------ +*Release date: December 30, 2020* + +* [New] Added support for deterministic and provider attributes in collations. +* [New] Added missing check constraints in the data dictionary. +* [New] Added support for selecting all relationships of a table at once via right-click on a table > select relationships. +* [New] Added extra search fields in ObjectFinderWidget. Now it's possible to search relationships by the involved tables (source and destination table), constraints by their columns (source and referenced columns), and relationships by the foreign keys related to them. +* [Change] The warning message about the unchecked option related to drop missing objects now pops up only when there are partial diff filters configured. +* [Change] Improved the extended fade in/out options for tables/views/foreign tables. +* [Change] The partial diff filters generated from changelog will ignore table children objects in order to avoid the wrong generation of diff code. +* [Change] Minor refactoring in DatabaseModel::addChangelogEntry in order to use new attributes to define changelog operations. +* [Fix] Fixed a crash when trying to select children objects of a schema that has no rectangle defined. +* [Fix] Fixed a crash during the importing of domain objects. +* [Fix] Fixed a crash during the importing of objects into the current model in very specific cases when the model had some tables/views referencing columns added by relationship. +* [Fix] Fixed the full diff switching when there are no filtered objects in ModelDatabaseDiffForm. +* [Fix] Fixed a bug in DatabaseModel::addChangelogEntry that was causing the registration of empty signature for some objects. +* [Fix] Fixed a bug in CLI that was not accepting the use of --list-conns parameter +* [Fix] Fixed the data dictionary generation in such a way to include nextval(sequence) calls in the "default value" column. +* [Fix] Fixed a bug when configuring spatial data types during reverse engineering/diff. +* [Fix] Fixed a bug in Catalog::parseDefaultValues that was causing ARRAY[] values to be wrongly split. +* [Fix] Fixed a bug that was causing infinite validation of imported sequences. + +v0.9.3-beta1 +------ +*Release date: October 5, 2020* + +* [New] Added the version descriptor for PostgreSQL 13. +* [New] Added support for procedures in design, import and diff processes. +* [New] Added support for transforms in design, import and diff processes. +* [New] Added an entry in NewObjectOverlayWidget for procedures. +* [New] Added a custom version of addParameter to Procedure in order to validate the usage of out parameters. +* [New] Added a tool button for transform objects in NewObjectOverlayWidget +* [New] Added a unit test to verify schema files syntax (sql, xml, alter). +* [New] Added the method Cast::setName to override the default behavior of BaseObject::setName. +* [New] Added the class PgModelerUnitTest that must be inherited so the child test class can have access to schema files path. +* [New] Added support for modifying attributes toggler colors from appearance settings. +* [New] Tag objects now include attribute toggler colors. +* [Change] Changed the behavior of the generation of SQL code for database object, now it'll respect the SQL disabled status of the object. +* [Change] The ModelExportHelper will abort the export process if the SQL code of the database object is disabled. +* [Change] The database model is now flagged as modified everytime the objects are swapped. +* [Change] Improved the ObjectSelectorWidget in order to save/restore the geometry of internal ModelObjectsWidget instances. +* [Change] Ajusted the Qt version check in QFontMetricsCompat and QPlainTextEditCompat in order to avoid deprecation warnings. +* [Change] pgModeler will alert about a possible data/work loss if the user is trying to save a model in which there're other instances loaded other tabs. +* [Change] Refactored FunctionWidget in such way to make it a subclass of BaseFunctionWidget. +* [Change] Removing unused method DatabaseModel::removeObject(unsigned,ObjectType). +* [Change] Moved the DTD defintion of parameter tag to a dedicated file to be shared betwen function.dtd and procedure.dtd. +* [Change] Making the class Function be a direct child of BaseFunction. +* [Change] Moved the common code between functions and procedures to a base class called BaseFunction. +* [Change] Replaced the attributes PhysicalTable::DataSeparator and DatabaseExplorerWidget::ElemSeparator usages by PgModelerNs::DataSeparator. +* [Change] Minor improvement on data dictionary in order to add the current year in the footer. +* [Change] ModelExportHelper now is capable of indetifying a transform and procedure objects being exported. +* [Change] Minor fields sizes adjustment in pgsqltypewidget.ui +* [Change] Improved the schema files syntax tests to include all folder under / schemas. +* [Change] Refactored the schema files in order to remove code duplication related to ddl-end token. +* [Change] Minor improvement in ConfigurationForm by adding a splitter between config items (left) and settings page (right). +* [Change] Minor improvements on objects rendering in order to consider screen dpi when configuring objects border sizes. +* [Change] Minor refactoring in the parameter/signature generation in class Function. +* [Change] Making the NewObjectOverlay less transparent in order to enhance reading. +* [Fix] Fixed a bug in constraint.sch that was avoiding the correct importing of exclude of constraints. +* [Fix] Fixed source file name for PgModelerCliApp. +* [Fix] Minor fix in the SyntaxHighlighter in order to highlight correctly multline blocks (specially comments). +* [Fix] Fixed a bug in DatabaseImportHelper that was causing failure when importing some objects' permissions. +* [Fix] Minor fixes on the CLI menu. +* [Fix] Fixed a bug on MainWindow that was wrongly showing the main menu bar in certain cases at startup. +* [Fix] Minor fix in BaseFunction::createSignature in order to remove OUT keywords from signature. +* [Fix] Fixed a bug when importing triggers in which functions arguments contain json/jsonb values. Now values are properly formatted. +* [Fix] Fixed a bug in XmlParser::convertCharsToXMLEntities that was not converting json/jsonb default values correctly breaking the entire XML code of the database model. +* [Fix] Fixed a bug in Parameter class that was causing default values to be ignored. +* [Fix] Fixed a bug in SchemaParser related to exceptions being raised wrongly in expressions evaluation. +* [Fix] Fixed the objects style template config files. +* [Fix] Removed some deprecation warnings when building on Qt 5.15.1. +* [Fix] Fixed a bug in ModelFixForm that was passing arguments to CLI in wrong format. +* [Fix] Minor fix in some project files to remove unnused include paths. +* [Fix] Fixed a bug in CLI that was ignoring input-db parameter when doing diff. +* [Fix] Minor fix in the graphical objects rendering in 4k screens when QT_AUTO_SCREEN_SCALE_FACTOR is set to. Now they are rendered in acceptable proportions. +* [Fix] Minor fix in ModelsDiffHelper in order to avoid generating ALTER...ADD COSTRAINT related to constraints (check and unique) in which parent table is also being created. + + +v0.9.3-beta +------ +*Release date: July 10, 2020* + +* [New] Added GitHub actions scripts in order to test the building on each platform. On Linux and macOs the build will occur on all Qt versions from 5.15 to 5.9, on Windows the build happens only on Qt 5.15 (due to the usage of msys2 that uses the most recent version of the framework). +* [New] Added default constructors in the form "Class(const &)" for Connection, Parameter and TypeAttribute in order to avoid deprecated-copy warnings on GCC9. +* [New] The CLI now validates the mixing of options of different operation modes. +* [New] Added support for partial diffs between a model and database or between two databases. +* [New] Created an internal changelog on DatabaseModel to register object's modification over time being useful for partial diff operations. +* [New] Added the widget called ChangelogWidget to control the model's internal changelog settings in the design view. +* [New] Added support for save/load changelog from model file. +* [New] The CLI now supports partial diffs too. +* [New] Create the method ModelsDiffHelper::getRelationshipFilters. +* [New] Added a warning message prior to the partial diff without using "Do not drop missing objects" option. +* [New] Created a method ObjectsFilterWidget::setModelFilteringMode that disables some options when the filtering widget is being used to filter database model objects. +* [New] Added cast and user mapping to the list of filterable objects. +* [New] Added a hint text in ObjectsFilterWidget to inform about exact match searching. +* [New] Added the methods Catalog::clearObjectFilter and Catalog::clearObjectFilters. +* [New] Added support for DatabaseImportHelper to create a sequence assigned to a column via default value if automatic dependencies resolution is enabled. +* [New] Created the namespace QtCompat that will reunite all the specific code that isn't compatible between different Qt versions. The goal of this namespace is to store in a central point all the code that uses QT_VERSION_CHECK to perform different operations depending on the current Qt version. +* [New] Added the method SchemaParser::getExpressionResult in order to perform comparisons between QVariant values correctly due to the QVariant operators deprecation in Qt 5.15. +* [New] Added the signal ObjectsFilterWidget::s_filtersRemoved that is emitted whenever all filters are removed. +* [Change] Modified the script wingetdate.bat in order to return the build number based on the current local date correctly and renamed it to getbuildnum.bat. +* [Change] Updated to 5.15 the Qt version used by default in linuxdeploy.sh and macdeploy.sh. +* [Change] Replacing verbose QString() calls by "" for string initialization purposes. +* [Change] Improved the sequences assignments to columns in DatabaseImportHelper::assignSequencesToColumns. +* [Change] Improved the method ModelsDiffHelper::setFilteredObjects in order to treat tables/view/foreign tables properly by appending their children objects to the creation order list of filtered objects. +* [Change] Adjusted the Catalog::setObjectFilters in order to configure exact match filters when any wildcard filter provided has no *. +* [Change] Adjusted the partial diff process between a model and a database in which there's one or more many-to-many relationships filtered. +* [Change] Minor adjustment on objects grids in SwapObjectsIdsWidget, DatabaseImportForm and ModelDatabaseDiffForm by changing the columns order. +* [Change] Improved the method ModelsDiffHelper::setFilteredObjects in order to detect the proper creation order of the provided objects. +* [Change] Minor change in ObjectsFilterWidget by making the action "Only matching" checked by default. +* [Change] Minor improvement on CLI to accept the value "all" for the paramenter --force-children in order to force all table children at once. +* [Change] BaseObject::configureSearchAttributes now configures the signature attribute as a formatted string. +* [Change] Minor improvement on ObjectFinderWidget::updateObjectTable in order to optionally create checkable items in the first column. +* [Change] Attributes related to object filters were moved from Catalog to PgModelerNs in order to be shared between Catalog and DatabaseModel classes. +* [Change] Minor improvement in Connection::getConnectionId in order to return an optional HTML formatted string. +* [Change] Isolated the method DatabaseImportForm::listFilteredObjects in a static one in order to reuse it on ModelDatabaseDiffForm. +* [Change] Improved the objects filtering in such way to allow filter by name or signature. +* [Change] Improved the UI of ObjectsFilterWidget by moving all options to a popup menu. +* [Change] Several changes in all catalog queries in order to support signature matching. +* [Change] Minor adjustemnt in Catalog::getFilterableObjectNames. +* [Change] Adjusted the appimages building process. +* [Change] Changing the default font size of graphical objects to 10pt in order to try to solve the intermittend issue of disappearing texts. +* [Change] Updated the French translation. +* [Fix] Fixed a regression in ObjectFinderWidget that was not opening objects form with double-click on an item on the results grid. +* [Fix] Fixed a bug when drawing relationships in FK to PK connection mode. Now when one of the tables is collapsed the center points of both are used as connection points to the relationship. +* [Fix] Fixed a crash in ModelDatabaseDiffForm while enabling/disabling the partial diff tab. +* [Fix] Fixed the diff process for inheritance relationships created for two existing tables. +* [Fix] Fixed a crash in LayersWidget when renaming a layer. +* [Fix] Minor fix in DatabaseImportHelper::assignSequencesToColumns. +* [Fix] Fixed a wrong comparison in Catalog::getObjectsOIDs. +* [Fix] Minor fix in ConstraintWidget that was trying to validate FK relationships for generated tables of many-to-many relationships. +* [Fix] Fixed a bug in Catalog::getObjectsOIDs that was executing a catalog query for a certain object when it was not being filtered. +* [Fix] Minor fix in ModelDatabaseDiffForm tabs enabling/disabling steps. +* [Fix] Fixed the QProcess usage in ModelFixForm due to QProcess::start() deprecation in Qt 5.15. +* [Fix] Fixed a crash when trying to move several objects to a layer from the object finder widget and in the selected set one or more objects aren't graphical ones. + +v0.9.3-alpha1 +------ +*Release date: May 20, 2020* + +* [New] Added support for creating initial configuration files from CLI. +* [New] The CLI is now capable of using the objects filtering in reverse engineering. +* [New] Added a warning message when trying to import a big database. +* [New] Added support for object filtering in reverse engineering dialog. +* [New] Adding support for AppImage building for Linux. +* [New] Added support for importing PostgreSQL 12 generated columns. +* [New] Adding support for PostgreSQL 12 generated columns. +* [New] The ModelNavigationWidget now will display a save icon if the current model is pending a save operation. +* [New] pgModeler now guesses if a FK relationship consists in a one-to-one based upon the foreign keys and unique keys settings. +* [New] Improved the rendering of FK relationships. Now it recognizes the minimum cardinality by using the right crow's foot descriptor o|< or ||< in the destination entity. +* [New] Added support for the conversion of 1-1 and 1-n relationships, allowing the user to perform modifications over objects generated by those relationships. +* [New] Added "virtual" keyword in classes that inherit others so the destruction order can be followed correctly. +* [New] Adding support for copy model validation widget output as text as well preview it as texts. +* [New] Added support for show/hide all layers in LayersWidget. +* [New] Added the paramenter application_name to Connection in order to indentify connections created by pgModeler when querying pg_stat_activity. +* [New] Added support for save/restore Z value attribute in MetadataHandlingForm. +* [New] Created an improved and reusable file selector widget. +* [Change] Improvements done in DatabaseImportHelper in order to speed up the listing of types as well the importing user-defined types on demand. +* [Change] Refactored the way default value fields states are setup by user's actions. +* [Change] Adjusted the default size of DatabaseImportForm. +* [Change] Avoiding retrieve all types (system and user defined) at once before the reverse engineering in DatabaseImportHelper (Experimental). +* [Change] Minor improvement on DatabaseImportHelper in order to display the correct message while assingning sequences to columns. +* [Change] Improved the catalog queries in order to retrive parent oids and type when using the list queries. +* [Change] Minor updates on windeploy.sh and macdeploy.sh +* [Change] Minor improvement on DatabaseImportHelper in order to speed up the objects creation. +* [Change] Improved the execution time for the catalog query of data types. +* [Change] Improved the catalog query for sequences. +* [Change] Avoiding the diff process to generate default value changes for generated columns. +* [Change] Minor improvement on DatabaseModel::validateRelationships. +* [Change] Improved the ModelWidget::convertRelationship1N() in order to avoid segfaults in certain cases. +* [Change] Minor adjustment in PhysicalTable::restoreRelObjectsIndexes in order to diminish memory usage. +* [Change] Minor improvement on update icon. +* [Change] Minor improvement in LayersWidget in order to allow manual resizing using the mouse. +* [Change] Improved the following classess in order to use the new file selector widget: ModelExportForm, ModelFixForm, MetadataHandlingForm, ModelDatabaseDiffForm, GeneralConfigWidget, PluginsConfigWidget, CsvLoadWidget, CrashHandlerForm and BugReportForm. +* [Fix] Minor fix in OperationList in order to update FK relationships related to FKs that contains the column being handled by the list. +* [Fix] Fixed a bug when retrieving the refs to some objects in DatabaseModel. +* [Fix] Minor fix in CLI menu and error messages. +* [Fix] Fixed the role importing process. Now referenced roles are auto resolved. +* [Fix] Fixed the dependency checking for user defined types in DatabaseModel. +* [Fix] Fixed a bug when loading extension that has no schema specified. +* [Fix] Minor fix in DatabaseImportHelper::createFunction in order to solve eventual duplicated parameter names when importing some functions. +* [Fix] Fixed a bug that was causing global name patterns for relationships to never be used even if they were properly configured. +* [Fix] Minor fix in ModelObjectsWidget and ModelWidget to provide the correct information about objects' selection in SceneInfoWidget. +* [Fix] Fixed a bug in RelationshipWidget that was causing the cursor never to be restored to its original icon when an exception occurred during relationship editing. +* [Fix] Fixed a crash in some situations when closing models. + +v0.9.3-alpha +------ +*Release date: March 26, 2020* + +* [New] Added support for multiselection in ModelObjectsWidget. +* [New] Added an optional parameter in PgModelerNs::generateUniqueName to avoid comparing the input object. +* [New] Added support for objects' bulk renaming. +* [New] Added support for multiselection in ObjectFinderWidget. +* [New] Added support for middle button click on source code panel in order to paste the selected code in the current open SQL execution widget. +* [New] Using the CRTP (Curiosly Recurring Template Pattern) approach to create a template type based on BaseType in such way that the static member from that template but used on all derived classes of TemplateType can be unique for each derived class. +* [New] Added a "Stacking" action in popup menu that is used to control the z value of graphical objects. +* [New] Adding support for move objects on the Z stack up and down. +* [New] Added support for CLI to write system wide mime database on Linux and Windows. +* [New] Added a method GlobalAttributes::setSearchPath so the application can setup the path in which the internal folders (schemas, lang, etc) can be found. +* [New] Added the ability to remove owners from objects from Quick Actions > Change owner. +* [New] Added an fix step that removes IN keyword from functions signatures. +* [Change] Refactored the method DatabaseModel::getObjectDependecies by splliting it into small portions that handles specific object types dependecies. +* [Change] The DatabaseModel::getObjectReferences was splitted in other get[object]References() in order to facilitate maintainance. +* [Change] Minor adjustments in order to make the objects listing a bit faster for large databases. +* [Change] Minor improvement on ObjectRenameWidget in order to apply renaming in reverse id order of the object so objects invalidations (due to relationships revalidations) diminishes. +* [Change] In DatabaseModel the invalidated special objects are now stored in a list which is destroyed only when the model is destroyed too. This will avoid segfaults in some cases when the objects in that list are still being referenced in the operation list (Experimental). +* [Change] Minor adjustment in ModelObjectsWidget and ObjectFinderWidget in order to emit the signal ModelWidget::s_sceneInteracted so the left menu at MainWindow can be updated accordingly. +* [Change] Minor change in PgModelerNs::generateUniqueName in order to remove quotes from names before perform the comparison. +* [Change] Refactored ObjectRenameWidget in order to support multiple objects renaming. +* [Change] Refectored all the classes derivated from BaseType moving them to dedicated sources files in order to make them reuse TemplateType class isolating the related keywords, improving maintainance. +* [Change] Removed the class LanguageType since it was replaced by namespace DefaultLanguages namespace. +* [Change] Isolated the default language names into a namespace called DefaultLanguages and removed any reference to LanguageType in the code. +* [Change] Improved the DataManipulationForm in such way that the user can sort results by clicking the column names in the result grid. This will cause a new query to be performed by using the clicked column as sorting criteria. +* [Change] The current model's popup menu is now used as the "More" actions menu at MainWindow > general toolbar. +* [Change] Refactored the ModelWidget::configurePopupMenu separating some portions in new methods to make maintainance more easy. +* [Change] Moved the 'Fix model' and 'Objects metadata' actions to the general toolbar (left) at main window under the menu "Fix". +* [Change] The class HintTextWidget was removed and replaced by simple html QToolTips. +* [Change] Small change in the icon related to new tab opening in SQLToolWidget. +* [Change] Minor adjustment or rows resizing policy on datamanipulationform.ui. +* [Change] Minor adjustment on updatenotifierwidget.ui to allow link opening. +* [Change] Refined the installer wizard pages. +* [Change] Improved the installer script to work better on Windows. +* [Change] Improving the installer on Linux and Windows to select the installation for all users or current user. +* [Change] Improved the linuxdeploy.sh in order to remove the need to use the startup scripts by the binaries in the installer. +* [Change] Fixed the installscript.qs in order to correctly update the mime database on Linux. +* [Change] Minor improvements on the usability of swap objects ids form. +* [Change] Separated the code that handles mime db on linux and windows, using a #ifdef switch to call the correct method depending on the platform. +* [Change] Adjusting the linker options to make the executables search for libraries in PRIVATELIBDIR without forcing the usage of LD_LIBRARY_PATH. +* [Change] The class Application was moved to libutils and has a basic implementation of just initialize the search path on GlobalAttributes. +* [Change] Rename the classes Application and PgModelerCli to respectively PgModelerApp and PgModelerCliApp and they now inherits the new Application class in order to take advantage of the GlobalAttributes::setSearchPath. +* [Change] The crash handler application is now executed under a Application instance not a QApplication anymore in order to use GlobalAttributes::setSearchPath. +* [Change] Changed the namespace GlobalAttributes to a singleton in order try to solve problems with fallback paths. +* [Change] Updated deployment scripts to use Qt 5.14.x +* [Change] Changing the exposed main window from QMainWindow to MainWindow in PgModelerPlugin interface. +* [Change] Moved the method SchemaParser::convertCharsToXMLEntities to XmlParser. +* [Change] Minor buttons position adjustments on WelcomeWidget. +* [Change] Minor refactoring on OperationListWidget in order to show a more compact text when displaying operations done over objects. +* [Change] Removed the workaround code that disables the ALTER SET OWNER when the role associated to it is disabled and the object itself not. The best approach is to dissociate the role from the object so the ALTER instruction is not generated. +* [Fix] Fixed a shortcut duplication in DatabaseExplorerWidget +* [Fix] Fixed the shortcut for partitioning relationships in new object overlay +* [Fix] Fixed a minor bug in MainWindow that was causing the bottom widgets bar to be displayed even when object finder widget and model validation widget weren't visible. +* [Fix] Fixed a bug that was causing copy options to stay hidden for copy relationships in the relationship form. +* [Fix] Fixed the importing of extensions on PostgreSQL 9.4 and below. +* [Fix] Fixed the name uniqueness generation when the name is truncated when exceeding 63 bytes. +* [Fix] Fixed a bug that was preventing the recent menus cleaning to be persisted in the conf file. +* [Fix] Fix a bug in the validation of collation objects. +* [Fix] Fixed a crash in ObjectRenameWidget when renaming several objects in which there was the need to revalidate relationships; +* [Fix] Fixed the method PgSqlType::getTypes in order to avoid returning the first (null) type. +* [Fix] Fix the importing/diff of columns based on PostGiS data types. +* [Fix] Fix a crash in UpdateNotifierWidget when compiling pgModeler using Qt 5.14.x. +* [Fix] Minor fix in PgSQLTypeWidget to avoid show an error message box when the user types an invalid data type name. +* [Fix] Additional fix on XmlParser::convertCharsToXMLEntities in order to replace special char to xml entities correctly. +* [Fix] Minor fix in the update notifier widget display position. +* [Fix] Minor fix in diff regarding to the comparison on column/domain default values. Now the values are compared in insensitive case. +* [Fix] Fixed the Windows installer in order to create the start menu item correctly (system wide). +* [Fix] Minor fix on CLI in order to allocate export/import/diff helpers and config widgets only when they are required (when one of the options related are used). +* [Fix] Fixed a bug that was allowing the applying changes of the forms on relationship added objects by hitting ENTER causing crashes. +* [Fix] Fixed the bug that was causing model restoration to be displayed when the application was started from a double click on a model file. +* [Fix] Fixed a bug in the metadata handling that was not restoring the collapse mode of tables. +* [Fix] Fixed a crash on UpdateNotifierWidget after upgrading to 5.14. A wrong deletion was being performed where deleteLater() needed to be used instead +* [Fix] Removing lots of Qt 5.14 deprecation warnings in the code. +* [Fix] Fix a bug that was causing wrong replacements during the reverse engineering of functions. +* [Fix] Fixed the method XmlParser::convertCharsToXMLEntities in order to avoid chars replacements within ) to return the first ocurrency in the lists related to the provided types. +* [New] Added support for select all foreign tables in ModelWidget. +* [New] Created the method BaseTable::isBaseTable to help determining if an object type is of Table, View or ForeignTable. +* [New] Added extra support for foreign tables on DatabaseExplorerWidget and DataManipulationForm. +* [New] Added the method DatabaseImportHelper::createColumns in order to isolate the code to create table/foreign table columns during reverse engineering. +* [New] Added support for foreign table importing as well its children objects (columns, constraints, triggers). +* [New] Added server and options fields on TableWidget for foreign table. +* [New] TableWidget now fully supporting the edition of foreign tables. +* [New] Added the ability to TableView to render ForeignTable objects. +* [New] Added support for swap objects ids using arrow keys by changing creation order between two close objects on the grid. +* [New] Added support for save diff settings in form of presets. +* [New] Added an option to BaseObject to force the comment escaping making multilined comments be presented as single lines but without changing their semantics. +* [New] Adding support for parse escaped text delimiters and value separators in CSVLoadWidget. +* [Change] Avoiding the usage of "Generate ALTER commands" option when the table is a partition or partitioned. +* [Change] Avoid unchecking PK checkboxes on TableWidget when adding a new column. +* [Change] Validating the dialogs geometry regarding to screens geometry in order to avoid their appearance in an invalid position (out of range). +* [Change] Limiting the size of the exceptions stack in 50 elements. +* [Change] Improved the GenericSQL::isObjectReferenced in order to check if, when a referenced object is a column, the provided object is the same as the parent of that referenced object. +* [Change] Restricting the usage of "Default partition" option for partitioning relationships when the partition table is a foreign table. +* [Change] Making ModelObjectsWidget update the foreign table subtree. +* [Change] Making ReferenceWidget to use foreign tables from referenced table selector. +* [Change] Improved the Relationship class to accept foreign tables. +* [Change] Improved the DatabaseModel::getObjectDependecies and DatabaseModel::getObjectReferences to include ForeignTable. +* [Change] Updated View class to accept reference foreign table columns. +* [Change] Moved the original implementation of DatabaseModel::createTable to a template method createPhysicalTable in order to reuse it to create tables and foreign tables. +* [Change] ForeignObject is not a BaseObject child anymore due to multi inheritance problem that it can generate in ForeignTable class. +* [Change] Minor ajustment in Relationship class to accept PhysicalTable in its constructor so relationships can be used by ForeignTable class as well. +* [Change] Isolated the code common to Table and ForeignTable classes in a parent class named PhysicalTable. +* [Change] Disabling mime type update on installers. +* [Change] Minor adjustment on SQLExecutionWidget::generateBuffer to escape line breaks and separators when generating CSV buffer. +* [Change] Removing unused code from NumberedTextEditor. +* [Change] Changed the way temp source file is handled by the tool in order to solve a sharing violation problem on Windows. +* [Change] Minor adjustment on HtmlItemDelegate to avoid creating local variables in paint() everytime the method is called. +* [Fix] Fixed an bug in SQL generation of columns that was wrongly removing a comma from decimal data types. +* [Fix] Fixed some catalog queries in order to support PostgreSQL 12. +* [Fix] Fixed ObjectsScene to remove foreign tables during destruction. +* [Fix] Fixed the View::getObjectCount in order to return 0 when the provided object type is invalid. +* [Fix] Fixed the ObjectFinderWidget in order to fade out correctly the listed/not listed elements. +* [Fix] Fixed the quick actions menu at ModelWidget in order to include the "Edit data" action for foreing tables. +* [Fix] Fixed the DatabaseImportHelper::assignSequencesToColumns in order to correctly assign sequences to foreign table columns. +* [Fix] Fixed a crash in ModelValidationHelper that was caused by wrong checking when validating generic sql objects. +* [Fix] Fixed the source code display for tables and foreign tables on DatabaseExplorerWidget. +* [Fix] Fixed the CodeCompletionWidget to display foreign table children. +* [Fix] Fixed the loading of generic SQL objects when a referenced object was a column. +* [Fix] Additional fixes to correctly reference foreign tables and tables in the portions were both classes are acceptable/desirable. +* [Fix] Fixed the diff process in order recognize partition foreign tables attach/detach. +* [Fix] Fixed the generation of XML code of partitioning relationships. +* [Fix] Fixed the Relationship::getAlterRelationshipDefinition to include foreign tables. +* [Fix] Fixed the preset.sch since it was not registering the "Reuse sequences" options correctly. +* [Fix] Improved the DataManipulationForm in order to restore the columns visibility when retrieving again the data of the current table. +* [Fix] Fixed the drop action in DatabaseExplorerWidget for user mappings. +* [Fix] Fixed the ModelWidget::rearrangeTablesInGrid to adjust position of foreign tables. +* [Fix] Fixed the generation of SQL code of partition tables in order to avoid the inclusion of partitioned tables columns on the code. +* [Fix] Fixed a crash on DatabaseImportHelper when destroying detached inherited columns. +* [Fix] Fixed the object duplication operation in model widget to accept duplicate foreign table children objects. +* [Fix] Fixed the creation of relationships involving foreign tables. +* [Fix] Fixed the permission object in order to support foreign tables. +* [Fix] Fixed the model export helper to support foreign tables. +* [Fix] Fixed ModelWidget to show missing popup actions for foreign tables. +* [Fix] Fixed the NewObjectOverlayWidget to display tool buttons related to foreign table children. +* [Fix] Fixed the SchemaView::fetchChildren to include foreign tables in the returned list. +* [Fix] Fixed the ModelValidationHelper to validate foreign tables and table-view relationships. +* [Fix] Fixed ColumnWidget and ConstraintWidget to accept foreign tables usage. +* [Fix] Fixed a regression when importing permissions related to functions. +* [Fix] Fixed the OperationList to handle foreign tables. +* [Fix] Fixed create methods in DatabaseModel related to table children object in order to accept foreign tables. +* [Fix] Fixed the SwapIdsWidget postion/size saving and restoration. +* [Fix] Minor tooltip fix in GeneralConfigWidget. +* [Fix] Minor fix in default conf files removing unused tag attribute. +* [Fix] Additional fix to the extension import to correctly indetify it as a data type handler. +* [Fix] Fixed a bug on Role's SQL generation due to a missing attribute. +* [Fix] Additional fix in GeneralConfigWidget to save correctly the settings of dockwidgets. +* [Fix] Minor fix in DatabaseModel to write ddl end token in the appended/prepended custom code. +* [Fix] Fixed a false-positive result when doing the diff between two fuctions that contains the same signature. +* [Fix] Fixed the diff generation for Role objects when setting up an blank password. +* [Fix] Fixed the "Prepend at the beggining of the model" option behavior on CustomSQLWidget. +* [Fix] Fixed the catalog query for extension in order to indetify correctly if this object handles a data type. +* [Fix] Fixed the Variadic option enabling on ParameterWidget. +* [Fix] Fixed the saving of validator widget settings. There was a conflict between pgsql-ver attributes present on the validator settings and the default attribute added by the schema parser. The solution was to use a different attribute (version) in the validator. +* [Fix] Fixed the "Clear items" action in popup menu at DataManipulationForm. +* [Fix] Fixed the importing of tables and views in such way to automatically create correctly the domains referenced by their columns. +* [Fix] Fixed a bug on ModelDatabaseDiffForm that was causing the form to be reseted on the middle of a diff process when the user minimize the diff dialog causing unexpected behavior (or even crashes sometimes). +* [Fix] Minor fix in AboutWidget. +* [Fix] Minor fix in ModelDatabaseDiffForm to avoid using uniform items height in output widget. + +v0.9.2-beta1 +------ +*Release date: September 2, 2019* + +* [New] Added a routine to write a backup file during the saving of model files in order to avoid data loss in some rare cases. +* [New] Added a new action on DataManipulationForm to clear the selected items by pressing Ctrl+R. +* [New] Enabling/disabling the save model action according to the model's modified status. +* [New] The main window instance is now exposed to plugins to make the extra features development more flexible. +* [New] Avoiding selecting table items in BaseTableView::mousePressEvent which doens't contain an underlying (source) object. +* [New] Adding support for duplicate several table objects at once. +* [New] Added support for table children multiselection by using Ctrl+Shift+Click on them. +* [New] Added support for load the generated diff code in the SQL tool and automatically browsing the destination server for manual diff applying. +* [New] Added a button to create a new data manipulation form from within another data manipulation form. +* [New] Added a confirmation message before closing a database explorer widget. +* [Change] Minor adjustments in PgModelerUiNs::createOutputListItem and PgModelerUiNs::createOutputTreeItem to better display formatted messages. +* [Change] Minor improvement on CSV text copying to exclude from the buffer the hidden columns. +* [Change] Adjusted the font weight on WelcomeWidget (only for Linux). +* [Change] Minor adjustment on tool buttons font size on DataManipulationForm. +* [Change] Improved the UI of the DataManipulationForm by rearranging the tool buttons to the left of the dialog. +* [Change] Improved the clipboard text pasting on DataManipulationForm in order to parse the text as CSV when Ctrl+Shift+V is pressed. +* [Change] The filter input on SQLExecutionWidget is now automatically focused when toggling the filter widget. +* [Change] Changed the default behavior of result set filtering to Qt::MatchContains on SQLExecutionWidget. +* [Change] Avoiding showing the "Swap ids" action in popup menu when we have only columns/constraints selected +* [Change] Minor adjustment on SceneInfoWidget to avoid display dimensions of selected columns/constraints on the canvas. +* [Change] Renamed the method BaseGraphicObject::getReceiverObject to getOverlyingObject (to make sense with its counter part BaseObjctView::getUnderlyingObject) +* [Change] Avoiding clear the whole scene selection when the table is already selected and the user requested popup menu. +* [Change] Renamed BaseObjectView::getSourceObject to getUnderlyingObject. +* [Change] Improved the object protection action in ModelWidget in order to accept the multi item selection on tables. +* [Change] Changed the way the PSVI attribute is handled in xmlparser to retrieve big line numbers on a xml document. +* [Change] Improved the diff code preview allowing the user to close the dialog without going back to previous tab and click 'Cancel'. +* [Change] Minor adjustment on buttons shortcuts/tooltips on DataManipulationForm. +* [Change] Changed the way the model saving timers are controlled to avoid infinity savings on the model (when the auto saving option is disabled) making the application unusable. +* [Change] Making the mime update operation return exit code 0 even if there was errors (still displayed in the console). This will avoid the installer to abort installation when the dbm mime update fails. +* [Change] Avoiding applying fillfactor to gin indexes. +* [Change] Moved the method DatabaseImportHelper::parseIndexExpressions to Catalog class. +* [Fix] Fixed a broken diff code generation for policies. +* [Fix] Fixed the object duplication action when only a single table object is selected. +* [Fix] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns +* [Fix] Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection. +* [Fix] Fixed a false-positive diff result when dealing with timestamptz. +* [Fix] Fixed the progress calculation of dbm files loading. +* [Fix] Fixed a bug that was causing the generation of broken view code. +* [Fix] Fixed the display of index expressions on DatabaseExplorerWidget. +* [Fix] Minor fix on SQLExecutionWidget to avoid results grid to overlap command execution history widget in certain cases. + +v0.9.2-beta +------ +*Release date: May 31, 2019* + +* [New] Added support for user mapping. +* [New] Added support for foreign server. +* [New] Added support for foreign data wrapper. +* [New] Added support for reduced verbosity on diff, export and import processes in order to improve performance. +* [New] Adding missing tootip on ObjectFinderWidget. +* [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. +* [New] Added support for compare foreign servers on diff process. +* [New] Created a generic getAlterDefinition on ForeignObject. +* [New] Added ForeignServer toolbutton in NewObjectOverlayWidget. +* [New] Added support for the reverse engineering user mapping objects. +* [New] Added support for the reverse engineering foreign server objects. +* [New] Added code snippets for foreign data wrapper and foreign server. +* [New] Added support for diff user mapping. +* [New] Added support for diff foreign data wrappers. +* [New] Added support for set permissions to foreign data wrapper. +* [New] Added the WRAPPER, SERVER and MAPPING key words to sql-highlight.conf. +* [New] Added the method PgSqlType::isExactTo in order to do a full comparison (all attributes) between two data types. +* [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. +* [New] Added missing data type macaddr8. +* [New] Enabling quick clear button on several input fields. +* [New] Added support for result set filtering in the SQL execution widget. +* [New] Adding a column labeled "Comment" in TableWidget and ViewWidget to hold comments of children objects. +* [Change] Changed the shortcut of run SQL action in SQLExecutionWidget to F5. +* [Change] Changed the shortcut of tree update action in DatabaseExplorerWidget to F6. +* [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. +* [Change] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. +* [Change] Added missing code documentation. +* [Change] Minor adjustment on ForeignDataWrapper::getAlterDefinition. +* [Change] Minor improvement on ModelDatabaseDiffForm to show the connection id of the databases being imported in the output tree. +* [Change] Formatting server objects' attributes on DatabaseExplorerWidget. +* [Change] Minor adjustments on the icons of the buttons in ObjectsTableWidget. +* [Change] Improved the method DatabaseModel::getObjectReferences to detected foreign data wrappers as functions' references. +* [Change] Minor code refactoring on Table and View classes. +* [Change] Renamed the method Exception::getErrorType to Exception::getErrorCode. +* [Change] Improved the ModelValidationWidget in such way that is possible to operate over objects on the output list through their respective context menu (the same as in the ModelWidget). +* [Change] Now its possible to trigger the swap ids dialog for two selected objects, causing their ids to be swapped more quickly. +* [Change] Minor refactor on schema files. +* [Change] Minor attributes refactoring on several classes. +* [Change] Minor change in the PgSqlType constructor by turning some parameters optional in order to facilitate the creation of array only types. +* [Change] Minor update on disclaimer text at start of the source files. +* [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. +* [Change] Increased the maximum limit of SQL history. +* [Change] Updated the windeploy.sh and the installer scripts. +* [Change] Adjusted the installer scripts. +* [Change] Changed the windows deploy script to use Qt Installer Framework. +* [Change] Adjusted the deploy script to use Qt 5.12. +* [Change] Fixed the windows deploy script to use newer version of the compiler in 64 bits environment. +* [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Change] Adjusted the resize parameters in DataManipulationForm to avoid wrong dialog resizings mainly on Windows. +* [Fix] Fixed a bug in DataManipulationForm that was deleting new rows wrongly. +* [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. +* [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. +* [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. +* [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. +* [Fix] Fixed a crash related to destruction of special objects on DatabaseModel::destroyObjects. +* [Fix] Fixed a bug that could crash the application when no language was specified to a funcion and the SQL/XML code was being generated. +* [Fix] Minor fix a bug on index importing. +* [Fix] Minor fix on View::isReferencingTable. +* [Fix] Fixed a crash when a query executed in SQLExecutionWidget was a DDL one or was not returning results. +* [Fix] Fixed a bug in CLI that was failing to fix model in certain cases. +* [Fix] Minor fix on buttons tooltips. +* [Fix] Fixed a bug that was causing syntax error if the last column of a table had the SQL code disabled. +* [Fix] Fixed a bug on diff process due to a missing attribute on the generation of diff code for inheritance relationships. +* [Fix] Fixed a bug when rendering several self relationships attached to the same table. +* [Fix] Fixed the CLI in order to restore the layers information when fixing a broken model. +* [Fix] Fixed a bug in object finder that was causing objects from a hidden layer to be displayed causing inconsistency on the layer state. + + +v0.9.2-alpha1 +------ +*Release date: December 17, 2018* + +* [New] Added support for scene layers. +* [New] Added support for view's columns importing in DatabaseImportHelper. +* [New] Added the ability to load view columns from database model file in DatabaseModel::createView. +* [New] Added a tab "Columns" in ReferenceWidget where the user will be able to insert columns to be used as view columns. +* [New] Added support for pagination of tables and views columns pagination. +* [New] Added a pagination toggler action on context menu at ModelWidget. +* [New] Added a fix step on CLI to remove the deprecated attribute hide-ext-attribs from tables and views xml code. +* [New] Added a configuration option to control attributes per pages in tables and views. +* [New] Added support for save collapsing states and current attributes pages to the database model file. +* [New] Added constants to reference child objects of TableObjectView. +* [New] Added the class TextPolygonItem which can be used to draw a text over a background polygon. +* [New] Added support for OLD/NEW tables aliases on triggers. +* [New] Added a hint text on RelationshipWidget to document the correct usage of default partitions. +* [New] Added support for partition attaching/detaching detection in diff process. +* [New] Added auxiliary methods in Table class in order to add/remove and retrieve partition tables. +* [New] Added support for importing partitioned/partition tables on DatabaseImportHelper. +* [New] Added a missing validation in Relationship to avoid creating other types of relationships involving partitioned or partition tables. +* [New] Added support for specify partition bounding expression on partitioning relationships. +* [New] Added support for resize grid cells to fit contents on ObjectsTableWidget. +* [New] Added a tab "Partition keys" that will handle partitioning configuration on TableWidget. +* [New] Added a method in ObjectsTableWidget to hide some horizontal header sections. +* [New] Added some validations when creating partitioning relationships. +* [New] Added support for hide columns on data manipulation dialog. +* [New] Added a transient attribute to objects DatabaseModel, Table and View in order to give a hint on the maximum count of objects held. This attribute is used to preallocate the vectors which store the children objects in order to avoid excessive memory allocation/deallocation due to vector resizing. +* [New] Added a column labeled "Alias" on all objects tables in TableWidget so the aliases of children can be displayed. +* [New] Added support for adding tabs via shortcut or corner button in the SQL Execution panel. +* [Change] Minor adjustments on MainWindow to make the overview widget to update its contents whenever the active layers change on the current model. +* [Change] Minor adjusment in ObjectsScene::addItem to make the item (in)visible according to the visibility of its related layer. +* [Change] Minor fix in AttributesTogglerItem in order to consider the parent's opacity during painting. +* [Change] Minor fixes in OperationList in order to force views to be updated correctly when operating over a table which is referenced by those objects. +* [Change] Minor adjustments on SchemaView and BaseTableView (and its children classes) to update the geometry when they switch from invisble to visible state. +* [Change] Changed views in such way so they can use the struct SimpleColumn to represent their deduced columns. +* [Change] Improved the update of views when referenced columns and tables change their structure. +* [Change] Improved database model loading times by avoiding the rendering of tables while the children objects (indexes, trigger, rules, etc) are being added. +* [Change] Removed the several operators ~ overloading that statically cast enums to their underlying type and created a template function called enum_cast in C++14 syntax. +* [Change] The zoom in/out level is now sensible on how much the user rolls the mouse wheel. +* [Change] Move the default implementation of configureObjectShadow and configureObjectSelection from BaseObjectView to BaseTableView. +* [Change] Disabling configureObjectSelection and configureObjectShadow on TableObjectView and RelationshipView. +* [Change] Minor adjustment on protected icon position on TableTitleView and TextboxView. +* [Change] Minor performance adjustments in ModelWidget. +* [Change] Minor improvement in TextboxView to use only a TextPolygonItem to hold text and the object's rectangle instead of a box and a text items. +* [Change] Replaced the sql_info_txt and sql_info_box items by a single instance of TextPolygonItem to denote SQL disabled status. +* [Change] Replace the tag_body and tag_name elements on BaseTableView by the tag_item which is a instance of TextPolygonItem. +* [Change] Improved the TableObjectView to avoid adding extra scene items. +* [Change] Improved the TableTitleView to avoid adding children items. A custom paint() method now draws them. +* [Change] Removing unused fr_FR UI translations. +* [Change] Minor update on known issues sections at README.md. +* [Change] Renamed the namespace ParsersAttributes to Attributes and its attributes has been refactored. +* [Change] Refactored all static const attributes of the classes present in pgsqltypes.h. +* [Change] Renamed PgModelerNS to PgModelerNs. +* [Change] Renamed PgModelerUiNs to PgModelerUiNs. +* [Change] Renamed XMLParser to XmlParser. +* [Change] Removing uneeded temporary QString instance created from Exception::getErroMessage call before throwing exceptions. +* [Change] Refactored static const attributes of BaseObject. +* [Change] Refactored the items in the enum ObjectType by removing the prefix 'OBJ'. +* [Change] The enums ErrorType and ObjectType were transformed into scoped enums. Also the ErrorType enum was renamed to ErrorCode. +* [Change] Code refactoring done in order to make it more close to C++14 in order to take advantage of new features introduced by that standard. +* [Change] Removed unused labels and fixed warning frame on ModelWidget. +* [Change] Minor improvements on table's attributes displaying on DatabaseExplorerWidget. +* [Change] Improved the diff process in such way to avoid generating unnecessary/noise commands related to changing types of columns to integer and setting nextval() call as default value. +* [Change] Partition tables are now displayed in the "Tables" tab at TableWidget. +* [Change] Removed the cached catalog query test feature from Catalog. +* [Change] Fine tuning on the validation of the entities used in the partitioning relationship creation. +* [Change] Forcing the partitioning relationship to be invalidated when the reference table (partitioned) partitioning type is set to null (no partitioning). +* [Change] Move the FK settings, copy options and name patterns group boxes to a dedicated tab on RelationshipWidget. +* [Change] Improved the models destruction when closing the application. +* [Change] Improved the Index/Exclude/ParitionKey elements handling by creating a generic form/grid that handles these kinds of objects (ElementsTableWidget). +* [Change] Modified the RelationshipWidget in order to handle partitioning relationships. +* [Change] Modified RelationshipConfigWidget in order to write name partterns for partitioning relationships. +* [Change] Improved the column copying and validation on class Relationship to include partitioning relationship logics. +* [Change] Improved the reverse engineering performance by avoiding update relationships as they are being imported. +* [Change] Improved the object duplication feature in ModelWidget. +* [Change] When the model is loaded it is copied to the temporary models storage as a first version of the temporary dbm file. +* [Change] Simplified the temporary models saving process by removing the thread that was controlling it. Actually the thread was unnacessary because the process was being executed in the main thread no matter if there was another thread to control the saving. +* [Change] Minor adjustment on the hint text resizing. +* [Change] Increasing to 5 minutes the period in which the temporary model saving will be executed. +* [Change] pgModeler will now use the official docs url in the help buttons. +* [Fix] Fixed a minor bug that was preventing the copy action to be enabled in DataManipulationForm. +* [Fix] Fixed some sample models to remove deprecated attributes. +* [Fix] Fixed a crash while renaming view's children objects. +* [Fix] Fixed the rendering of views which contain only a single reference that is the whole object's defintion. +* [Fix] Fixed the column name deduction for recursive views. +* [Fix] Fixed a bug that was causing crashes while configure new constraints on tables. +* [Fix] Fixed the view's resizing. +* [Fix] Fixed a regression in schema's rectangle selection. +* [Fix] Fixed the StyledTextboxView bounding rectangle. +* [Fix] Fixed an artifact when user switched on and off the compact view. +* [Fix] Fixed the Linux deploy script. +* [Fix] Fixed the macOs deploy script. +* [Fix] Fixed some compilation problems on macOs due to the usage of C++14. +* [Fix] Fixed some compilation problems on Windows due to the usage of C++14. +* [Fix] Fixed a bug in DatabaseModel::destroyObjects that could lead to segfault when the destroyed model had permissions on it. +* [Fix] Fixed a bug when importing columns which data types is some user defined type in form of array, e.g., custom_type[]. +* [Fix] Fixed a bug in SchemaParser that was causing only the first %set line in a if block to be parsed no matter that there were others %set below the same block. +* [Fix] Fixed the tooltip of some graphical objects by adding their comments and aliases. +* [Fix] Fixed the catalog query for tables to select partitioned tables correctly. +* [Fix] Fixed the catalog query for types to avoid selecting partitioned tables as being data types. +* [Fix] Fixed a bug that was causing special primary key configured on a relationship to make the original primary key of the table to disappear after disconnect the relationship. Now pgModeler stores in memory the original PK prior the connection of relationship and creation of the special PK. When disconnected the relationship, the original primary key is restored on its parent table. +* [Fix] Fixed the creation of elements (index, exclude, patition key) on DatabaseModel. +* [Fix] Fixed the class Relationship to reuse compatible columns when handling partitioning relationships. +* [Fix] Fixed the diff process in such way to create new columns with their respective COMMENT ON statement when present. +* [Fix] Fixed the detection of comment changes for columns on diff process. +* [Fix] Fixed the order of recent models saved on the file pgmodeler.conf. +* [Fix] Fixed a bug when creating a view reference as the whole view definition. +* [Fix] Minor tooltip fix on DatabaseExplorerWidget. +* [Fix] Making pgModeler honor the columns arrangement in primary keys. +* [Fix] Fixed a bug that was causing FK relationship deletion to crash the application sometimes. +* [Fix] Some fixes were done in the ModelOverviewWidget in order to support large models without exceed the screen size when configuring the size of the overall widget. +* [Fix] Fixes a bad erase in View::removeReference. +* [Fix] Fixed some bugs related to dialog size restoration in DataManipulationForm and TableWidget. + +v0.9.2-alpha +------ +*Release date: August 20, 2018* + +* [New] Added the support for cancelling SQL execution in SQLExecutionWidget. +* [New] Added support for save/restore the dialogs sizes and positions. +* [New] Added support for truncate tables in DataManipulationForm. +* [New] Added support for aliases on some graphical objects that is used in the compact view mode. +* [New] Added support for save/load object's metadata containing aliases information. +* [New] Added support for compact view of the model where graphical objects can have a more friendly name for a reduced view as well for those who don't need to see details about tables (clients of the business, for instance). +* [New] Added support for sequence options for identity columns. +* [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. +* [New] Added support for bulk data edit in TableDataWidget. +* [Change] Added missing copy options on copy relationships. +* [Change] Minor adjustments on the item delegates in order draw text in the right alignment. +* [Change] Minor adjustment on buttons style in DatabaseExplorerWidget, DataManipulationForm and SQLExecutionWidget. +* [Change] Minor adjustment on OperationList::removeFromPool to avoid throw an exception when an invalid index is passed. +* [Change] Changed the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. +* [Change] Refactored the view editing dialog by moving the references handling form to a dedicated modal dialog. +* [Change] Improved the model loading from file by blocking signals of relationships avoiding excessive/repetive rendering of objects. The whole model is fully rendered when the file was completely loaded. +* [Change] Minor adjustment on constraints rendering at extended attributes section of tables. +* [Change] French translation update. +* [Change] Updated the other lang dictionaries with the new text brought by new releases. +* [Change] Removing icons at the top of the dialogs: DatabaseImportForm, MetaDataHandlingForm, ModelDatabaseDiffForm, ModelExportForm, ModelFixForm. +* [Change] Minor adjustments in the features of the demo version. +* [Change] Minor adjustments in the UI stylesheet. +* [Change] In DatabaseExplorerWidget the root item will come automatically selcted when browsing a database. +* [Change] Minor performance tuning when handling big models. +* [Change] Added some statistics attributes for tables on DatabaseExplorerWidget. +* [Change] Minor adjustment in NewObjectOverlayWidget by putting the tool buttons under categories. +* [Fix] Fixed a bug in ObjectFinderWidget that was forcing schemas rectangles to appear even if the flag indicating them to be visible was set to false. +* [Fix] Fixed the editing form cancel operation. Now operations done when the form was active are undone correctly. +* [Fix] Fixed a bug that was preventing to create a view containing the same name as a table but in different schema. +* [Fix] Fixed a regression that caused notices not to be shown in the output panel at SQLExecutionWidget. +* [Fix] Fixed the query catalog for policies which was causing syntax error when combining import system objects and extension objects options. +* [Fix] Fixed the disabling of some actions related to design when switching to manage view. +* [Fix] Minor fix on stylesheet in order to display the extended button on general toolbar. +* [Fix] Fix a shortcut conflict in DataManipulationform. +* [Fix] Fixed the offset of strings composing the StorageType. +* [Fix] Minor form size adjustments. +* [Fix] Minor fix in sqlexecutionwidget.ui to force the exhibition of grid headers +* [Fix] Minor fix in SQLExecutionWidget allowing the output widget to be resized to a size lower than the default one. +* [Fix] Fixed the tab order in PolicyWidget. +* [Fix] Fixed the generation of Database object source in DatabaseExplorerWidget. +* [Fix] Fixed the method BaseObjectWidget::setRequiredField to make object selector fields as required correctly. +* [Fix] Minor fix in HintTextWidget to stay on top of all widget when being displayed. +* [Fix] Fixed a bug that was not quoting extension name when needed. +* [Fix] Fixed a crash when trying to remove a fk relationship when it was created from a foreign key which references protected columns (added by relationship). +* [Fix] Fix a crash when importing CSV files into DataManipulationForm. +* [Fix] Minor typo in TableDataWidget. +* [Fix] Minor fix on schema file sql/table.sch. + +v0.9.1 +------ +*Release date: May 14, 2018* + +* [New] Added support for line selection by clicking and moving the mouse over the line numbers widget in any source code field. +* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model. +* [New] Added support for RESTART IDENTITY on truncate tables in DatabaseExplorerWidget. +* [New] Added an custom option checkbox in Messagebox for general purpose usage. +* [New] Added support for diff operation in CLI. +* [New] Added support for import database from CLI. +* [New] Adding missing types regrole and regnamespace. +* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents. +* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. +* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. +* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. +* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button. +* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects. +* [Change] Minor improvement on DatabaseExplorerWidget to show the rls attributes labels correctly in the attributes grid. +* [Change] Refactored all the CLI options. +* [Change] Minor change in Connection::generateConnectionString in order to put the dbname param in the start of the string. +* [Change] Improved the performance of the row duplication action in DataManipulationForm. +* [Change] Minor improvement in order to update the schemas boxes when the tables have their extended attributes box toggled. +* [Change] Improved the performance of "Move to schema" operation. +* [Change] Added an busy cursor while closing a model. +* [Change] Improved the object selection in object finder. +* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). +* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint. +* [Fix] Fixed the check boxes disabling when dealing with identifier relationships. +* [Fix] Disabled the drag & drop for items in the side listing at ConfigurationForm. +* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. +* [Fix] Fixed the catalog query for user defined types. +* [Fix] Fixed the import of user defined types which names contains uppercase characters. +* [Fix] Minor typo fixes in CLI. +* [Fix] Fix window scaling on HiDPI/Retina screens. +* [Fix] Minor fix in Connection::getConnectionId in order to omit port when that parameter is not configured in the connection. +* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared. +* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant. +* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model. +* [Fix] Fixed the import of comments for constraints,triggers, index and rules. +* [Fix] The value input in BulkDataEditWidget will be focused as soon as the widget appears. +* [Fix] Fixed a bug in the aggregate import process. +* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces. +* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport. +* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set. +* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned. +* [Fix] Adjusting tables position when the parent schema is moved and the alignment to grid is enabled. +* [Fix] Minor fix in the CLI menu. +* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written. + v0.9.1-beta1 ------ -Release date: April 6, 2018
+*Release date: April 6, 2018* * [New] Added the ability to create multiples one-to-many and many-to-many relatationships between the same pair of tables. * [New] Added the ability to use more special ascii chars in the middle of object names. * [New] Added missing SQL keywords into sql-highlight.conf -* [New] Added support to multi line comments in UI. +* [New] Added support for multi line comments in UI. * [New] Added code snippets for CREATE and ALTER policy. -* [New] Added full support to row level security (RLS), including export, import and diff of this kind of object. +* [New] Added full support for row level security (RLS), including export, import and diff of this kind of object. * [New] Added the method DatabaseExplorerWidget::formatPolicyAttribs in order to display some attributes values correctly. -* [New] Added support to bulk data editing in DataManipulationForm. +* [New] Added support for bulk data editing in DataManipulationForm. * [New] Added an option to diff process to force the generation of DROP commands for columns and constraints even if the missing objects need to be preserved. This is useful to work with partial models and the user need to remove columns/constraints and preserve the rest of objects. * [New] Added the ability to generate diff code to Enable/Force RLS attribute of tables. -* [New] Added support to RLS on tables. -* [New] Added the support to detect identity columns in diff. -* [New] Added support to identity columns (PostgreSQL 10). -* [New] Added the support to BYPASSRLS option on roles. -* [New] Added support to IS_TEMPLATE and ALLOW_CONNECTIONS options in database object. +* [New] Added support for RLS on tables. +* [New] Added the support for detect identity columns in diff. +* [New] Added support for identity columns (PostgreSQL 10). +* [New] Added the support for BYPASSRLS option on roles. +* [New] Added support for IS_TEMPLATE and ALLOW_CONNECTIONS options in database object. * [New] Added the procedures to fix old style domains in CLI. -* [New] Added support to multiple check constraint in domains. -* [New] Added support to sort items alphabetically (ascending) or by oid in DatabaseExplorerWidget. +* [New] Added support for multiple check constraint in domains. +* [New] Added support for sort items alphabetically (ascending) or by oid in DatabaseExplorerWidget. * [Change] Changed the input mode of the password field in ConnectionsConfigWidget in order to hide the passwords in the form. NOTE: the passwords are still in plain text in the config file. * [Change] Moved extensions from schema level to database level in order to reproduce better the PostgreSQL's behavior. * [Change] The filter widget is now toggled in DatabaseExplorerWidget via filter menu. @@ -55,9 +2564,9 @@ v0.9.1-beta1 v0.9.1-beta ------ -Release date: January 26, 2018
+*Release date: January 26, 2018* -* [New] Added support to GROUP BY/HAVING clauses in Views by adding a new kind of reference. Proper changes done in ViewWidget to allow configuring those clauses. +* [New] Added support for GROUP BY/HAVING clauses in Views by adding a new kind of reference. Proper changes done in ViewWidget to allow configuring those clauses. * [New] Added the method Catalog::isSystemObject(oid) which indicates if the provided OID is related to a system object. * [Change] Minor adjustment in the copy/paste operation to generate suffix in the pasted objects only when there're conflics. * [Change] Removed the port range limitation in connection configuration dialog. @@ -72,7 +2581,7 @@ v0.9.1-beta v0.9.1-alpha1 ------ -Release date: November 30, 2017
+*Release date: November 30, 2017* * [New] Added the ability to compare two databases, and not only a model and a database, in diff tool. * [New] Added the relationship creation buttons on the object overlay when a single table is selected. @@ -80,7 +2589,7 @@ v0.9.1-alpha1 * [New] Improved the data manipulation dialog in such way that when dealing with deletes in tables without PK, tuples with NULL values can be correctly considered. * [New] Improved the validations on ResultSet class. * [New] Added a method to indicate if a column value is null in ResultSet. -* [New] Added support to fade in/out objects in object finder in order to highlight the graphical objects retrieved from the search. +* [New] Added support for fade in/out objects in object finder in order to highlight the graphical objects retrieved from the search. * [New] Added an attribute in pgmodeler.conf to store the current status of the "Fade in" button in object finder widget. * [Change] Minor improvement in the diff generated metadata. * [Change] Increased the maximum allowed amount of lines in command history. @@ -91,16 +2600,16 @@ v0.9.1-alpha1 v0.9.1-alpha ------ -Release date: October 20, 2017
+*Release date: October 20, 2017* -* [New] Added support to crow's foot notation. +* [New] Added support for crow's foot notation. * [New] Added the crow's foot notation switch in RelationshipConfigWidget. * [New] Added the grid arrangement in the arrangment menu at MainWindow. * [New] Added the schema arrangement (scattered). * [New] Added an action to toggle schemas rectangle on ModelWidget. * [New] CLI now loads the relationship and general settings to reflect relationship styles in export modes. -* [New] Added support to connect relatinship on tables' edges when using classical notation. -* [New] Added support to apostrophes in the middle of object's name. +* [New] Added support for connect relatinship on tables' edges when using classical notation. +* [New] Added support for apostrophes in the middle of object's name. * [Change] Removed the controls related to arragement in DatabaseImportForm. * [Change] Minor adjustments in tables' spacing in auto arrangement process. * [Change] Minor improvement on SQLExecutionWidget and DataManipulationForm in order to make possible to paste csv buffer from SQLExecutionWidget to DataManipulationForm. @@ -133,14 +2642,14 @@ v0.9.1-alpha v0.9.0 ------ -Release date: September 1st, 2017
+*Release date: September 1st, 2017* * [New] Added the ability to paste text from clipboard to data grid in DataManipulationForm. * [New] Created the method CsvLoadWidget::loadCsvFromBuffer to make the code that extract csv document from string buffer reusable by other classes. * [New] Added a new sample model donated by the maintainers of 3D City DB project. * [New] Added the language "internal" to the set of system languages available when creating a new model. -* [New] Added support to override the default language settings via GeneralConfigWidget. -* [New] Added support to toggle curved relationship lines in GeneralConfigWidget. +* [New] Added support for override the default language settings via GeneralConfigWidget. +* [New] Added support for toggle curved relationship lines in GeneralConfigWidget. * [Change] Improved the MetadataHandlingForm enabling user to only extract metada to a backup file. * [Change] Small update on sample models. * [Change] Minor adjustments in the graphical points when relationships are selected. @@ -169,17 +2678,17 @@ v0.9.0 v0.9.0-beta2 ------ -Release date: July 1st, 2017
+*Release date: July 1st, 2017* * [New] Added an action to reset labels distance in BaseRelationship and ModelWidget. * [New] Added a widget that shows some info about the canvas and the selected objects at the bottom of main window in design view. * [New] Enabled the usage of snippets in other portions of the software like GenericSQLWidget, FunctionWidget, ViewWidget, CustomSQLWidget. * [New] Added the ability to quickly jump to the tables related to a relationship. -* [New] Added support to select all objects in the canvas by type (table, view, textbox, schema, relationship). -* [New] Added support to bulk relationship points removal. +* [New] Added support for select all objects in the canvas by type (table, view, textbox, schema, relationship). +* [New] Added support for bulk relationship points removal. * [New] Added a magnifier tool so the user can visualize objects when the zoom is too small. This tool allows the user to click to select or activate the context menu over the objects. -* [New] Added support to generic sql objects that serve as an improved way to use custom SQL. -* [New] Added support to handle metadata related to generic sql objects. +* [New] Added support for generic sql objects that serve as an improved way to use custom SQL. +* [New] Added support for handle metadata related to generic sql objects. * [New] Added the first object auto-arrange algorithm. * [Change] pgModeler will now accept (connect) to a PostgreSQL server even if the version of the server is not supported falling back to the most recent supported. * [Change] Minor improvements on DatabaseImportForm, ModelExportForm, ModelDatabaseDiffForm and MetadataHandlingForm to toggle uniformRowsHeight of the output tree at the start and the end of each process to avoid slowdowns and allow the items to be resized correctly when expanded. @@ -203,11 +2712,11 @@ v0.9.0-beta2 v0.9.0-beta1 ------ -Release date: May 13, 2017
+*Release date: May 13, 2017* * [New] Added the ability to standalone dialogs like import, diff, export and others to be resized according to the screen dpi and resolution. * [New] Added an experimental routine that will resize windows according to the current screen resolution and font dpi. -* [New] Added support to browse referrer and referenced in DataManipulationForm. +* [New] Added support for browse referrer and referenced in DataManipulationForm. * [New] Added an item under table items that stores the referrer tables in the DatabaseExplorerWidget. * [New] Added the method BaseObjectView::getScreenDpiFactor to help resize scene objects according to the screen dpi/resolution. * [Change] Minor adjustment on readonly items regarding to referenced and referrer tables in DatabaseExplorerWidget. @@ -226,10 +2735,10 @@ v0.9.0-beta1 v0.9.0-beta ------ -Release date: April 4, 2017
+*Release date: April 4, 2017* -* [New] Added support to indexes in Views. -* [New] Added the support to edit/load the source code in NumberedTextEditor in external application. +* [New] Added support for indexes in Views. +* [New] Added the support for edit/load the source code in NumberedTextEditor in external application. * [New] Added the ability to save/load metadata related to fade out status and extended attributes display status. * [New] Added the ability toggle the extended attributes area in tables and views. The toggle status is persisted in the model file and restores during loading * [New] Added constraints to the extended attributes section in the tables at canvas area in order to improve the quick access to these objects. @@ -237,17 +2746,17 @@ v0.9.0-beta * [New] Fade status is now persisted in the dbm file and restored during loading. * [New] Added the ability to control zoom factor from overview widget. * [New] Added a shortcut for "Duplicate" action in design view. -* [New] Added support to (back)slash char in object's names. +* [New] Added support for (back)slash char in object's names. * [New] Enabled the usage of NewObjectOverlayWidget for views. * [Change] Changed the default characters used to escape values in DataManipulationForm and TableDataWidget from {} to // due to problems with json data. * [Change] Improved the file manipulation in SQLExecutionWidget. Added option to save the commands to the current file or in another file (save as). -* [Change] Minor improvements done in Linux deployment script to support multiarch systems. +* [Change] Minor improvements done in Linux deployment script to support multiarch systems. * [Change] View's children (indexes, rules, triggers) are now listed under their respective parent view in DatabaseExplorerWidget. * [Change] Minor improvement in ElementsWidget to disable/hide columns combo when creating index elements for a index associated to a view. * [Change] Improved the diff between the complete database and a partial model representing it. * [Fix] Minor fix in AppearanceConfigWidget in order to set the font color correctly. * [Fix] Minor fix in the default file objects-style.conf -* [Fix] Added the missing support to drop event triggers from database model. +* [Fix] Added the missing support for drop event triggers from database model. * [Fix] Fixed the drop cast command generation. * [Fix] Minor fix in windows deploy script to use newer PostgreSQL. * [Fix] Minor fix in template connections.conf file. @@ -262,23 +2771,23 @@ v0.9.0-beta v0.9.0-alpha1 ------ -Release date: February 07, 2017
+*Release date: February 07, 2017* -* [New] Added support to object moving via arrow keys in canvas area. -* [New] Added support to easily create primary keys just by checking the desired columns in table's editing form. -* [New] Added support to use middle button to handle panning mode. +* [New] Added support for object moving via arrow keys in canvas area. +* [New] Added support for easily create primary keys just by checking the desired columns in table's editing form. +* [New] Added support for use middle button to handle panning mode. * [New] Added a more user friendly message at startup whenever a missing or corrupted configuration file is detected. The user is now presented to an option to restore default settings for the problematic file. * [New] Now any default file restored in ConfigurationForm has a backup saved into the directory 'backups' inside the configuration storage. -* [New] Added support to hide the database explorer widget in SQL tool via splitter handler. +* [New] Added support for hide the database explorer widget in SQL tool via splitter handler. * [New] Added a method to disable the custom context menu of the class NumberedTextEditor. -* [New] Added support to object fading in ModelWidget. -* [New] Added the support to persist the object opacity factor in config file. +* [New] Added support for object fading in ModelWidget. +* [New] Added the support for persist the object opacity factor in config file. * [New] Added the method PgModelerUiNS::getIconPath() in order to retrieve icons from resource. -* [New] Added support to column, constraint, trigger, rule and index duplication in TableWidget. -* [New] Added support to item duplication in ObjectTableWidget. +* [New] Added support for column, constraint, trigger, rule and index duplication in TableWidget. +* [New] Added support for item duplication in ObjectTableWidget. * [New] Added a loading cursor when the user opens the DataManipulationForm. * [New] The database explorer now creates the root item in the tree as the server itself which contains data related to this latter. -* [New] Added the support to parenthesis in the middle of objects' names. +* [New] Added the support for parenthesis in the middle of objects' names. * [Change] Improvements done in the SQL history at SQL execution widget. Now the command history is saved into a specific file and restored when the application starts. * [Change] Minor improvement in DataManipulationForm to show a wait cursor while filtering results. * [Change] Minor improvements in GeneralConfigWidget. Added an readonly input that exposes the path to the current user's configuration storage. @@ -312,7 +2821,7 @@ v0.9.0-alpha1 v0.9.0-alpha ------ -Release date: October 18, 2016
+*Release date: October 18, 2016* * [New] Enabling pgModeler to connect to PostgreSQL 9.6 servers. * [New] Added the option to ignore error codes during the export process in CLI. @@ -339,12 +2848,12 @@ v0.9.0-alpha v0.8.2 ------ -Codename: Faithful Elephant
-Release date: June 3, 2016
+*Codename: Faithful Elephant* +*Release date: June 3, 2016* * [New] Created the PlainTextItemDelegate replacing the ReadOnlyItemDelegate where needed. * [New] Added the ability to the table to create insert commands from the initial data buffer. -* [New] Added the support to interpret initial-data tag in DatabaseModel::createTable. +* [New] Added the support for interpret initial-data tag in DatabaseModel::createTable. * [New] Create the attribute initial-data for Table in order to store the initial set of values in a CSV-like buffer. * [New] Created the form to handle table's initial data. * [New] Added the ability to duplicate rows in DataManipulationForm. @@ -352,12 +2861,12 @@ v0.8.2 * [New] Added the ability to clear and copy text from history to the sql command input field using middle mouse button in SQL tool. * [New] Added the ability to set the default connection for operations import, export, diff and validation in ConnectionsConfigWidget. * [New] Added the usage of default connections in ModelValidationWidget. -* [New] Added support to save/load default connections in the ConnectionsConfigWidget. +* [New] Added support for save/load default connections in the ConnectionsConfigWidget. * [New] Added attributes to the Connection class in order to control wheter the connection is the default for export, import, diff or validation operations. * [New] Added the ability to save the current grid options to the pgmodeler.conf file. * [New] Added a reference the svg library to the deployment scripts. -* [New] Added support to export model to SVG file in UI and CLI. -* [New] Added the support to change case and identation of the selected text in NumberedTextEditor using context menu or shortcuts. +* [New] Added support for export model to SVG file in UI and CLI. +* [New] Added the support for change case and identation of the selected text in NumberedTextEditor using context menu or shortcuts. * [New] Added a method PgModelerUiNS::createOutputListItem which created list items with an icon and text. * [New] Connections now can have a timeout between command executions. When this timeout exceeds the next command is not executed. This is a workaround to avoid the crash of the program due to connections being (unexpectedly or not) closed by the server. * [New] Added the ability to show connections notice/warning in SQL tool. @@ -396,8 +2905,8 @@ v0.8.2 v0.8.2-beta1 ------ -Codename: Faithful Elephant
-Release date: March 31, 2016
+*Codename: Faithful Elephant* +*Release date: March 31, 2016* * [New] Added missing PostGiS types. * [New] Adding the ability to save/load more metadata from objects like model's last zoom and position, protection status, sql disabled status, tags, textboxes and others. @@ -419,7 +2928,7 @@ v0.8.2-beta1 * [New] Created a signal BaseObjectWidget::s_closeRequested to tell the parent form close after successfuly edit an object. * [New] Created template methods in RelationshipWidget and ViewWidget to handle child object manipulation. * [New] Created a template method TableWidget::openEditingForm to handle the editing form for children objects. -* [New] Added support to placeholder objects when moving graphical objects improving performance mainly when moving tables and relationships avoiding excessive update operations. +* [New] Added support for placeholder objects when moving graphical objects improving performance mainly when moving tables and relationships avoiding excessive update operations. * [New] Added an option to protect schema's children when protecting the schema itself. * [New] Added the abitily to diff partial models without drop the not imported ones from the original database. * [Change] CentralWidget renamed to WelcomeWidget. @@ -523,12 +3032,12 @@ v0.8.2-beta1 v0.8.2-beta ------ -Codename: Faithful Elephant
-Release date: January 12, 2016
+*Codename: Faithful Elephant* +*Release date: January 12, 2016* * [New] Added version descriptor for PostgreSQL 9.5 enabling pgModeler to connect to it. -* [New] Added access method BRIN for indexes, operator classes and operator families as an initial support to PostgreSQL 9.5. -* [New] Added event "table_rewrite" for event triggers as an initial support to PostgreSQL 9.5. +* [New] Added access method BRIN for indexes, operator classes and operator families as an initial support for PostgreSQL 9.5. +* [New] Added event "table_rewrite" for event triggers as an initial support for PostgreSQL 9.5. * [New] Added "Diff" action to File menu. * [Change] Minor improvement in DataManipulationForm adding the shortcut of "Copy selection" button to its tooltip. * [Change] Improvements on DataManipulationForm on how pk columns are handled and used in the generated DML commands for UPDATE and DELETE. @@ -544,8 +3053,8 @@ v0.8.2-beta v0.8.2-alpha1 ------ -Codename: Faithful Elephant
-Release date: November 13, 2015
+*Codename: Faithful Elephant* +*Release date: November 13, 2015* * [New] Added an additional step in import process to validate inheritance relationships to avoid incomplete tables. * [New] Added an additional relationship validation in model loading process when there are inheritances. This will avoid incomplete columns and validation errors related to "permanent invalidation state". @@ -565,8 +3074,8 @@ v0.8.2-alpha1 v0.8.2-alpha ------ -Codename: Faithful Elephant
-Release date: October 05, 2015
+*Codename: Faithful Elephant* +*Release date: October 05, 2015* * [New] Added a toggle button in SQL Execution to show/hide the output pane. * [New] Added the method Permission::isSimilarTo that returns true when a provided permission has the same semantics as the caller permission. @@ -642,8 +3151,8 @@ v0.8.2-alpha v0.8.1 ------ -Codename: Faithful Elephant
-Release date: July 30, 2015
+*Codename: Faithful Elephant* +*Release date: July 30, 2015* * [New] Added the ability to create objects from within the object selectors to shorten up the time spent to create a new objects in the model. The only exception of for selectors in SwapObjectsIdsWidget and table/column selectors in ViewWidget. * [New] Added a new method OperationList::isObjectRegistered to check if an object is registered in the list. @@ -678,8 +3187,8 @@ v0.8.1 v0.8.1-beta1 ------ -Codename: Faithful Elephant
-Release date: June 30, 2015
+*Codename: Faithful Elephant* +*Release date: June 30, 2015* * [New] Objects can be now renamed in database explorer except for databases and casts. * [New] Added an initial Spanish (es_ES) UI translation (review needed). @@ -692,8 +3201,8 @@ v0.8.1-beta1 v0.8.1-beta ------ -Codename: Faithful Elephant
-Release date: June 04, 2015
+*Codename: Faithful Elephant* +*Release date: June 04, 2015* * [New] Added the ability to handle databases in different connections at once without the need to disconnect from a server and connect to another. * [New] Added an option to preserve database name (do not rename) in diff process. @@ -757,8 +3266,8 @@ v0.8.1-beta v0.8.1-alpha1 ------ -Codename: Faithful Elephant
-Release date: April 20, 2015
+*Codename: Faithful Elephant* +*Release date: April 20, 2015* * [New] Added the ability to import objects from an existent database to a currently working model. * [New] Improvements on DatabaseImportHelper to dump the objects attributes in debug mode or to the log file when "ignore errors" is checked. @@ -798,8 +3307,8 @@ v0.8.1-alpha1 v0.8.1-alpha ------ -Codename: Faithful Elephant
-Release date: April 02, 2015
+*Codename: Faithful Elephant* +*Release date: April 02, 2015* * [New] Added a "Contributors" section in "About pgModeler" dialog. * [New] Introduced the NO_UPDATE_CHECK variable in qmake to turn off update verification code specifically for package maintainers usage. @@ -842,10 +3351,10 @@ v0.8.1-alpha v0.8.0 ------ -Codename: Faithful Elephant
-Release date: February 28, 2015
+*Codename: Faithful Elephant* +*Release date: February 28, 2015* -* [New] Added support to multiple SQL execution widget instances for the same browsed database in SQL tool. +* [New] Added support for multiple SQL execution widget instances for the same browsed database in SQL tool. * [New] Added truncate table actions on DatabaseExplorerWidget. * [Change] Minor adjustments on ModelValidationHelper. * [Change] Minor adjustments on CustomSQLWidget. @@ -877,8 +3386,8 @@ v0.8.0 v0.8.0-beta2 ------ -Codename: Faithful Elephant
-Release date: February 07, 2015
+*Codename: Faithful Elephant* +*Release date: February 07, 2015* * [New] Added the method Connection::getServerInfo that returns some informations about the connected server. * [New] Added an attribute to DatabaseExplorerWidget to show the estimated rows amount for selected table. @@ -886,7 +3395,7 @@ v0.8.0-beta2 * [New] Created missing getters and setters for Operation class. * [New] Added the ability to set owner, schema and tag for several objects at once through the quick actions menu. * [New] Added an option to diff process to reuse sequences if the source model has serial columns in which the generated sequence name matches a sequence's name on the imported model. -* [New] Added the support to per-user configuration. Now each user on the system will have his separated configuration folder. +* [New] Added the support for per-user configuration. Now each user on the system will have his separated configuration folder. * [New] Added a bug report form on main window to give user the chance to report a bug without use crash handler. * [New] Added action to enable/disable an object's sql from quick actions menu at ModelWidget. * [New] Created a new namespace PgModelerUiNS to store shared constants and function in libpgmodeler_ui subproject. @@ -918,7 +3427,7 @@ v0.8.0-beta2 * [Fix] Fix on GeneralConfigWidget that was not saving code completion enabling status. * [Fix] Fixed some bugs on libobjrenderer classes that was causing crashes in some models arrangements. Now graphical objects are effectively deallocated only when the whole scene is destroyed. * [Fix] Minor improvement on OperationList::removeOperations to avoid crashes if a pool object is destroyed outside the operation history (e.g. relationship invalidation). -* [Fix] Several fixes on OperationList to minimize the crashes when undoing/redoing operations. +* [Fix] Several fixes on OperationList to minimize the crashes when undoing/redoing operations. * [Fix] Minor fix on validation process that was failing sometimes to use temporary names feature. * [Fix] Minor fix on ModelsDiffHelper to correctly recreate foreign keys that references recreated primary keys. * [Fix] Minor fix on Table::removeObject to change not-null state of columns only when the removed object is a primary key. @@ -941,8 +3450,8 @@ v0.8.0-beta2 v0.8.0-beta1 ------ -Codename: Faithful Elephant
-Release date: January 10, 2015
+*Codename: Faithful Elephant* +*Release date: January 10, 2015* * [New] Created the widget SnippetConfigWidget in order to handle SQL snippets on SQLTool and DatabaseExplorerWidget. * [New] Introduced a new expression %unset on SchemaParser to clear the named attributes. @@ -1008,8 +3517,8 @@ v0.8.0-beta1 v0.8.0-beta ------ -Codename: Faithful Elephant
-Release date: November 29, 2014
+*Codename: Faithful Elephant* +*Release date: November 29, 2014* * [New] Introduced the first version of model database diff feature. * [New] Created the method Constraint::isCodeDiffersFrom in order to correctly generate the xml code and compare it with another object's code. @@ -1105,8 +3614,8 @@ v0.8.0-beta v0.8.0-alpha2 ------ -Codename: Faithful Elephant
-Release date: September 30, 2014
+*Codename: Faithful Elephant* +*Release date: September 30, 2014* * [New] Added an option on general settings to disable ask to validate model before save, export and diff. * [New] If the user try to save, export or diff a model and it is invalidated, pgModeler will first validate and then proceed with the pending operation. @@ -1150,8 +3659,8 @@ v0.8.0-alpha2 v0.8.0-alpha1 ------ -Codename: Faithful Elephant
-Release date: August 15, 2014
+*Codename: Faithful Elephant* +*Release date: August 15, 2014* * [New] pgModeler now is capable to handle table's data through the new data manipulation form. * [New] The SQL tool received a basic find/replace widget. @@ -1161,7 +3670,7 @@ v0.8.0-alpha1 * [New] Added a field on all object's editing form to expose the object's internal id. * [New] Added an option on the database import process to generate random colors for relationships. * [New] The model objects widget gained a filtering field that is capable to list objects by their name or internal id. -* [New] Added support to custom SQL for rules, indexes and triggers. +* [New] Added support for custom SQL for rules, indexes and triggers. * [New] Added two new sample models. * [Change] Changed the shortcut for "About pgModeler" to F4 key. * [Change] Minor update on shortcuts and tooltips of buttons on bottom control bar at main window. @@ -1205,10 +3714,10 @@ v0.8.0-alpha1 v0.8.0-alpha ------ -Codename: Faithful Elephant
-Release date: July 21, 2014
+*Codename: Faithful Elephant* +*Release date: July 21, 2014* -* [New] Added support to using global settings for relationships on the editing form of those objects. +* [New] Added support for using global settings for relationships on the editing form of those objects. * [New] A new section was created on settings dialog to manage global configurations for relationships. * [New] Enabled the movement of schema objects without the need to select their children. This operation does not applies to protected or system schemas like public, pg_catalog. * [New] Created a more elaborated central widget with some basic operations like create, load, load recent models and restore previous session. @@ -1236,8 +3745,8 @@ v0.8.0-alpha v0.7.2 ------ -Codename: Brave Mastodon
-Release date: June 27, 2014
+*Codename: Brave Mastodon* +*Release date: June 27, 2014* * [New] Added the missing attribute BUFFERING for Gist indexes. * [New] Added an experimental installer for Linux based upon the Qt Installer Framework. @@ -1251,8 +3760,8 @@ v0.7.2 v0.7.2-beta1 ------ -Codename: Brave Mastodon
-Release date: June 21, 2014
+*Codename: Brave Mastodon* +*Release date: June 21, 2014* * [New] Added support for event trigger objects. The export and import processes were adjusted to handle this kind of object. * [New] Added support for UNLOGGED tables. @@ -1267,8 +3776,8 @@ v0.7.2-beta1 v0.7.2-beta ------ -Codename: Brave Mastodon
-Release date: June 06, 2014
+*Codename: Brave Mastodon* +*Release date: June 06, 2014* * [New] Added an option to convert integer type to serial ones on columns which default value is a nextval(seq::regclass) call. * [Change] Changed the MacOS X deployment script to use Qt 5.3. @@ -1291,16 +3800,16 @@ v0.7.2-beta v0.7.2-alpha1 ------ -Codename: Brave Mastodon
-Release date: May 30, 2014
+*Codename: Brave Mastodon* +*Release date: May 30, 2014* * [New] Introduced a "new object" overlay widget which gives user a quick access to actions that create objects. * [New] Added a step to fix indexes with old tag on command line interface. -* [New] Added support to item interaction on "object's dependencies and references" dialog. -* [New] Added support to generate temporary names for database, roles and tablespaces when running validation process. This will avoid errors if the original database and the other objects already exists on the server. +* [New] Added support for item interaction on "object's dependencies and references" dialog. +* [New] Added support for generate temporary names for database, roles and tablespaces when running validation process. This will avoid errors if the original database and the other objects already exists on the server. * [New] Updated the CLI to include the option to generate temporary object's names. * [New] Added suppport to save and restore the last position and zoom on the canvas. This behavior can be deactivated on general settings. -* [New] Added support to prepend SQL commands on object's definition. +* [New] Added support for prepend SQL commands on object's definition. * [New] Added zoom info popup that appears whenever the user changes the current zoom factor. * [Change] Renamed the methods setCheckExpression and getCheckExpression methods to setExpression and getExpression because the expression is used either for check and exclude constraints. * [Change] Renamed the attribute "condition" to "predicate" on index class. @@ -1321,8 +3830,8 @@ v0.7.2-alpha1 v0.7.2-alpha ------ -Codename: Brave Mastodon
-Release date: May 06, 2014
+*Codename: Brave Mastodon* +*Release date: May 06, 2014* * [New] Added a basic routine to check if there is some new version available on pgModeler site. * [Change] Custom indexes for columns and constraints added by relationships are now stored on tables. In previous version the relationship was the responsible for that but this approach was provoking the bug related on issue 449. @@ -1339,11 +3848,11 @@ v0.7.2-alpha v0.7.1 ------ -Codename: Brave Mastodon
-Release date: April 15, 2014
+*Codename: Brave Mastodon* +*Release date: April 15, 2014* * [New] Added option to invert panning mode and range selection triggers. -* [New] Added support to use relationship attributes as special primary keys. +* [New] Added support for use relationship attributes as special primary keys. * [Change] Improvement on unique name generation for columns and constraints when connecting relatioships. * [Change] Improvement on copy / paste operations. * [Change] Minor workaround in order to try to fix the crash due to thread conflict mainly on Windows system. @@ -1352,8 +3861,8 @@ v0.7.1 v0.7.1-beta1 ------ -Codename: Brave Mastodon
-Release date: April 8, 2014
+*Codename: Brave Mastodon* +*Release date: April 8, 2014* * [Change] Minor change on project's description text on about dialog. * [Fix] Workaround for the slow editing of function's definition. Disabled the automatic syntax highlighting. @@ -1364,11 +3873,11 @@ v0.7.1-beta1 v0.7.1-beta ------ -Codename: Brave Mastodon
-Release date: April 6, 2014
+*Codename: Brave Mastodon* +*Release date: April 6, 2014* * [New] Created a small interface to pgmodeler-cli that enables the user to fix a broken model inside pgModeler GUI. -* [New] Added support to assign a sequence as default value of a column. The sequence will be converted to "nextval('seqname'::regclass) and the validation process will check if the sequence is correctly referenced by the table that owns the column. +* [New] Added support for assign a sequence as default value of a column. The sequence will be converted to "nextval('seqname'::regclass) and the validation process will check if the sequence is correctly referenced by the table that owns the column. * [Change] Changed the default behavior of left click on blank areas of canvas. Instead of create a range selection the user will move the viewport (panning mode). To enable range selection user must press SHIFT and click/move to draw the selection rectangle. * [Fix] Minor fix on connection class in order to accept empty passwords as well passwords that contains spaces. * [Fix] Fixed the column listing on constraint editing form after remove one or more columns. @@ -1380,8 +3889,8 @@ v0.7.1-beta v0.7.1-alpha1 ------ -Codename: Brave Mastodon
-Release date: March 29, 2014
+*Codename: Brave Mastodon* +*Release date: March 29, 2014* * [Change] Major model validation improvement. Now special objects are correctly validated. * [Fix] Fixed a crash when closing a model that contains a view that references columns added by relationships. @@ -1391,8 +3900,8 @@ v0.7.1-alpha1 v0.7.1-alpha ------ -Codename: Brave Mastodon
-Release date: March 21, 2014
+*Codename: Brave Mastodon* +*Release date: March 21, 2014* * [Fix] Fixed connection config. Empty passwords are now accepted. * [Fix] Fixed schema object code generation. @@ -1402,15 +3911,15 @@ v0.7.1-alpha v0.7.0 ------ -Codename: Brave Mastodon
-Release date: February 25, 2014
+*Codename: Brave Mastodon* +*Release date: February 25, 2014* * [New] Addded a catalog attribute "hide-postgres-db" in order to avoid listing "postgres" maintainance DB on import operations. * [New] Added options to hide system/extension objects on SQL tool improving the object listing performance. -* [New] Added support to custom compilation output directory through qmake variables BINDIR, LIBDIR and RESDIR. -* [New] Added support to deferrable unique, exclude and primary key constraints. -* [New] Added support to custom colors on tables and views through tag objects. -* [New] Added support to export models to png image page by page. +* [New] Added support for custom compilation output directory through qmake variables BINDIR, LIBDIR and RESDIR. +* [New] Added support for deferrable unique, exclude and primary key constraints. +* [New] Added support for custom colors on tables and views through tag objects. +* [New] Added support for export models to png image page by page. * [New] Canvas can now be moved using Control + Arrow keys. If the shift is pressed the movement factor is increased. * [New] Introduced the SQL tool that permits the execution of arbitrary SQL commands direclty on a server. * [New] Added methods getType, getTypeId to BaseType and getSQLTypeName to PgSQLType as an alternative to call operators ~, ! and *. @@ -1420,11 +3929,11 @@ v0.7.0 * [New] Added a build number on about dialog. This number is the compilation date in format yyyymmdd. * [New] Added support for materialized and recursive views (PostgreSQL 9.3 feature). * [New] Added pgModeler version information on generated sql scripts as well .dbm files for debugging purpose. -* [New] Added support to custom delete/update actions for relationship generated foreign keys. -* [New] Added support to move the canvas by positioning the mouse over corners. +* [New] Added support for custom delete/update actions for relationship generated foreign keys. +* [New] Added support for move the canvas by positioning the mouse over corners. * [New] Added a configuration parameter to control font style for any source code highlight field. * [New] Added additional PostGiS types: geomval, addbandarg, rastbandarg, raster, reclassarg, unionarg, TopoGeometry, getfaceedges_returntype, validatetopology_returntype. -* [Change] Added support to on-demand updates on sql tool object's tree. +* [Change] Added support for on-demand updates on sql tool object's tree. * [Change] Improved the tab navigation experience on editing forms. * [Change] Minor change on SQL tool to ommit binary data values. * [Change] Dropped the navigation through object using Alt + due to the difficulty to understand the order in which objects are highlighted. @@ -1478,8 +3987,8 @@ v0.7.0 v0.6.2 ------ -Codename: Daring Mammoth
-Release date: December 20, 2013 +*Codename: Daring Mammoth* +*Release date: December 20, 2013* * [Change] Update Qt version to 5.2.0 on build scripts (Windows only). * [Change] Linux binaries are now bundled with all needed Qt libs. @@ -1497,8 +4006,8 @@ v0.6.2 v0.6.2-beta ------ -Codename: Daring Mammoth
-Release date: November 29, 2013 +*Codename: Daring Mammoth* +*Release date: November 29, 2013* * [New] Added an option to drop database before a export process. * [New] Disabling SQL code now disables the code of all referrer and child objects (experimental!). @@ -1517,8 +4026,8 @@ v0.6.2-beta v0.6.1 ------ -Codename: Daring Mammoth
-Release date: November 3, 2013 +*Codename: Daring Mammoth* +*Release date: November 3, 2013* * [New] PostgreSQL version 9.3 activated on code base. Now import and export operations works with this new version. * [Change] Changed the way inheritance is created. Now the INHERIT command is appended in the table's definition. @@ -1539,8 +4048,8 @@ v0.6.1 v0.6.0 ------ -Codename: Daring Mammoth
-Release date: September 30, 2013 +*Codename: Daring Mammoth* +*Release date: September 30, 2013* * [New] Added a validation when removing protected FK relationships. * [New] Added a progress info (at bottom widgets bar) for temporary model saving. @@ -1565,8 +4074,8 @@ v0.6.0 v0.6.0-beta ------ -Codename: Daring Mammoth
-Release date: September 16, 2013 +*Codename: Daring Mammoth* +*Release date: September 16, 2013* * [New] Added experimental reverse engineering support. * [New] Added an experimental option --fix-model to pgmodeler-cli to permit the user to fix the structure of an older model (generated in pgModeler < 0.6.0) or a corrupted file. @@ -1598,8 +4107,8 @@ v0.6.0-beta v0.6.0-alpha1 ------ -Codename: Daring Mammoth
-Release date: August 05, 2013 +*Codename: Daring Mammoth* +*Release date: August 05, 2013* * [New] Added catalog query for triggers. * [New] Added catalog query for rules. @@ -1632,8 +4141,8 @@ v0.6.0-alpha1 v0.6.0-alpha ------ -Codename: Daring Mammoth
-Release date: July 19, 2013 +*Codename: Daring Mammoth* +*Release date: July 19, 2013* * [New] Added the widget to swap objects IDs on model validation form. * [New] Added indexing type "spgist" to IndexingType class. @@ -1667,21 +4176,21 @@ v0.6.0-alpha v0.5.2 ------ -Codename: Lovely Duda
-Release date: June 27, 2013 +*Codename: Lovely Duda* +*Release date: June 27, 2013* * [New] User now can append free SQL commands to database objects via "Append SQL" command. * [New] Introduced an experimental code completion on fields that permits code input. * [New] User can create default sequences from serial columns. This feature does not apply to columns generated by relationships. * [New] Introduced a feature to break relationship lines in straight angles and to remove all user added points. -* [New] Added support to change font size on textboxes. +* [New] Added support for change font size on textboxes. * [Change] Removed the code "OIDs=FALSE" from table's SQL. * [Fix] Minor fix on Mac OSX deployment script. v0.5.1_r1 --------- -Codename: Lovely Duda
-Release date: June 13, 2013 +*Codename: Lovely Duda* +*Release date: June 13, 2013* * [New] Added deployment scripts on all platforms to compile and pack pgModeler. Note: On Windows the script must run on GNU environment port like Cygwin or MingW. * [New] Added an special field to columns to easily identify which relationship generated it. (only for columns added by relationship) @@ -1701,15 +4210,15 @@ v0.5.1_r1 v0.5.1 ------ -Codename: Lovely Duda
-Release date: June 1, 2013 +*Codename: Lovely Duda* +*Release date: June 1, 2013* * [New] Code base ported to C++11 and Qt5. * [New] MacOSX compilation now generates an application bundle: pgmodeler.app * [New] pgModeler is now capable of associate dbm files to its executable being possible opening a model from file manager by clicking it (except for MacOSX, see MacOSX notes). * [New] Added support for loading models by calling pgModeler gui executable from terminal (e.g. pgmodeler model1.dbm model2.dbm) * [New] pgModeler logo redesign. -* [New] Added special primary keys support to one-to-one and one-to-many relationships. +* [New] Added special primary keys support for one-to-one and one-to-many relationships. * [New] Relationships now supports patterns to define generated objects names. The manual suffix and auto-suffix generation are deprecated. * [New] Columns/constraints generated by relationship can have position changed on parent table. * [New] Added smallserial built-in datatype. @@ -1729,7 +4238,7 @@ v0.5.1 v0.5.0 ------ -Release date: May 17, 2013 +*Release date: May 17, 2013* * [New] Complete main window restyling. * [New] Added a model validation tool to prevent reference break and name conflicts. @@ -1738,16 +4247,16 @@ v0.5.0 * [New] Added an option to list available configured connections on pgmodeler-cli. * [New] pgModeler now alerts the user when he try to save an invalidated model. * [New] pgModeler now aborts app closing when the user wants to do a last saving on modified models. -* [New] Added support to hide relationship labels and table extended attributes on configuration dialog. +* [New] Added support for hide relationship labels and table extended attributes on configuration dialog. * [New] Added "Recent Models" menu. * [New] Introduced the Xml2Object plugin to help on develpment testings. -* [New] Added partial support to PostgreSQL Extensions objects. +* [New] Added partial support for PostgreSQL Extensions objects. * [New] Added JSON datatype. * [New] Added support for rules and trigger on views. * [New] Added support for user defined range types. * [New] Added support for collations on composite types (user defined). * [New] Added built-in range types. -* [New] Added support to INCLUDING/EXCLUDING options when dealing with copy relationships. +* [New] Added support for INCLUDING/EXCLUDING options when dealing with copy relationships. * [New] Added support for EXCLUDE constraint support * [New] Added NO INHERIT option to check constraints. * [New] Added REPLICATION option to roles. @@ -1798,7 +4307,7 @@ v0.5.0 v0.4.1_r1 --------- -Release date: March 19, 2013 +*Release date: March 19, 2013* * [Change] user can now prepend a CTE (commom table expression, a.k.a "with queries") on view's definition. * [Change] user can now create a single reference containing a expression that defines the entire view. @@ -1809,7 +4318,7 @@ v0.4.1_r1 v0.4.1 ------ -Release date: March 16, 2013 +*Release date: March 16, 2013 * * [New] introduced the "Disable SQL code" option for roles/tablespaces. * [New] user now can add objects by right-clicking group items on "Model Objects" dockwidget tree. @@ -1840,7 +4349,7 @@ v0.4.1 v0.4.0_r1 --------- -Release date: March 04, 2013 +*Release date: March 04, 2013 * * [New] introducing the "pgModeler Wiki" as the main project's support resource. * [Fix] when main windows is closed the overview widget is closed too. @@ -1849,7 +4358,7 @@ v0.4.0_r1 v0.4.0 ------ -Release date: February 27, 2013 +*Release date: February 27, 2013 * * [New] introduce a "New object" submenu when activating the schema context menu (right-click) * [New] tables and view are now graphically separated by colored rectangles representing its schemas. @@ -1913,7 +4422,7 @@ v0.4.0 v0.3.4 ------ -Release date: October 17, 2012 +*Release date: October 17, 2012* * [New] added chinese UI translation (provided by [gjunming](https://github.com/gjunming)). * [New] added basic support for PostGiS 2.0 only data types: box2d, box3d, geometry and geography (suggested by [george-silva](https://github.com/george-silva) on [issue#28](https://github.com/pgmodeler/pgmodeler/issues/28))(EXPERIMENTAL). Note: when using these data types make sure that PostGiS extension is installed on database cluster since pgModeler WILL NOT install it automatically or generate the command to do it! @@ -1935,7 +4444,7 @@ v0.3.4 v0.3.3 ------ -Release date: October 09, 2012 +*Release date: October 09, 2012* * [Change] pgModeler license were update to GPLv3. * [Change] Error massages and entire UI were translated to en_US. Now people can contribute more easily with translation files. [(issue#8)](https://github.com/pgmodeler/pgmodeler/issues/8) @@ -1948,7 +4457,7 @@ v0.3.3 v0.3.2 ------ -Release date: September 27, 2012 +*Release date: September 27, 2012* * [Change] The default extension for the models now stands for ".dbm" [(issue#9)](https://github.com/pgmodeler/pgmodeler/issues/9) * [Change] Tables and sequences now can be used as function return type as well parameter type. This is valid for other objects that make use of base types (except for table columns). @@ -1963,7 +4472,7 @@ v0.3.2 v0.3.1 ------ -Release date: September 18, 2012 +*Release date: September 18, 2012* * [New] Relationships generates column suffixes automaticaly. This behavior can be changed on the relationship editing form. * [New] Added two samples to pgModeler. @@ -1975,7 +4484,7 @@ v0.3.1 v0.3.0 ------ -Release date: September 12, 2012 +*Release date: September 12, 2012* * [New] Added a model overview widget. * [New] Added export feature that generates PNG image of the models. @@ -1985,7 +4494,7 @@ v0.3.0 v0.2.0 ------ -Release date: August 31, 2012 +*Release date: August 31, 2012* * [New] Added an interface to implement third party plugins. Check [PLUGINS.md] (https://github.com/pgmodeler/pgmodeler/blob/master/PLUGINS.md) for details. * [New] Added a short cut to easily control the zoom on the model. Use Crtl + Mouse wheel up (zoom up) or Crtl + Mouse wheel down (zoom down). @@ -1996,7 +4505,7 @@ v0.2.0 v0.1.2 ------ -Release date: August 24, 2012 +*Release date: August 24, 2012* * [New] Added a functionality to save modified models before closing the software. * [Change] Updated the en_US dictionary with the texts of the above functionality. @@ -2012,7 +4521,7 @@ v0.1.2 v0.1.1 ------ -Release date: August 14, 2012 +*Release date: August 14, 2012* * [Fix] Correction of the actions for inserting graphic objects (table, text box, vision and relationship) in Windows environment. * [Fix] Correction on the display of the maximize button in the window decoration in Windows environment. @@ -2023,6 +4532,6 @@ v0.1.1 v0.1.0 ------ -Release date: August 9, 2012 +*Release date: August 9, 2012* * First pgModeler release. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..9e67129c76 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 3.16) +project(pgmodeler VERSION 2.0 LANGUAGES C CXX) + +# Defining where cmake can find the .cmake modules +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +include(BuildConfs) +include(DefaultPaths) +include(BuildNumDate) +include(PrintSummary) +include(InstallAssets) + +# Include clang-tidy configuration BEFORE adding subdirectories +# so that CMAKE_CXX_CLANG_TIDY is set before any targets are created +if(CMAKE_BUILD_TYPE STREQUAL Debug) + include(ClangTidyConf) +endif() + +# Include priv-core if assets are needed (PLUS or DEMO versions) +# DEMO: includes only assets (logoicons.qrc and resources.qrc) +# PLUS: includes full code + assets +if(BUILD_PRIV_ASSETS) + add_subdirectory(${PRIV_CORE_DIR}) +endif() + +add_subdirectory(${LIBS_DIR}/${LIBUTILS}) +add_subdirectory(${LIBS_DIR}/${LIBPARSERS}) +add_subdirectory(${LIBS_DIR}/${LIBCORE}) +add_subdirectory(${LIBS_DIR}/${LIBCONNECTOR}) +add_subdirectory(${LIBS_DIR}/${LIBCANVAS}) +add_subdirectory(${LIBS_DIR}/${LIBGUI}) +add_subdirectory(${LIBS_DIR}/${LIBCLI}) +add_subdirectory(${APPS_DIR}/${PGMODELER_APP}) +add_subdirectory(${APPS_DIR}/${PGMODELERCLI_APP}) +add_subdirectory(${APPS_DIR}/${PGMODELERCH_APP}) +add_subdirectory(${APPS_DIR}/${PGMODELERSE_APP}) + +if(CMAKE_BUILD_TYPE STREQUAL Debug AND BUILD_TESTS) + add_subdirectory(tests) +endif() + +if(BUILD_PLUGINS) + add_subdirectory(${PLUGINS_DIR}) +endif() + +if(BUILD_PRIV_CODE) + add_subdirectory(${PRIV_PLUGINS_DIR}) +endif() + +print_build_summary() diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..1369b8b314 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at raphael@pgmodeler.io. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/ClangTidyConf.cmake b/ClangTidyConf.cmake new file mode 100644 index 0000000000..35e2de5c56 --- /dev/null +++ b/ClangTidyConf.cmake @@ -0,0 +1,84 @@ +# Configure clang-tidy to run during compilation +# This will show warnings in VS Code/Qt Creator issues panel during build + +# Declare USE_CLANG_TIDY as a CMake option if not already set via command line or settings.json (VS Code) +# This allows the user to control when to enable/disable clang-tidy +if(NOT DEFINED USE_CLANG_TIDY) + set(USE_CLANG_TIDY OFF CACHE BOOL "Enable clang-tidy static analysis during compilation" FORCE) +endif() + +# Allow custom clang-tidy path via CLANG_TIDY_PATH variable +# VS Code: This can be set in settings.json: "CLANG_TIDY_PATH": "/path/to/clang-tidy-18" +# Priority: +# 1. Custom path from CLANG_TIDY_PATH variable (if exists) +# 2. System clang-tidy from PATH (fallback) +unset(CLANG_TIDY_EXE CACHE) + +if(DEFINED CLANG_TIDY_PATH) + # Custom path provided - validate it + if(NOT EXISTS "${CLANG_TIDY_PATH}") + message(FATAL_ERROR "CLANG_TIDY_PATH is set but file does not exist: ${CLANG_TIDY_PATH}") + endif() + + if(NOT IS_ABSOLUTE "${CLANG_TIDY_PATH}") + message(FATAL_ERROR "CLANG_TIDY_PATH must be an absolute path: ${CLANG_TIDY_PATH}") + endif() + + set(CLANG_TIDY_EXE "${CLANG_TIDY_PATH}" CACHE FILEPATH "Path to clang-tidy executable") +else() + # Try to find clang-tidy in system PATH + find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +endif() + +if(USE_CLANG_TIDY AND CLANG_TIDY_EXE) + # Validate that the executable is actually clang-tidy + execute_process( + COMMAND "${CLANG_TIDY_EXE}" --version + OUTPUT_VARIABLE CLANG_TIDY_VERSION + RESULT_VARIABLE CLANG_TIDY_VERSION_RESULT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + + # Check if command succeeded and output contains "clang-tidy" or "LLVM" + # (some versions output "clang-tidy version X", others just "LLVM version X") + if(NOT CLANG_TIDY_VERSION_RESULT EQUAL 0) + if(DEFINED CLANG_TIDY_PATH) + message(FATAL_ERROR "Failed to execute clang-tidy at: ${CLANG_TIDY_EXE}\n" + "The specified binary could not be executed or is not a valid clang-tidy executable.\n" + "Make sure the path points to a valid clang-tidy binary.") + else() + message(WARNING "Found executable 'clang-tidy' but failed to execute it: ${CLANG_TIDY_EXE}") + set(USE_CLANG_TIDY OFF CACHE BOOL FORCE) + unset(CLANG_TIDY_EXE CACHE) + endif() + elseif(NOT CLANG_TIDY_VERSION MATCHES "(clang-tidy|LLVM)") + if(DEFINED CLANG_TIDY_PATH) + message(FATAL_ERROR "Invalid clang-tidy executable at: ${CLANG_TIDY_EXE}\n" + "The specified binary is not a valid clang-tidy executable.\n" + "Output from '${CLANG_TIDY_EXE} --version':\n${CLANG_TIDY_VERSION}") + else() + message(WARNING "Found executable 'clang-tidy' but it doesn't appear to be valid: ${CLANG_TIDY_EXE}") + set(USE_CLANG_TIDY OFF CACHE BOOL "Enable clang-tidy static analysis during compilation" FORCE) + unset(CLANG_TIDY_EXE CACHE) + endif() + else() + # Extract and display version + if(CLANG_TIDY_VERSION MATCHES "version ([0-9]+\\.[0-9]+\\.[0-9]+)") + set(CLANG_TIDY_VERSION_NUM "${CMAKE_MATCH_1}") + message(STATUS "Using clang-tidy version ${CLANG_TIDY_VERSION_NUM}: ${CLANG_TIDY_EXE}") + else() + message(STATUS "Using clang-tidy: ${CLANG_TIDY_EXE}") + endif() + + # clang-tidy reads configuration from .clang-tidy file + set(CMAKE_CXX_CLANG_TIDY + "${CLANG_TIDY_EXE}" + #"--header-filter=.*/pgmodeler/(apps|libs|plugins|priv-plugins)/.*\\.(h|hpp|cpp)$" + CACHE STRING "clang-tidy command line" FORCE + ) + endif() +elseif(NOT CLANG_TIDY_EXE AND USE_CLANG_TIDY) + # Disable USE_CLANG_TIDY if clang-tidy executable not found + set(USE_CLANG_TIDY OFF CACHE BOOL FORCE) +endif() diff --git a/DefaultPaths.cmake b/DefaultPaths.cmake new file mode 100644 index 0000000000..c47e904042 --- /dev/null +++ b/DefaultPaths.cmake @@ -0,0 +1,97 @@ +# Defining default values of the path-related variables +if(LINUX) + include(LinuxPaths) +elseif(WIN32) + include(WindowsPaths) +elseif(APPLE) + include(MacOsPaths) +endif() + +# Creting C defines with the custom paths provided +# in the cmake command call +add_compile_definitions( + BINDIR="${PGM_BINDIR}" + CONFDIR="${PGM_CONFDIR}" + DOCDIR="${PGM_DOCDIR}" + LANGDIR="${PGM_LANGDIR}" + PLUGINSDIR="${PGM_PLUGINSDIR}" + PRIVATEBINDIR="${PGM_PRIVATEBINDIR}" + SAMPLESDIR="${PGM_SAMPLESDIR}" + SCHEMASDIR="${PGM_SCHEMASDIR}") + +if(APPLE) + set(PGSQL_INC /Library/PostgreSQL/17/include) + set(PGSQL_LIBS /Library/PostgreSQL/17/lib/libpq.dylib) + + set(XML2_INC /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2) + set(XML2_LIBS /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libxml2.tbd) +else() + # Searching for PostgreSQL headers/libraries + # This command attempts to find the library, REQUIRED argument is optional + find_package(PostgreSQL REQUIRED) + set(PGSQL_INC ${PostgreSQL_INCLUDE_DIRS}) + set(PGSQL_LIBS ${PostgreSQL_LIBRARIES}) + + # Searching for libxml2 headers/libraries + # This command attempts to find the library, REQUIRED argument is optional + find_package(LibXml2 REQUIRED) + set(XML2_INC ${LIBXML2_INCLUDE_DIR}) + set(XML2_LIBS ${LIBXML2_LIBRARY}) +endif() + +# Subproject variables +# Store the absolute paths to library subprojects to be referenced in other CMakeLists.txt files +# *_ROOT -> the path to the root folder of the subproject +# *_INC -> the path to the source code folder (src), used by the flag -I (INCLUDEPATH on qmake) passed to the compiler +set(CWD ${CMAKE_CURRENT_SOURCE_DIR}) + +# Root directory where library subprojects are stored +set(LIBS_DIR libs) + +# Root directory where application subprojects are stored +set(APPS_DIR apps) + +# Application subproject names +set(PGMODELER_APP pgmodeler) +set(PGMODELERCH_APP pgmodeler-ch) +set(PGMODELERCLI_APP pgmodeler-cli) +set(PGMODELERSE_APP pgmodeler-se) + +# Library subproject names and source paths +set(LIBCANVAS libcanvas) +set(LIBCANVAS_ROOT ${CWD}/${LIBS_DIR}/${LIBCANVAS}) +set(LIBCANVAS_INC ${LIBCANVAS_ROOT}/src) + +set(LIBCONNECTOR libconnector) +set(LIBCONNECTOR_ROOT ${CWD}/${LIBS_DIR}/${LIBCONNECTOR}) +set(LIBCONNECTOR_INC ${LIBCONNECTOR_ROOT}/src) + +set(LIBCORE libcore) +set(LIBCORE_ROOT ${CWD}/${LIBS_DIR}/${LIBCORE}) +set(LIBCORE_INC ${LIBCORE_ROOT}/src) + +set(LIBPARSERS libparsers) +set(LIBPARSERS_ROOT ${CWD}/${LIBS_DIR}/${LIBPARSERS}) +set(LIBPARSERS_INC ${LIBPARSERS_ROOT}/src) + +set(LIBGUI libgui) +set(LIBGUI_ROOT ${CWD}/${LIBS_DIR}/${LIBGUI}) +set(LIBGUI_INC ${LIBGUI_ROOT}/src) + +set(LIBUTILS libutils) +set(LIBUTILS_ROOT ${CWD}/${LIBS_DIR}/${LIBUTILS}) +set(LIBUTILS_INC ${LIBUTILS_ROOT}/src) + +set(LIBCLI libcli) +set(LIBCLI_ROOT ${CWD}/${LIBS_DIR}/${LIBCLI}) +set(LIBCLI_INC ${LIBCLI_ROOT}/src) + +# Configuring the relative paths so the binaries can find the libraries correclty +# First we determine the relative path between BINDIR e PRIVATELIBDIR +file(RELATIVE_PATH RELATIVE_PRIVATELIBDIR ${PGM_BINDIR} ${PGM_PRIVATELIBDIR}) + +# Setting the RPATH to including $ORIGIN and $ORIGIN/relative_path +set(CMAKE_INSTALL_RPATH "\$ORIGIN;\$ORIGIN/${RELATIVE_PRIVATELIBDIR}") + +# Making sure that RPATH is used during install +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) diff --git a/InstallAssets.cmake b/InstallAssets.cmake new file mode 100644 index 0000000000..3ae2516c79 --- /dev/null +++ b/InstallAssets.cmake @@ -0,0 +1,68 @@ +# Copying the samples/*.dbm to the destination +install(DIRECTORY assets/samples/ + DESTINATION ${PGM_SAMPLESDIR} + FILES_MATCHING + PATTERN "*.dbm") + +# Copying all folder under schemas/ to the destination +# Without recreating the schemas/ folder in the destination +file(GLOB sch_dirs LIST_DIRECTORIES true "assets/schemas/*") + +foreach(sch_dir ${sch_dirs}) + # Extracts the name of the current schema directory + get_filename_component(dirname ${sch_dir} NAME) + + if(IS_DIRECTORY ${sch_dir}) + install(DIRECTORY ${sch_dir} + DESTINATION ${PGM_SCHEMASDIR} + USE_SOURCE_PERMISSIONS) + endif() +endforeach() + +# Copying all template configs from assets/conf +install(DIRECTORY assets/conf/ + DESTINATION ${PGM_CONFDIR} + FILES_MATCHING + PATTERN "*.conf" + PATTERN "*.dbm" + PATTERN "*.png") + +if(PLUS_VERSION OR BUILD_PRIV_ASSETS) + install(FILES ${PRIV_CORE_ROOT}/res/icons/pgmodeler_logo.png + DESTINATION ${PGM_CONFDIR}) +endif() + +install(DIRECTORY assets/conf/schemas + DESTINATION ${PGM_CONFDIR}) + +install(DIRECTORY assets/conf/dtd + DESTINATION ${PGM_CONFDIR}) + +# Copying the highlight configs from dark theme to be the initial one +install(DIRECTORY assets/conf/themes/dark/ + DESTINATION ${PGM_CONFDIR} + FILES_MATCHING + PATTERN "*-highlight.conf") + +# Creating the "defaults" configs dir containing the files from the initial template config dir +install(DIRECTORY assets/conf/themes/dark/ + DESTINATION ${PGM_CONFDIR}/defaults + FILES_MATCHING + PATTERN "*-highlight.conf") + +install(DIRECTORY assets/conf/ + DESTINATION ${PGM_CONFDIR}/defaults + FILES_MATCHING + PATTERN "*.conf" + PATTERN "*.dbm" + PATTERN "schemas" EXCLUDE + PATTERN "themes" EXCLUDE + PATTERN "dtd" EXCLUDE) + +# Copying doc files +install(FILES + README.md + CHANGELOG.md + LICENSE + RELEASENOTES.md + DESTINATION ${PGM_DOCDIR}) diff --git a/LinuxPaths.cmake b/LinuxPaths.cmake new file mode 100644 index 0000000000..eb8a4de938 --- /dev/null +++ b/LinuxPaths.cmake @@ -0,0 +1,60 @@ +# Below, the user can specify where all generated file can be placed +# through a set of variables, being them: +# +# PGM_PREFIX -> the root directory where the files will be placed +# PGM_BINDIR -> where executables accessible by the user resides +# PGM_PRIVATEBINDIR -> where executables not directly accessible by the user resides +# PGM_PRIVATELIBDIR -> where libraries not directly shared through the system resides +# PGM_PLUGINSDIR -> where third party plugins are installed +# PGM_SHAREDIR -> where shared files and resources should be placed +# PGM_CONFDIR -> where the pgModeler's configuration folder (conf) resides +# PGM_DOCDIR -> where documentation related files are placed +# PGM_LANGDIR -> where the UI translation folder (lang) resides +# PGM_SAMPLESDIR -> where the sample models folder (samples) resides +# PGM_SCHEMASDIR -> where the object's schemas folder (schema) resides + +# Default configuration for package pgModeler. +# The default prefix is /usr/local +if(NOT DEFINED PGM_PREFIX) + set(PGM_PREFIX /usr/local) +endif() + +if(NOT DEFINED PGM_BINDIR) + set(PGM_BINDIR ${PGM_PREFIX}/bin) +endif() + +if(NOT DEFINED PGM_PRIVATEBINDIR) + set(PGM_PRIVATEBINDIR ${PGM_PREFIX}/bin) +endif() + +if(NOT DEFINED PGM_PRIVATELIBDIR) + set(PGM_PRIVATELIBDIR ${PGM_PREFIX}/lib/pgmodeler) +endif() + +if(NOT DEFINED PGM_PLUGINSDIR) + set(PGM_PLUGINSDIR ${PGM_PREFIX}/lib/pgmodeler/plugins) +endif() + +if(NOT DEFINED PGM_SHAREDIR) + set(PGM_SHAREDIR ${PGM_PREFIX}/share/pgmodeler) +endif() + +if(NOT DEFINED PGM_CONFDIR) + set(PGM_CONFDIR ${PGM_PREFIX}/conf) +endif() + +if(NOT DEFINED PGM_DOCDIR) + set(PGM_DOCDIR ${PGM_SHAREDIR}) +endif() + +if(NOT DEFINED PGM_LANGDIR) + set(PGM_LANGDIR ${PGM_PREFIX}/lang) +endif() + +if(NOT DEFINED PGM_SAMPLESDIR) + set(PGM_SAMPLESDIR ${PGM_PREFIX}/samples) +endif() + +if(NOT DEFINED PGM_SCHEMASDIR) + set(PGM_SCHEMASDIR ${PGM_PREFIX}/schemas) +endif() diff --git a/MacOsPaths.cmake b/MacOsPaths.cmake new file mode 100644 index 0000000000..5e7d0c47ad --- /dev/null +++ b/MacOsPaths.cmake @@ -0,0 +1,60 @@ +# Below, the user can specify where all generated file can be placed +# through a set of variables, being them: +# +# PGM_PREFIX -> the root directory where the files will be placed +# PGM_BINDIR -> where executables accessible by the user resides +# PGM_PRIVATEBINDIR -> where executables not directly accessible by the user resides +# PGM_PRIVATELIBDIR -> where libraries not directly shared through the system resides +# PGM_PLUGINSDIR -> where third party plugins are installed +# PGM_SHAREDIR -> where shared files and resources should be placed +# PGM_CONFDIR -> where the pgModeler's configuration folder (conf) resides +# PGM_DOCDIR -> where documentation related files are placed +# PGM_LANGDIR -> where the UI translation folder (lang) resides +# PGM_SAMPLESDIR -> where the sample models folder (samples) resides +# PGM_SCHEMASDIR -> where the object's schemas folder (schema) resides + +# Default configuration for package pgModeler. +# The default prefix is /usr/local +if(NOT DEFINED PGM_PREFIX) + set(PGM_PREFIX /Applications/pgModeler.app/Contents) +endif() + +if(NOT DEFINED PGM_BINDIR) + set(PGM_BINDIR ${PGM_PREFIX}/MacOS) +endif() + +if(NOT DEFINED PGM_PRIVATEBINDIR) + set(PGM_PRIVATEBINDIR ${PGM_BINDIR}) +endif() + +if(NOT DEFINED PGM_PRIVATELIBDIR) + set(PGM_PRIVATELIBDIR ${PGM_PREFIX}/Frameworks) +endif() + +if(NOT DEFINED PGM_PLUGINSDIR) + set(PGM_PLUGINSDIR ${PGM_BINDIR}/plugins) +endif() + +if(NOT DEFINED PGM_SHAREDIR) + set(PGM_SHAREDIR ${PGM_BINDIR}) +endif() + +if(NOT DEFINED PGM_CONFDIR) + set(PGM_CONFDIR ${PGM_BINDIR}/conf) +endif() + +if(NOT DEFINED PGM_DOCDIR) + set(PGM_DOCDIR ${PGM_SHAREDIR}) +endif() + +if(NOT DEFINED PGM_LANGDIR) + set(PGM_LANGDIR ${PGM_SHAREDIR}/lang) +endif() + +if(NOT DEFINED PGM_SAMPLESDIR) + set(PGM_SAMPLESDIR ${PGM_SHAREDIR}/samples) +endif() + +if(NOT DEFINED PGM_SCHEMASDIR) + set(PGM_SCHEMASDIR ${PGM_BINDIR}/schemas) +endif() diff --git a/PluginBuildConfs.cmake b/PluginBuildConfs.cmake new file mode 100644 index 0000000000..ea1f808edc --- /dev/null +++ b/PluginBuildConfs.cmake @@ -0,0 +1,129 @@ +# Importing Qt6 components +# Forcing a version >= 6.4.0. If no suitable version is found the script aborts +find_package(Qt6 6.4.0 REQUIRED COMPONENTS UiTools) + +# By default, the AUTOUIC option makes the uic look for the .ui files +# under the same folder as the sources. In this case, we force the uic +# command to look for .ui files under ui/* +set(CMAKE_AUTOUIC_SEARCH_PATHS + ${CMAKE_CURRENT_SOURCE_DIR} + ui) + +include_directories( + ${LIBCANVAS_INC} + ${LIBCONNECTOR_INC} + ${LIBCORE_INC} + ${LIBCLI_INC} + ${LIBPARSERS_INC} + ${LIBUTILS_INC} + ${LIBGUI_INC} + ${PRIV_PLUGINS_SRC}) + +link_libraries( + Qt::Core + Qt::Gui + Qt::UiTools + canvas + cli + connector + core + gui + parsers + utils) + +if(BUILD_PRIV_CODE) + set(PRIV_GUI_SOURCES + ${PRIV_PLUGINS_SRC}/pluginwidget.h + ${PRIV_PLUGINS_SRC}/privateguiplugin.cpp + ${PRIV_PLUGINS_SRC}/privateguiplugin.h + ${PRIV_PLUGINS_SRC}/privpluginsglobal.h) + + set(PRIV_CLI_SOURCES + ${PRIV_PLUGINS_SRC}/privatecliplugin.cpp + ${PRIV_PLUGINS_SRC}/privatecliplugin.h + ${PRIV_PLUGINS_SRC}/privpluginsglobal.h) +endif() + +# This function wraps a call to qt_add_plugin and set a +# variable named PGM_TARGET in the parent scope (where the function +# was called). +function(pgm_add_plugin TARGET IS_PRIV_PLUGIN IS_CLI_PLUGIN) + qt_add_plugin(${TARGET}) + set(PGM_TARGET ${TARGET} PARENT_SCOPE) + + if(IS_PRIV_PLUGIN) + if(IS_CLI_PLUGIN) + set(PRIV_SOURCES ${PRIV_CLI_SOURCES}) + else() + set(PRIV_SOURCES ${PRIV_GUI_SOURCES}) + endif() + + target_sources(${TARGET} PRIVATE ${PRIV_SOURCES}) + endif() +endfunction() + +# This function calls pgm_add_plugin setting the IS_CLI_PLUGIN to OFF +# Like pg_add_plugin, it creates a variable called PGM_TARGET in the +# parent scope that registers the name of the plugin +function(pgm_add_gui_plugin TARGET IS_PRIV_PLUGIN) + pgm_add_plugin(${TARGET} ${IS_PRIV_PLUGIN} OFF) + pgm_inc_priv_core_sources(${TARGET} OFF) + set(PGM_TARGET ${PGM_TARGET} PARENT_SCOPE) +endfunction() + +# This function calls pgm_add_plugin setting the IS_CLI_PLUGIN to ON +# Like pg_add_plugin, it creates a variable called PGM_TARGET in the +# parent scope that registers the name of the plugin +function(pgm_add_cli_plugin TARGET IS_PRIV_PLUGIN) + pgm_add_plugin(${TARGET} ${IS_PRIV_PLUGIN} ON) + set(PGM_TARGET ${PGM_TARGET} PARENT_SCOPE) +endfunction() + +# This function adds the resource file (icons/images) +# in the list of plugin's sources to be compiled +# this will cause the RCC command to be called and +# generate the qrc_*.cpp which is linked with the +# plugin's lib +function(pgm_set_plugin_res TARGET) + qt_add_resources(PLUGIN_RES "res/${TARGET}.qrc") + target_sources(${TARGET} PRIVATE ${PLUGIN_RES}) +endfunction() + +# This function configures the assets deployment +# of the plugin library. The first argument TARGET +# is the name of the plugin. +# Arguments specified after TARGET when calling +# this function is considered to be the files and +# directories to be deployed. The files and directory +# will always be considered in relative path to the +# plugin's root diretory. So, make sure to inform only +# the name of the files/dirs not their absolute paths +function(pgm_install_plugin_files TARGET) + set(SRC_PATH ${PRIV_PLUGINS_ROOT}/${TARGET}) + + foreach(file IN LISTS ARGN) + # Putting directories and files in separate variables + if(IS_DIRECTORY ${SRC_PATH}/${file}) + list(APPEND _DIRS ${SRC_PATH}/${file}) + else() + list(APPEND _FILES ${SRC_PATH}/${file}) + endif() + endforeach() + + # Deploying files + install(FILES ${_FILES} + DESTINATION ${PGM_PLUGINSDIR}/${TARGET}) + + # Deploying directories + install(DIRECTORY ${_DIRS} + DESTINATION ${PGM_PLUGINSDIR}/${TARGET}) +endfunction() + +# This function configures the deployment settings +# of the plugin library. +function(pgm_install_plugin TARGET) + install(TARGETS ${TARGET} + LIBRARY DESTINATION ${PGM_PLUGINSDIR}/${TARGET} + FRAMEWORK DESTINATION ${PGM_PLUGINSDIR}/${TARGET} + RUNTIME DESTINATION ${PGM_PLUGINSDIR}/${TARGET}) +endfunction() diff --git a/PrintSummary.cmake b/PrintSummary.cmake new file mode 100644 index 0000000000..83c738bbca --- /dev/null +++ b/PrintSummary.cmake @@ -0,0 +1,45 @@ +function(print_build_summary) + message("\n[ pgModeler build paths ]") + message("* PGM_PREFIX = ${PGM_PREFIX}") + message("* PGM_BINDIR = ${PGM_BINDIR}") + message("* PGM_PRIVATEBINDIR = ${PGM_PRIVATEBINDIR}") + message("* PGM_PRIVATELIBDIR = ${PGM_PRIVATELIBDIR} ") + message("* PGM_PLUGINSDIR = ${PGM_PLUGINSDIR}") + message("* PGM_SHAREDIR = ${PGM_SHAREDIR}") + message("* PGM_CONFDIR = ${PGM_CONFDIR}") + message("* PGM_DOCDIR = ${PGM_DOCDIR}") + message("* PGM_LANGDIR = ${PGM_LANGDIR}") + message("* PGM_SAMPLESDIR = ${PGM_SAMPLESDIR}") + message("* PGM_SCHEMASDIR = ${PGM_SCHEMASDIR}\n") + + message("[ Dependencies ]") + message("* C compiler = ${CMAKE_C_COMPILER}") + message("* C++ compiler = ${CMAKE_CXX_COMPILER}") + message("* PostgreSQL headers = ${PGSQL_INC}") + message("* PostgreSQL library = ${PGSQL_LIBS}") + message("* LibXml2 headers = ${XML2_INC}") + message("* LibXml2 library = ${XML2_LIBS}") + message("* Clang-tidy binary = ${CLANG_TIDY_EXE}") + + message("\n[ Extra build options / Info ]") + message("* NO_CHECK_CURR_VER = ${NO_CHECK_CURR_VER}") + message("* SNAPSHOT_BUILD = ${SNAPSHOT_BUILD}") + message("* APPIMAGE_BUILD = ${APPIMAGE_BUILD}") + message("* DEMO_VERSION = ${DEMO_VERSION}") + message("* PLUS_VERSION = ${PLUS_VERSION}") + message("* NO_UPDATE_CHECK = ${NO_UPDATE_CHECK}") + message("* BUILD_PLUGINS = ${BUILD_PLUGINS}") + message("* BUILD_PRIV_CODE = ${BUILD_PRIV_CODE}") + message("* BUILD_PRIV_ASSETS = ${BUILD_PRIV_ASSETS}") + message("* BUILD_TESTS = ${BUILD_TESTS}") + message("* USE_CLANG_TIDY = ${USE_CLANG_TIDY}") + message("* USE_ADDR_SANITIZER = ${USE_ADDR_SANITIZER}") + message("* CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}\n") + + message("* To change a variable's value run cmake again from source root and setting the new value, e.g.:") + message(" > cmake -S . -DPGM_PREFIX=/usr/local -B ./cmake-build --fresh \n") + message("* To proceed with build process run: ") + message(" > cmake --build ./cmake-build --target all\n") + message("* To install the compiled files run:") + message(" > cmake --install ./cmake-build\n") +endfunction() diff --git a/README.md b/README.md index 0eff748b78..e9ac4aa787 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,61 @@ -Introduction ------------- +![pgmodeler_mainwindow](https://github.com/user-attachments/assets/0022f022-8412-491c-9155-8b84abf837ef) -pgModeler - PostgreSQL Database Modeler - is an open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. +[![Linux build](https://github.com/pgmodeler/pgmodeler/workflows/Linux%20build/badge.svg)](https://github.com/pgmodeler/pgmodeler/actions?query=workflow%3A%22Linux+build%22) +[![Windows build](https://github.com/pgmodeler/pgmodeler/workflows/Windows%20build/badge.svg)](https://github.com/pgmodeler/pgmodeler/actions?query=workflow%3A%22Windows+build%22) +[![macOs build](https://github.com/pgmodeler/pgmodeler/workflows/macOs%20build/badge.svg)](https://github.com/pgmodeler/pgmodeler/actions?query=workflow%3A%22macOs+build%22) -Please, let me know how the pgModeler is working on your system! Help to improve this project, give your feedback about the software or report any bug at [Issues](https://github.com/pgmodeler/pgmodeler/issues) page. Additionaly, follow the pgModeler profile on [Facebook](https://www.facebook.com/pgmodeler) or [Twitter](https://twitter.com/pgmodeler) and be up-to-date with new features, fixes and releases. +--- -Licensing ---------- +## :rocket: Why pgModeler? -This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3. +**pgModeler** is an open-source, multiplatform database modeling tool built specifically for the **PostgreSQL** ecosystem. This project aims to be the definitive reference for database design in the FOSS world, offering a feature-rich interface that allows for rapid data modeling and seamless code deployment. -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Unlike generic tools, pgModeler is tailored to PostgreSQL's specific strengths, ensuring that your visual designs translate perfectly into high-performance database schemas. Whether you are starting a new project from scratch or maintaining a massive legacy system, pgModeler provides the agility and precision required by modern development workflows. -See [LICENSE](https://github.com/pgmodeler/pgmodeler/blob/master/LICENSE) for details. +### Key capabilities: +* **Visual modeling:** Create and edit complex relational schemas through an intuitive drag-and-drop interface. Manage tables, views, functions, operators, and more with specialized tools for every PostgreSQL object. +* **Robust reverse engineering:** Connect to existing database instances and generate comprehensive visual representations in seconds. This allows you to document, audit, or modify live databases without writing a single line of DDL manually. +* **Smart synchronization (diff):** Compare your visual model against a live database or another model file. pgModeler generates the precise SQL scripts needed to synchronize both, handling dependencies and structural changes automatically. +* **Integrated management module:** Beyond design, the tool includes a functional database administration module. Execute custom SQL commands, browse table data, and manage server objects through a clean, minimalist UI. -Donate to pgModeler -------------------- +For deep dives into features, screenshots, and tutorials, visit [pgmodeler.io](https://pgmodeler.io). -Much effort, coffee, chocolate, time and knowledge has been devoted to this project so that a usable and constantly improved product could be delivered to the community. If you liked pgModeler and think it deserves a contribution please donate any amount (via PayPal) at [project's official site](http://pgmodeler.com.br). +--- -Developers and Reviewers wanted! --------------------------------- +## :hammer_and_wrench: Build & installation -pgModeler grown bigger and reached a state that its lonely developer cannot handle all the modifications and new features requests. So if you know C++ and Qt framework programming and wants to contribute with coding let me know! I'll be grateful for any help to the project! +As a multiplatform project, pgModeler supports Linux, Windows, and macOS. The build process is optimized for each environment to ensure native performance. You can find detailed, step-by-step guides for compiling from source in our [installation section](https://www.pgmodeler.io/support/installation). -Compiling/Installation ----------------------- +Want to add custom functionality? Explore the [official plugin repository](https://github.com/pgmodeler/plugins) to see how you can extend the core features of pgModeler. -For details about installation process from source code visit the [Installation](http://www.pgmodeler.com.br/support/installation) section. If you don't want to compile pgModeler there are binaries available for purchase at [official site](http://www.pgmodeler.com.br/download). +--- -Known Issues ------------ +## :heart: Support & professional services -* The diff process still presents false-positive results due its limitations. Sometimes, there is the need to run the process twice to get the full changes. -* pgModeler does not fully supports the [quoted identifier notation](http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). When using quoted identifiers only the following characters are accepted in the middle of names: a-z A-Z 0-9 _ . @ $ - / \ space. -* pgModeler is unusable in sandboxed Mac OS X installations. To workaround this issue you'll need to deactivate sandbox usage to run pgModeler properly. There is no planning to adapt this tool for sandbox feature in Mac OS X. -* pgModeler can't be compiled in Microsoft Visual Studio due to use of some gcc/clang extensions. -* Compiling the source using '-Wconversion' (disabled by Qt in its default) generates a lot of warnings. These warnings are harmless in 99% of times but we can't just ignore them but I don't plan to fix them in a near future (mail me for more details). -* pgModeler sometimes can crash during the export, import or validation process due to some threaded operations that, depending on size and arrange of the model, causes race conditions. -* Due to particularities on executing bundles on MacOSX the file association does not work correctly on this system. So it's not possible to open a model file by clicking it on Finder. +For 19 years, pgModeler has thrived as an independent project driven by community feedback. To ensure long-term sustainability and faster development cycles, the project is now officially backed by **Nullptr Labs**, a startup founded to bridge the gap between open-source passion and professional reliability. -Change Log ----------- +### How to power your workflow: +* **pgModeler Plus:** Get access to exclusive, advanced features designed for power users and enterprise environments. By purchasing a **Plus** subscription on our [official website](https://www.pgmodeler.io/purchase), you unlock professional capabilities while directly funding the core development of the software. +* **Pre-compiled packages:** While the source code is open, you can save significant time and ensure a stable environment by purchasing our official binaries. These packages come with dedicated professional support and easy installers for all major platforms. +* **Contribute code:** We are always looking for talented **C++ and Qt framework** developers. If you want to help us fix bugs, optimize performance, or build the next big feature, your contributions are highly appreciated. +* **Spread the word:** As a growing startup, our strongest asset is our community. Share pgModeler with your colleagues, your team, and on social media to help us build a stronger support ecosystem. -The detailed log of changes can be seen on [CHANGELOG.md](https://github.com/pgmodeler/pgmodeler/blob/master/CHANGELOG.md) file. +--- -Older Releases/Code -------------------- +## :bomb: Technical notes (Known issues) -Older releases of pgModeler can be found at [Sourceforge.net](http://sourceforge.net/projects/pgmodeler) +* **Large-scale models:** Due to the Qt raster engine used for rendering, performance may degrade in models with 500+ tables. Changing relationship connection modes or rendering smoothness in the options can help mitigate this. +* **Diff precision:** In certain edge cases, the diff process may return false-positive results. We recommend reviewing the generated scripts or running the process a second time to ensure absolute accuracy. +* **Quoted identifiers:** Special characters, uppercase letters, or non-printable characters in object names will automatically trigger the usage of quoted identifier notation to remain compliant with SQL standards. +* **Windows compilation:** The source code currently utilizes specific GCC/Clang extensions, making it incompatible with Microsoft Visual Studio (MSVC) compilers. +* **Thread stability:** In extremely complex or large models, heavy threaded operations like exports or validations may occasionally trigger race conditions. We are actively working on improving thread safety in these modules. + +--- + +### :bookmark_tabs: Licensing +This program is free software: you can redistribute it and/or modify it under the terms of the **GNU General Public License, version 3**. See the [LICENSE](https://github.com/pgmodeler/pgmodeler/blob/main/LICENSE) file for complete details. + +--- + +### :office: About Nullptr Labs +**Nullptr Labs Software e Tecnologia LTDA** was founded in early 2026 to provide a stable corporate structure for the pgModeler project. Our goal is to continue the legacy of open-source innovation while delivering the support and professional tools that modern businesses require. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3840d69f48..f5bcadcb51 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,50 +1,30 @@ -v0.9.1-beta1 +v2.0.0-alpha1 ------ +*Release date: February 13, 2026* +*Changes since:* ***v2.0.0-alpha*** + +**Summary:** After three months of continuous development since the initial alpha release, pgModeler 2.0.0-alpha1 represents a major milestone in the ongoing UI modernization effort. This release focuses primarily on completing the redesign of all model object editing forms, improving overall usability, and introducing several quality-of-life enhancements that make working with database models more intuitive and efficient. Along with these visual improvements, this version includes important bug fixes and new features that further enhance the stability and functionality of the tool. + +**Complete editing forms redesign:** The most significant change in this release is the comprehensive redesign of all object editing forms. Every single form, from simple objects like Roles and Schemas to complex ones like Tables, Relationships, and Constraints, has been modernized with a cleaner, more organized layout. The new design adopts a tabbed interface for complex forms, making it easier to navigate through different configuration sections. All forms now share a consistent visual language with improved label organization, better spacing, and more intuitive control grouping. This redesign not only makes the forms look better but also significantly improves the editing workflow by reducing visual clutter and making related options easier to find. + +**Enhanced keyboard navigation:** Recognizing that many users prefer keyboard-based workflows, this release introduces a new tab order manager system that automatically configures the tab order for all editing forms. This means you can now navigate through form fields using the Tab key in a logical, predictable manner without any manual configuration. The system is smart enough to skip hidden or disabled widgets and properly handles Shift+Tab for reverse navigation. This enhancement significantly speeds up data entry and makes the application more accessible to keyboard-centric users. + +**Improved visual feedback:** To make the interface more responsive and intuitive, this version introduces subtle visual effects throughout the application. Input widgets, buttons, checkboxes, and radio buttons now feature custom hover effects that provide immediate feedback when you interact with them. Focus borders have been added to checkboxes and radio buttons, making it clearer which element is currently selected. Progress bars now display smooth busy indicator animations during long-running operations. These small touches combine to create a more polished and professional user experience. + +**Modernized code preview:** The code preview functionality has been completely overhauled with a more capable and user-friendly widget that replaces the old implementation. The new code preview offers better syntax highlighting, improved filtering capabilities, and a cleaner interface that makes reviewing generated SQL and XML code much more pleasant. This is particularly useful when inspecting complex database objects or troubleshooting code generation issues. + +**Object associations visualization:** Understanding the relationships between database objects is crucial for effective database design. This release introduces a new object associations viewer that provides a much clearer and more intuitive view of how objects are connected. The improved interface makes it easier to track dependencies and references, helping you understand the impact of changes before applying them to your model. + +**Enhanced CLI capabilities:** The command-line interface has received several improvements in this release. The help menu now features automatic line wrapping with sentence-based breaks, making it much easier to read on narrow terminals. Support for version-only printing has been added, which is particularly useful for integration with deployment pipelines and automation scripts. These enhancements make pgModeler-CLI more versatile and easier to use in automated workflows. + +**Quality and stability improvements:** Beyond the visible changes, this release includes numerous under-the-hood improvements. Several crash bugs have been fixed, including issues when editing connections while browsing databases and crashes in the model export widget. Memory management has been improved with fixes for critical memory-related issues. The validation system now catches more potential issues, such as foreign keys with SET NULL actions tied to NOT NULL columns. These fixes contribute to a more stable and reliable application. + +**Experimental features:** This release introduces experimental support for disabling name quoting, allowing pgModeler to treat object names as case-insensitive. This feature addresses a long-standing request from users who prefer to work with unquoted identifiers. While still experimental, it represents progress toward supporting different naming conventions and workflows. + +**Visual refinements:** The application's visual identity continues to evolve with updated logos and icons that maintain the flatter, more colorful style introduced in the alpha release. Numerous small UI adjustments throughout the application improve consistency and polish. The theme system has been refined with better detection and more sophisticated rendering of various UI components. + +**Looking ahead:** The UI modernization effort continues with more improvements planned for future releases. The focus remains on making pgModeler more intuitive, efficient, and pleasant to use while maintaining its powerful feature set. Your feedback and bug reports continue to be invaluable in guiding the development process. + +**A new chapter:** This release marks an important milestone in pgModeler's journey. The project is now being developed and maintained by Nullptr Labs, a company founded by pgModeler's original author and dedicated to providing professional-grade database modeling tools and services. This transition ensures the long-term sustainability of the project and enables us to invest more resources in development, support, and innovation. We're excited about the future of pgModeler and committed to delivering the best possible experience to our users, whether in the open-source community or in enterprise environments. Your continued support and feedback remain essential as we move forward together in this new chapter. + -Release date: April 6, 2018
-Changes since: v0.9.1-beta
- -Summary: finally we've reached the last beta release of the 0.9.1! This time pgModeler brings important fixes and new features requested long ago which are finally implemented in experimental stage.
- -The first new feature we have in this release is the support to multiples relationships for the same pair of tables. In previous versions, pgModeler would refuse to create a second relationship between the tables A and B. From now on, pgModeler will accept the creation of one-to-many and many-to-many relationships linking A and B more then once. For the other kinds of relationships (generalization, copy, one-to-one) the old rule is still valid: only one relationship per table pair is accepted.
- -Some missing features of PostgreSQL are present in this version too being them: row level security (RLS) and identity columns. For RLS, introduced in PostgreSQL 9.5, we have added the related options to toggle it in tables (ENABLE|FORCE RLS) as well the support to policy objects which are the main part of this new security modality. The identity columns, introduced in PostgreSQL 10, are now fully supported by pgModeler and you can make use of them from the column editing form.
- -Other new feature is the support to multiple check constraints by domains. Actually, this is more a patch than a new feature because pgModeler was unaware that domains could support more than one check constraint, so we have fixed that now.
- -Now, talking about changes, we fixed an old missinterpretation of the PostgreSQL's documentations by changing the way extensions are stored in the database model. Previously, this kind of objects were stored at schemas level but the right way to store them is at database level. So now instead of seeing extensions in the schema's subtree you'll see them in the database subtree. All validation rules, export, import and diff processes were fixed in such way to reflect the right way to treat these objects.
- -Another important change, and that one is related to an annoying behaviour of the tool, is that pgModeler will silently ignore the absence of the plugins folder and proceed with the normal startup avoiding the display of a message box regarding the missing folder and automatically disabling the plugins search mechanism.
- -In the fixes section, we've included a patch for a bug that was causing recurrent crashes on macOS when the user tried to load a second model file making almost impossible the working on two or more database models at once. Also, we've patched the reverse engineering in such way to avoid the duplication of data types related to tables, sequences and views which was causing problems in the validation process. Another fix was done in the diff process that was generating a malformed DROP command for extensions.
- -The set of changes of this release has 47 entries between new features, changes, improvements and bug fixes. Below we highlight some of them, for the complete list, please, consider reading the CHANGELOG.md.
- -* [New] Added the ability to create multiples one-to-many and many-to-many relatationships between the same pair of tables. -* [New] Added the ability to use more special ascii chars in the middle of object names. -* [New] Added support to multi line comments in UI. -* [New] Added full support to row level security (RLS), including export, import and diff of this kind of object. -* [New] Added support to bulk data editing in DataManipulationForm. -* [New] Added an option to diff process to force the generation of DROP commands for columns and constraints even if the missing objects need to be preserved. This is useful to work with partial models and the user need to remove columns/constraints and preserve the rest of objects. -* [New] Added support to identity columns (PostgreSQL 10). -* [New] Added the support to BYPASSRLS option on roles. -* [New] Added support to IS_TEMPLATE and ALLOW_CONNECTIONS options in database object. -* [New] Added the procedures to fix old style domains in CLI. -* [New] Added support to multiple check constraint in domains. -* [New] Added support to sort items alphabetically (ascending) or by oid in DatabaseExplorerWidget. -* [Change] Changed the input mode of the password field in ConnectionsConfigWidget in order to hide the passwords in the form. NOTE: the passwords are still in plain text in the config file. -* [Change] Moved extensions from schema level to database level in order to reproduce better the PostgreSQL's behavior. -* [Change] In GeneralConfigWidget when restoring default settings the default settings for syntax highlight are restored as well. -* [Change] pgModeler will not try to create the plugins path anymore. This will avoid constant error messages during startup. Now, it'll silently ignore the absence of that folder and skip the plugin loading. -* [Change] Improved the source editing in external application. The use is informed about the app running state and the contents for the source editor field are locked until the user closes the external app. -* [Fix] Fixed the query catalog for built-in types to include the types related to domains. -* [Fix] Fixed the extension creation, allowing only one instance of the named extension per database no matter the schema used to allocate its children objects. -* [Fix] Fixed a bug when dropping Functions in DatabaseExplorerWidget. -* [Fix] Fixed a bug that was causing the disabling of connections for database models created prior to 0.9.1-beta1. -* [Fix] Fixed a bug on import process that was wrongly creating types derivated from tables/sequence/views causing duplication problems during validation. -* [Fix] Fixed a crash on macOs when opening a second model. -* [Fix] Fixed an issue in diff process that was generating a malformed DROP command for extensions. -* [Fix] Fixed the diff for domains which contain multiple check constraints. -* [Fix] Fixed a bug that was not selecting the correct spatial type in the widget. -* [Fix] Fixed a conflict of shortcuts in DatabaseExplorerWidget. Now F5 updates a leaf/subtree and Alt+F5 performs quick refresh of the tree. -* [Fix] Fixed a problem with sqlexecutionwidget.ui that is not building properly in Qt 5.10. diff --git a/WindowsPaths.cmake b/WindowsPaths.cmake new file mode 100644 index 0000000000..9d5edb7b32 --- /dev/null +++ b/WindowsPaths.cmake @@ -0,0 +1,60 @@ +# Below, the user can specify where all generated file can be placed +# through a set of variables, being them: +# +# PGM_PREFIX -> the root directory where the files will be placed +# PGM_BINDIR -> where executables accessible by the user resides +# PGM_PRIVATEBINDIR -> where executables not directly accessible by the user resides +# PGM_PRIVATELIBDIR -> where libraries not directly shared through the system resides +# PGM_PLUGINSDIR -> where third party plugins are installed +# PGM_SHAREDIR -> where shared files and resources should be placed +# PGM_CONFDIR -> where the pgModeler's configuration folder (conf) resides +# PGM_DOCDIR -> where documentation related files are placed +# PGM_LANGDIR -> where the UI translation folder (lang) resides +# PGM_SAMPLESDIR -> where the sample models folder (samples) resides +# PGM_SCHEMASDIR -> where the object's schemas folder (schema) resides + +# Default configuration for package pgModeler. +# The default prefix is C:/Program Files/ +if(NOT DEFINED PGM_PREFIX) + set(PGM_PREFIX "C:/Program Files/") +endif() + +if(NOT DEFINED PGM_BINDIR) + set(PGM_BINDIR ${PGM_PREFIX}) +endif() + +if(NOT DEFINED PGM_PRIVATEBINDIR) + set(PGM_PRIVATEBINDIR ${PGM_PREFIX}) +endif() + +if(NOT DEFINED PGM_PRIVATELIBDIR) + set(PGM_PRIVATELIBDIR ${PGM_PREFIX}) +endif() + +if(NOT DEFINED PGM_PLUGINSDIR) + set(PGM_PLUGINSDIR ${PGM_PREFIX}/plugins) +endif() + +if(NOT DEFINED PGM_SHAREDIR) + set(PGM_SHAREDIR ${PGM_PREFIX}) +endif() + +if(NOT DEFINED PGM_CONFDIR) + set(PGM_CONFDIR ${PGM_PREFIX}/conf) +endif() + +if(NOT DEFINED PGM_DOCDIR) + set(PGM_DOCDIR ${PGM_PREFIX}) +endif() + +if(NOT DEFINED PGM_LANGDIR) + set(PGM_LANGDIR ${PGM_PREFIX}/lang) +endif() + +if(NOT DEFINED PGM_SAMPLESDIR) + set(PGM_SAMPLESDIR ${PGM_PREFIX}/samples) +endif() + +if(NOT DEFINED PGM_SCHEMASDIR) + set(PGM_SCHEMASDIR ${PGM_PREFIX}/schemas) +endif() diff --git a/apps/pgmodeler-ch/CMakeLists.txt b/apps/pgmodeler-ch/CMakeLists.txt new file mode 100644 index 0000000000..b509a2fb4b --- /dev/null +++ b/apps/pgmodeler-ch/CMakeLists.txt @@ -0,0 +1,6 @@ +pgm_add_executable(pgmodeler-ch + src/crashhandlerform.cpp src/crashhandlerform.h + src/main.cpp) + +pgm_set_default_inc_libs(${PGM_TARGET}) +pgm_install_executable(${PGM_TARGET} ON) diff --git a/apps/pgmodeler-ch/res/pgmodeler_ch.ico b/apps/pgmodeler-ch/res/pgmodeler_ch.ico new file mode 100644 index 0000000000..12c42e3f52 Binary files /dev/null and b/apps/pgmodeler-ch/res/pgmodeler_ch.ico differ diff --git a/apps/pgmodeler-ch/res/windows_ico.rc b/apps/pgmodeler-ch/res/windows_ico.rc new file mode 100644 index 0000000000..b766205caf --- /dev/null +++ b/apps/pgmodeler-ch/res/windows_ico.rc @@ -0,0 +1 @@ + IDI_ICON1 ICON DISCARDABLE "pgmodeler_ch.ico" diff --git a/apps/pgmodeler-ch/src/crashhandlerform.cpp b/apps/pgmodeler-ch/src/crashhandlerform.cpp new file mode 100644 index 0000000000..e03f95f0d1 --- /dev/null +++ b/apps/pgmodeler-ch/src/crashhandlerform.cpp @@ -0,0 +1,220 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "crashhandlerform.h" +#include "messagebox.h" +#include "guiutilsns.h" +#include "qtconnectmacros.h" +#include "customuistyle.h" + +const QString CrashHandlerForm::AnalysisMode {"-analysis-mode"}; + +CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::WindowFlags f) : BugReportForm(parent, f) +{ + QFile input; + QString buf; + QWidget *wgt = new QWidget; + + CustomUiStyle::setStyleHint(CustomUiStyle::InfoFrmHint, hint_frm); + QHBoxLayout *layout = GuiUtilsNs::createHBoxLayout(GuiUtilsNs::LtMargin); + + setWindowTitle(tr("pgModeler crash handler")); + setWindowIcon(QPixmap(":/images/images/crashhandler.png")); + + stack_txt=new QPlainTextEdit(this); + stack_txt->setReadOnly(true); + stack_txt->setFont(QFont("Source Code Pro")); + stack_txt->setLineWrapMode(QPlainTextEdit::NoWrap); + + layout->addWidget(stack_txt); + wgt->setLayout(layout); + + logo_lbl->setPixmap(QPixmap(":/images/images/crashhandler.png")); + report_twg->addTab(wgt, GuiUtilsNs::getIcon("alert"), tr("Stack trace")); + + //Open for reading the stack trace file generated on the last crash + input.setFileName(GlobalAttributes::getTemporaryFilePath(GlobalAttributes::StacktraceFile)); + input.open(QFile::ReadOnly); + + if(input.isOpen()) + { + buf=input.readAll(); + input.close(); + + //Removes the stack trace file + QDir stack_file; + stack_file.remove(GlobalAttributes::getTemporaryFilePath(GlobalAttributes::StacktraceFile)); + + //Shows the stacktrace loaded on the widget + stack_txt->setPlainText(buf); + } + + //Creating an input field in order to select the input report file + input_wgt = new QWidget(this); + input_wgt->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + + layout = GuiUtilsNs::createHBoxLayout(0, GuiUtilsNs::LtSpacing, input_wgt); + + input_lbl = new QLabel(input_wgt); + input_lbl->setText(tr("Input")); + layout->addWidget(input_lbl); + + input_sel = new FileSelectorWidget(this); + input_sel->setFileDialogTitle(tr("Select bug report file")); + input_sel->setFileMustExist(true); + input_sel->setAcceptMode(QFileDialog::AcceptOpen); + input_sel->setNameFilters({ tr("pgModeler bug report (*.bug)"), tr("All files (*.*)") }); + input_sel->setToolTip(tr("Load report file for analysis")); + layout->addWidget(input_sel); + + save_tb=new QToolButton(input_wgt); + save_tb->setIcon(GuiUtilsNs::getIcon("save")); + save_tb->setSizePolicy(attach_tb->sizePolicy()); + save_tb->setToolButtonStyle(attach_tb->toolButtonStyle()); + save_tb->setIconSize(attach_tb->iconSize()); + save_tb->setToolTip(tr("Save the attached model file on the filesystem")); + save_tb->setEnabled(false); + attach_wgt->layout()->addWidget(save_tb); + + report_tab_grid->removeWidget(details_gb); + report_tab_grid->removeWidget(output_wgt); + report_tab_grid->removeWidget(hint_frm); + + report_tab_grid->addWidget(input_wgt); + report_tab_grid->addWidget(details_gb); + report_tab_grid->addWidget(output_wgt); + report_tab_grid->addWidget(hint_frm); + + setAnalysisMode(analysis_mode); + + connect(input_sel, &FileSelectorWidget::s_fileSelected, this, __slot_n(this, CrashHandlerForm::loadReport)); + connect(save_tb, &QToolButton::clicked, this, __slot(this, CrashHandlerForm::saveModel)); + + connect(input_sel, &FileSelectorWidget::s_selectorCleared, model_txt, &QPlainTextEdit::clear); + connect(input_sel, &FileSelectorWidget::s_selectorCleared, details_txt, &QPlainTextEdit::clear); + connect(input_sel, &FileSelectorWidget::s_selectorCleared, stack_txt, &QPlainTextEdit::clear); + + connect(model_txt, &QPlainTextEdit::textChanged, this, [this](){ + save_tb->setEnabled(!model_txt->toPlainText().isEmpty()); + }); +} + +void CrashHandlerForm::loadReport(QString filename) +{ + QFile input; + QFileInfo fi; + char *buf = nullptr; + + fi.setFile(filename); + input.setFileName(filename); + input.open(QFile::ReadOnly); + + //Raises an error if the file could not be opened + if(!input.isOpen()) + { + Messagebox::error(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), + ErrorCode::FileDirectoryNotAccessed, PGM_FUNC, PGM_FILE, PGM_LINE); + } + else + { + QByteArray uncomp_buf; + QString buf_aux, str_aux; + int i, idx; + QPlainTextEdit *txt_widgets[]={ details_txt, model_txt , stack_txt}; + + //Creates a text buffer + buf=new char[fi.size()]; + + //Reads the file storing it on the buffer + input.read(buf, fi.size()); + input.close(); + + //Uncompress the buffer + uncomp_buf.append(buf, fi.size()); + uncomp_buf=qUncompress(uncomp_buf); + + delete[](buf); + buf=nullptr; + + buf_aux=QString(uncomp_buf.data()); + i=idx=0; + + //Showing the sections of the uncompressed buffer on the respective widgets + while(i < buf_aux.size() && idx <= 2) + { + if(buf_aux.at(i).toLatin1()!=CharDelimiter) + str_aux.append(buf_aux.at(i)); + else + { + txt_widgets[idx++]->setPlainText(str_aux); + str_aux.clear(); + } + i++; + } + } +} + +void CrashHandlerForm::saveModel() +{ + try + { + GuiUtilsNs::selectAndSaveFile(model_txt->toPlainText().toUtf8(), + tr("Save model"), QFileDialog::AnyFile, + { tr("Database model (*%1)").arg(GlobalAttributes::DbModelExt), + tr("All files (*.*)") }, {}, + GlobalAttributes::DbModelExt); + } + catch(Exception &e) + { + Messagebox::error(e, PGM_FUNC, PGM_FILE, PGM_LINE); + } +} + +void CrashHandlerForm::setAnalysisMode(bool value) +{ + output_wgt->setEnabled(!value); + attach_tb->setEnabled(!value); + attach_mod_chk->setEnabled(!value); + save_tb->setVisible(value); + + create_btn->setVisible(!value); + input_wgt->setVisible(value); + + if(value) + { + title_lbl->setText(tr("pgModeler crash handler")); + msg_lbl->setText(tr("Bug report analysis mode activated.")); + } + else + { + title_lbl->setText(tr("Oh no! pgModeler just crashed!")); + msg_lbl->setText(tr("We apologize for what happened! It is clear that a nasty bug caused that. Please, fill out the form below describing your actions that somehow caused the unexpected closing. This will help us to investigate the causes and provide the proper fix for the problem.")); + } +} + +QByteArray CrashHandlerForm::generateReportBuffer() +{ + QByteArray buf=BugReportForm::generateReportBuffer(); + buf.append(stack_txt->toPlainText().toUtf8()); + buf.append(CharDelimiter); + + return buf; +} diff --git a/apps/pgmodeler-ch/src/crashhandlerform.h b/apps/pgmodeler-ch/src/crashhandlerform.h new file mode 100644 index 0000000000..0230f0cc88 --- /dev/null +++ b/apps/pgmodeler-ch/src/crashhandlerform.h @@ -0,0 +1,69 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup pgmodeler-ch +\class CrashHandlerForm +\brief Implements the pgModeler's crash handler enabling the generation an analysis of crash report files. +*/ + +#ifndef CRASH_HANDLER_H +#define CRASH_HANDLER_H + +#include +#include "tools/bugreportform.h" + +class CrashHandlerForm: public BugReportForm { + Q_OBJECT + + private: + //! \brief Display the stacktrace + QPlainTextEdit *stack_txt; + + //! \brief Container for widget that handles input report file + QWidget *input_wgt; + + QLabel *input_lbl; + + FileSelectorWidget *input_sel; + + //! \brief Triggers the model saving to filesystem + QToolButton *save_tb; + + void setAnalysisMode(bool value); + + //! \brief Generates a report buffer containing the issue details, model and stacktrace + QByteArray generateReportBuffer() override; + + public: + //! \brief Analysis mode argument + static const QString AnalysisMode; + + CrashHandlerForm(bool analysis_mode=false, QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); + + private slots: + //! \brief Load a report file showing its contents on the form + void loadReport(QString filename); + + void saveModel(); +}; + +#endif diff --git a/apps/pgmodeler-ch/src/main.cpp b/apps/pgmodeler-ch/src/main.cpp new file mode 100644 index 0000000000..f14ad58b90 --- /dev/null +++ b/apps/pgmodeler-ch/src/main.cpp @@ -0,0 +1,61 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "crashhandlerform.h" +#include "application.h" +#include +#include "guiutilsns.h" +#include "settings/appearanceconfigwidget.h" + +int main(int argc, char **argv) +{ + try + { + GlobalAttributes::init(argv[0], true); + Application app(argc,argv); + QStringList args = app.arguments(); + app.loadTranslations(QLocale::system().name(), false); + + try + { + /* Loading the appearance settings to make the UI + * the same as the main GUI executable (pgmodeler). + * We silently ignore the exception to avoid abort + * the execution of the crash handler */ + AppearanceConfigWidget appearance_conf; + appearance_conf.loadConfiguration(); + } + catch(Exception &){} + + CrashHandlerForm crashhandler(args.size() > 1 && args[1]==CrashHandlerForm::AnalysisMode); + GuiUtilsNs::resizeWidget(&crashhandler); + crashhandler.show(); + app.exec(); + + return 0; + } + catch(Exception &e) + { + QTextStream out(stdout); + out << e.getExceptionsText(); + return enum_t(e.getErrorCode()); + } +} diff --git a/apps/pgmodeler-cli/CMakeLists.txt b/apps/pgmodeler-cli/CMakeLists.txt new file mode 100644 index 0000000000..844d2c937f --- /dev/null +++ b/apps/pgmodeler-cli/CMakeLists.txt @@ -0,0 +1,3 @@ +pgm_add_executable(pgmodeler-cli src/main.cpp) +pgm_set_default_inc_libs(${PGM_TARGET}) +pgm_install_executable(${PGM_TARGET} OFF) diff --git a/apps/pgmodeler-cli/res/pgmodeler_cli.ico b/apps/pgmodeler-cli/res/pgmodeler_cli.ico new file mode 100644 index 0000000000..8d5eb40b34 Binary files /dev/null and b/apps/pgmodeler-cli/res/pgmodeler_cli.ico differ diff --git a/apps/pgmodeler-cli/res/windows_ico.rc b/apps/pgmodeler-cli/res/windows_ico.rc new file mode 100644 index 0000000000..d7b6423748 --- /dev/null +++ b/apps/pgmodeler-cli/res/windows_ico.rc @@ -0,0 +1 @@ + IDI_ICON1 ICON DISCARDABLE "pgmodeler_cli.ico" diff --git a/apps/pgmodeler-cli/src/main.cpp b/apps/pgmodeler-cli/src/main.cpp new file mode 100644 index 0000000000..8def6ba6d6 --- /dev/null +++ b/apps/pgmodeler-cli/src/main.cpp @@ -0,0 +1,64 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "pgmodelercliapp.h" + +int main(int argc, char **argv) +{ + QTextStream out(stdout); + +#ifdef DEMO_VERSION + out << Qt::endl; + out << "pgModeler " << GlobalAttributes::PgModelerVersion << QT_TR_NOOP(" command line interface.") << Qt::endl; + out << QT_TR_NOOP("PostgreSQL Database Modeler Project - pgmodeler.io") << Qt::endl; + out << QT_TR_NOOP("Copyright 2006-2024 Raphael Araújo e Silva ") << Qt::endl; + out << QT_TR_NOOP("\n** CLI disabled in demonstration version! **") << Qt::endl << Qt::endl; +#else + try + { + #ifdef Q_OS_LINUX + /* Workaround to make the CLI work on Linux systems without graphical interface. + * In that case, we just check if there's a DISPLAY env var defined. If not defined + * we force the usage of the "offscreen" plugin via QT_QPA_PLATFORM so the portions of + * the application that contains GUI elements can work properly. + * + * Details at https://github.com/pgmodeler/pgmodeler/issues/1604 */ + if(qgetenv("DISPLAY").isEmpty()) + qputenv("QT_QPA_PLATFORM", "offscreen"); + #endif + + GlobalAttributes::init(argv[0], false); + PgModelerCliApp pgmodeler_cli(argc, argv); + pgmodeler_cli.loadTranslations(QLocale::system().name(), true); + + //Executes the cli + return pgmodeler_cli.exec(); + } + catch(Exception &e) + { + out << Qt::endl; + out << e.getExceptionsText(); + out << QT_TR_NOOP("** pgmodeler-cli aborted due to critical error(s). **") << Qt::endl << Qt::endl; + return (e.getErrorCode()==ErrorCode::Custom ? -1 : enum_t(e.getErrorCode())); + } +#endif +} diff --git a/apps/pgmodeler-se/CMakeLists.txt b/apps/pgmodeler-se/CMakeLists.txt new file mode 100644 index 0000000000..da931aba54 --- /dev/null +++ b/apps/pgmodeler-se/CMakeLists.txt @@ -0,0 +1,21 @@ +# By default, the AUTOUIC option makes the uic look for the .ui files +# under the same folder as the sources. In this case, we force the uic +# command to look for .ui files under ui/* +set(CMAKE_AUTOUIC_SEARCH_PATHS ui) + +pgm_add_executable(pgmodeler-se + src/aboutsewidget.cpp src/aboutsewidget.h + src/main.cpp + src/schemaeditorform.cpp src/schemaeditorform.h + src/sourceeditorwidget.cpp src/sourceeditorwidget.h + ui/aboutsewidget.ui + ui/schemaeditorform.ui + ui/sourceeditorwidget.ui + ../pgmodeler/src/pgmodelerapp.cpp) + +target_include_directories(${PGM_TARGET} PRIVATE + ${PGM_TARGET}_autogen + ../pgmodeler/src) + +pgm_set_default_inc_libs(${PGM_TARGET}) +pgm_install_executable(${PGM_TARGET} ON) diff --git a/apps/pgmodeler-se/res/pgmodeler_se.ico b/apps/pgmodeler-se/res/pgmodeler_se.ico new file mode 100644 index 0000000000..e34d22e0f7 Binary files /dev/null and b/apps/pgmodeler-se/res/pgmodeler_se.ico differ diff --git a/apps/pgmodeler-se/res/windows_ico.rc b/apps/pgmodeler-se/res/windows_ico.rc new file mode 100644 index 0000000000..168d30b570 --- /dev/null +++ b/apps/pgmodeler-se/res/windows_ico.rc @@ -0,0 +1 @@ + IDI_ICON1 ICON DISCARDABLE "pgmodeler_se.ico" diff --git a/apps/pgmodeler-se/src/aboutsewidget.cpp b/apps/pgmodeler-se/src/aboutsewidget.cpp new file mode 100644 index 0000000000..381425ae78 --- /dev/null +++ b/apps/pgmodeler-se/src/aboutsewidget.cpp @@ -0,0 +1,34 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "aboutsewidget.h" +#include "guiutilsns.h" + +AboutSEWidget::AboutSEWidget(QWidget *parent) : QWidget(parent) +{ + setupUi(this); + + GuiUtilsNs::configureWidgetsFont({ title_lbl, pgmodeler_ver_lbl}, GuiUtilsNs::HugeFontFactor); + GuiUtilsNs::configureWidgetFont(build_num_lbl, GuiUtilsNs::BigFontFactor); + + pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PgModelerVersion)); + build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PgModelerBuildNumber).arg(QT_VERSION_STR)); +} diff --git a/apps/pgmodeler-se/src/aboutsewidget.h b/apps/pgmodeler-se/src/aboutsewidget.h new file mode 100644 index 0000000000..d383b1c24f --- /dev/null +++ b/apps/pgmodeler-se/src/aboutsewidget.h @@ -0,0 +1,40 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup pgmodeler-se +\class AboutSEWidget +\brief Form that contains information about software authoring and licensing. +*/ + +#ifndef ABOUT_SE_WIDGET_H +#define ABOUT_SE_WIDGET_H + +#include "ui_aboutsewidget.h" + +class AboutSEWidget: public QWidget, public Ui::AboutSEWidget { + Q_OBJECT + + public: + AboutSEWidget(QWidget *parent = nullptr); +}; + +#endif diff --git a/apps/pgmodeler-se/src/main.cpp b/apps/pgmodeler-se/src/main.cpp new file mode 100644 index 0000000000..079fa389a2 --- /dev/null +++ b/apps/pgmodeler-se/src/main.cpp @@ -0,0 +1,52 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "schemaeditorform.h" +#include "pgmodelerapp.h" +#include "exception.h" +#include "enumtype.h" + +int main(int argc, char **argv) +{ + try + { + GlobalAttributes::init(argv[0], true); + PgModelerApp app(argc,argv); + QStringList args = app.arguments(); + SchemaEditorForm syntaxchk; + + app.loadTranslations(QLocale::system().name(), false); + + args.pop_front(); + syntaxchk.loadFiles(args); + syntaxchk.showMaximized(); + app.exec(); + + return 0; + } + catch(Exception &e) + { + QTextStream out(stdout); + out << e.getExceptionsText(); + return enum_t(e.getErrorCode()); + } +} diff --git a/apps/pgmodeler-se/src/schemaeditorform.cpp b/apps/pgmodeler-se/src/schemaeditorform.cpp new file mode 100644 index 0000000000..1fda7e8c1e --- /dev/null +++ b/apps/pgmodeler-se/src/schemaeditorform.cpp @@ -0,0 +1,563 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "schemaeditorform.h" +#include "customuistyle.h" +#include "guiutilsns.h" +#include "globalattributes.h" +#include "messagebox.h" +#include "settings/appearanceconfigwidget.h" +#include "settings/generalconfigwidget.h" +#include "sourceeditorwidget.h" +#include "aboutsewidget.h" +#include "baseform.h" +#include "utilsns.h" +#include "qtconnectmacros.h" +#include +#include + +const QString SchemaEditorForm::UntitledFile { QT_TR_NOOP("(untitled)") }; + +SchemaEditorForm::SchemaEditorForm(QWidget *parent) : QWidget(parent) +{ + QToolButton *btn = nullptr; + QFont fnt; + + setupUi(this); + setWindowTitle(windowTitle() + " " + GlobalAttributes::PgModelerVersion); + CustomUiStyle::setStyleHint(CustomUiStyle::AlertFrmHint, alert_frm); + + for(auto &obj : btns_parent_wgt->children()) + { + btn = dynamic_cast(obj); + + if(!btn) + continue; + + if(!btn->toolTip().isEmpty() && !btn->shortcut().toString().isEmpty()) + btn->setToolTip(btn->toolTip() + QString(" (%1)").arg(btn->shortcut().toString())); + } + + AppearanceConfigWidget appearance_conf_wgt; + appearance_conf_wgt.loadConfiguration(); + GuiUtilsNs::updateDropShadows(qApp->allWidgets()); + + GeneralConfigWidget general_conf_wgt; + general_conf_wgt.loadConfiguration(); + + alert_frm->setVisible(false); + + syntax_txt = GuiUtilsNs::createNumberedTextEditor(syntax_wgt); + syntax_hl = new SyntaxHighlighter(syntax_txt); + syntax_hl->loadConfiguration(GlobalAttributes::getXMLHighlightConfPath()); + + dtd_txt = GuiUtilsNs::createNumberedTextEditor(dtd_wgt); + dtd_txt->setReadOnly(true); + dtd_hl = new SyntaxHighlighter(dtd_txt); + dtd_hl->loadConfiguration(GlobalAttributes::getXMLHighlightConfPath()); + + SourceEditorWidget::setDefaultEditorPalette(syntax_txt->palette()); + + syntax_conf_sel = new FileSelectorWidget(syntax_conf_wgt); + syntax_conf_sel->setReadOnly(true); + + QVBoxLayout *vbox = GuiUtilsNs::createVBoxLayout(0, 0, syntax_conf_wgt); + vbox->addWidget(syntax_conf_sel); + + syntax_conf_sel->setNameFilters({ tr("Syntax highlight config file (*%1)").arg(GlobalAttributes::ConfigurationExt) }); + + QAction *act = nullptr; + stx_action_grp = new QActionGroup(&syntax_cfg_menu); + + act = syntax_cfg_menu.addAction("Schema file", this, &SchemaEditorForm::loadSyntaxConfig); + stx_action_grp->addAction(act); + act->setCheckable(true); + act->setChecked(true); + act->setData(GlobalAttributes::SchHighlightConf); + + act = syntax_cfg_menu.addAction("XML script", this, &SchemaEditorForm::loadSyntaxConfig); + stx_action_grp->addAction(act); + act->setCheckable(true); + act->setChecked(false); + act->setData(GlobalAttributes::XMLHighlightConf); + + act = syntax_cfg_menu.addAction("SQL script", this, &SchemaEditorForm::loadSyntaxConfig); + stx_action_grp->addAction(act); + act->setData(GlobalAttributes::SQLHighlightConf); + act->setCheckable(true); + act->setChecked(false); + + syntax_tb->setMenu(&syntax_cfg_menu); + syntax_tb->setStyleSheet("QToolButton::menu-indicator { \ +image: url(':/styles/styles/h_menu_indicator.png'); \ +subcontrol-position: right center; }"); + + syntax_cfg_menu.installEventFilter(this); + + connect(apply_conf_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::applySyntaxConfig)); + connect(save_conf_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::saveSyntaxConfig)); + connect(reload_conf_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::loadSyntaxConfig)); + + connect(new_tb, &QToolButton::clicked, this, [this](){ + __trycatch( addEditorTab(); ) + }); + + connect(load_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::loadFile)); + connect(exit_tb, &QToolButton::clicked, this, &SchemaEditorForm::close); + + connect(save_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::saveFile)); + connect(indent_all_tb, &QToolButton::clicked, this, &SchemaEditorForm::indentAll); + + connect(save_all_tb, &QToolButton::clicked, this, __slot(this, SchemaEditorForm::saveAll)); + connect(close_all_tb, &QToolButton::clicked, this, &SchemaEditorForm::closeAll); + + connect(editors_tbw, &QTabWidget::tabCloseRequested, this, [this](int idx){ + closeEditorTab(idx); + }); + + connect(editors_tbw, &QTabWidget::currentChanged, this, __slot(this, SchemaEditorForm::loadSyntaxFromCurrentTab)); + connect(use_tmpl_file_chk, &QCheckBox::toggled, this, __slot(this, SchemaEditorForm::loadSyntaxConfig)); + + connect(syntax_txt, &NumberedTextEditor::textChanged, this, [this](){ + alert_frm->setVisible(true); + }); + + connect(save_as_tb, &QToolButton::clicked, this, [this](){ + __trycatch( saveFile(true); ) + }); + + connect(about_tb, &QToolButton::clicked, this, [](){ + AboutSEWidget *info_wgt = new AboutSEWidget; + BaseForm base_frm; + base_frm.setMainWidget(info_wgt); + base_frm.exec(); + }); +} + +void SchemaEditorForm::showEvent(QShowEvent *) +{ + h_splitter->setSizes({ width(), width()/2}); +} + +bool SchemaEditorForm::hasModifiedEditors() +{ + bool editors_modified = false; + SourceEditorWidget *editor = nullptr; + + for(int tab = 0; tab < editors_tbw->count(); tab++) + { + editor = dynamic_cast(editors_tbw->widget(tab)); + + if(editor->isModified()) + { + editors_modified = true; + break; + } + } + + return editors_modified; +} + +void SchemaEditorForm::closeEvent(QCloseEvent *event) +{ + if(alert_frm->isVisible() || hasModifiedEditors()) + { + int res = Messagebox::confirm(tr("There are modified files! Do you want to exit without saving them?")); + + if(Messagebox::isRejected(res)) + event->ignore(); + } +} + +bool SchemaEditorForm::eventFilter(QObject *object, QEvent *event) +{ + if(object == &syntax_cfg_menu && event->type() == QEvent::Show) + { + syntax_cfg_menu.move(mapToGlobal(syntax_tb->pos() + QPoint(syntax_tb->width(), 0))); + syntax_cfg_menu.show(); + return true; + } + + return QWidget::eventFilter(object, event); +} + +void SchemaEditorForm::loadSyntaxFromCurrentTab() +{ + SourceEditorWidget *editor = dynamic_cast(editors_tbw->currentWidget()); + + if(!editor) + return; + + stx_action_grp->blockSignals(true); + + for(auto &act : stx_action_grp->actions()) + { + if(act->data().toString() == editor->getCurrentSyntaxConfig()) + { + act->setChecked(true); + loadSyntaxConfig(); + break; + } + } + + stx_action_grp->blockSignals(true); +} + +void SchemaEditorForm::loadSyntaxConfig() +{ + QAction *act = stx_action_grp->checkedAction(); + QFile input; + QString filename; + + if(!act) + filename = GlobalAttributes::getSchHighlightConfPath(); + else + { + if(!use_tmpl_file_chk->isChecked()) + filename = GlobalAttributes::getConfigurationFilePath(act->data().toString()); + else + filename = GlobalAttributes::getTmplConfigurationFilePath("", act->data().toString() + GlobalAttributes::ConfigurationExt); + } + + try + { + syntax_txt->setPlainText(UtilsNs::loadFile(filename)); + syntax_conf_sel->setSelectedFile(filename); + + if(dtd_txt->toPlainText().isEmpty()) + { + filename = GlobalAttributes::getTmplConfigurationFilePath(GlobalAttributes::ObjectDTDDir, + GlobalAttributes::CodeHighlightConf + + GlobalAttributes::ObjectDTDExt); + + dtd_txt->setPlainText(UtilsNs::loadFile(filename)); + } + + save_conf_tb->setEnabled(true); + apply_conf_tb->setEnabled(true); + reload_conf_tb->setEnabled(true); + alert_frm->setVisible(false); + applySyntaxConfig(false); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } +} + +void SchemaEditorForm::applySyntaxConfig(bool from_temp_file) +{ + QTemporaryFile tmp_file; + QString filename; + + /* When applying the syntax on-the-fly we save the syntax conf code to a temporary file + * and use it as configuration for in the open editors */ + if(from_temp_file) + { + tmp_file.setAutoRemove(false); + tmp_file.setFileTemplate(GlobalAttributes::getTemporaryFilePath(QString("temp_XXXXXX%1").arg(GlobalAttributes::ConfigurationExt))); + tmp_file.open(); + filename = tmp_file.fileName(); + + if(!tmp_file.isOpen()) + { + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), + ErrorCode::FileDirectoryNotAccessed, PGM_FUNC, PGM_FILE, PGM_LINE); + } + + tmp_file.write(syntax_txt->toPlainText().toUtf8()); + tmp_file.close(); + } + else if(stx_action_grp->checkedAction()) + { + if(!use_tmpl_file_chk->isChecked()) + filename = GlobalAttributes::getConfigurationFilePath(stx_action_grp->checkedAction()->data().toString()); + else + filename = GlobalAttributes::getTmplConfigurationFilePath("", stx_action_grp->checkedAction()->data().toString() + GlobalAttributes::ConfigurationExt); + } + + try + { + /* Testing the temp file contents against a dummy syntax highlighter before + * applying to the open editors */ + QPlainTextEdit dummy_txt; + SyntaxHighlighter stx_hl(&dummy_txt); + stx_hl.loadConfiguration(filename); + + SourceEditorWidget *editor = dynamic_cast(editors_tbw->currentWidget()); + + if(editor) + editor->loadSyntaxConfig(filename); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } + + if(from_temp_file) + tmp_file.remove(); +} + +void SchemaEditorForm::saveSyntaxConfig() +{ + UtilsNs::saveFile(syntax_conf_sel->getSelectedFile(), syntax_txt->toPlainText().toUtf8()); + alert_frm->setVisible(false); + applySyntaxConfig(true); +} + +void SchemaEditorForm::saveFile(bool save_as) +{ + SourceEditorWidget *editor = dynamic_cast(editors_tbw->widget(editors_tbw->currentIndex())); + QString filename = editor->getFilename(); + + if(save_as || filename.isEmpty()) + { + QStringList files = showFileDialog(true); + + if(files.isEmpty()) + return; + + filename = files.at(0); + } + + editor->saveFile(filename); + editor->setModified(false); + QFileInfo fi(filename); + editors_tbw->setTabText(editors_tbw->currentIndex(), fi.fileName()); + editors_tbw->setTabToolTip(editors_tbw->currentIndex(), fi.absoluteFilePath()); +} + +void SchemaEditorForm::setTabModified(bool modified) +{ + SourceEditorWidget *editor = dynamic_cast(sender()); + int idx = editors_tbw->indexOf(editor); + QString tab_text = editors_tbw->tabText(idx); + + if(modified && !tab_text.endsWith('*')) + tab_text += '*'; + else if(!modified) + tab_text.remove('*'); + + editors_tbw->setTabText(idx, tab_text); +} + +void SchemaEditorForm::indentAll() +{ + SourceEditorWidget *editor = nullptr; + + qApp->setOverrideCursor(Qt::WaitCursor); + + for(int tab = 0; tab < editors_tbw->count(); tab++) + { + editor = dynamic_cast(editors_tbw->widget(tab)); + editor->indent_tb->click(); + } + + qApp->restoreOverrideCursor(); +} + +void SchemaEditorForm::saveAll() +{ + qApp->setOverrideCursor(Qt::WaitCursor); + + for(int tab = 0; tab < editors_tbw->count(); tab++) + { + editors_tbw->setCurrentIndex(tab); + + try + { + saveFile(); + } + catch(Exception &e) + { + Messagebox::error(e, PGM_FUNC, PGM_FILE, PGM_LINE); + break; + } + } + + qApp->restoreOverrideCursor(); +} + +void SchemaEditorForm::closeAll() +{ + if(hasModifiedEditors()) + { + int res = Messagebox::confirm(tr("There are modified files! Do you want to close them without save?")); + + if(Messagebox::isRejected(res)) + return; + } + + qApp->setOverrideCursor(Qt::WaitCursor); + + while(editors_tbw->count() > 0) + closeEditorTab(0, false); + + qApp->restoreOverrideCursor(); +} + +QStringList SchemaEditorForm::showFileDialog(bool save_mode) +{ + QFileDialog file_dlg; + QStringList files, filters= { + tr("Schema file (*%1)").arg(GlobalAttributes::SchemaExt), + tr("Database model file (*%1)").arg(GlobalAttributes::DbModelExt), + tr("pgModeler config file (*%1)").arg(GlobalAttributes::ConfigurationExt), + tr("Objects metadata file (*%1)").arg(GlobalAttributes::ObjMetadataExt), + tr("SQL script file (*.sql)"), + tr("XML file (*.xml)"), + tr("DTD file (*.dtd)"), + tr("All files (*.*)") + }; + + if(!save_mode) + filters.prepend(tr("All supported files (*%1 *%2 *%3 *%4 *.sql *.xml *.dtd)") + .arg(GlobalAttributes::SchemaExt, GlobalAttributes::DbModelExt, + GlobalAttributes::ConfigurationExt, GlobalAttributes::ObjMetadataExt)); + + file_dlg.setNameFilters(filters); + + file_dlg.setWindowTitle(save_mode ? tr("Save file") : tr("Load file")); + file_dlg.setFileMode(save_mode ? QFileDialog::AnyFile : QFileDialog::ExistingFiles); + file_dlg.setAcceptMode(save_mode ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen); + + if(save_mode) + { + file_dlg.setDefaultSuffix(".sch"); + connect(&file_dlg, &QFileDialog::filterSelected, this, [&file_dlg](QString filter){ + filter.remove(QRegularExpression("(.)+(\\*)")); + filter.remove(")"); + file_dlg.setDefaultSuffix(filter); + }); + } + + GuiUtilsNs::restoreFileDialogState(&file_dlg); + + if(file_dlg.exec() == QFileDialog::Accepted) + files = file_dlg.selectedFiles(); + + GuiUtilsNs::saveFileDialogState(&file_dlg); + + return files; +} + +void SchemaEditorForm::loadFile() +{ + try + { + QStringList files = showFileDialog(false); + + if(!files.isEmpty()) + loadFiles(files); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } +} + +void SchemaEditorForm::loadFiles(const QStringList &filenames) +{ + try + { + qApp->setOverrideCursor(Qt::WaitCursor); + + for(auto &file : filenames) + addEditorTab(file); + + qApp->restoreOverrideCursor(); + } + catch(Exception &e) + { + //qApp->restoreOverrideCursor(); + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } +} + +void SchemaEditorForm::addEditorTab(const QString &filename) +{ + SourceEditorWidget *editor_wgt = nullptr; + QFileInfo fi(filename); + + try + { + editor_wgt = new SourceEditorWidget; + + if(!filename.isEmpty()) + editor_wgt->loadFile(filename); + + connect(editor_wgt, &SourceEditorWidget::s_editorModified, this, &SchemaEditorForm::setTabModified); + } + catch(Exception &e) + { + delete editor_wgt; + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } + + editors_tbw->addTab(editor_wgt, filename.isEmpty() ? UntitledFile : fi.fileName()); + editors_tbw->setTabToolTip(editors_tbw->count() - 1, filename.isEmpty() ? "" : fi.absoluteFilePath()); + editors_tbw->setCurrentIndex(editors_tbw->count() - 1); + save_as_tb->setEnabled(true); + save_tb->setEnabled(true); + indent_all_tb->setEnabled(true); + save_all_tb->setEnabled(true); + close_all_tb->setEnabled(true); + syntax_cfg_edit_frm->setEnabled(true); + syntax_tb->setEnabled(true); +} + +void SchemaEditorForm::closeEditorTab(int idx, bool confirm_close) +{ + SourceEditorWidget *editor_wgt = dynamic_cast(editors_tbw->widget(idx)); + + if(editor_wgt->isModified() && confirm_close) + { + int res = Messagebox::confirm(tr("The source code was modified! Do you really want to close it without save?")); + + if(Messagebox::isRejected(res)) + return; + } + + editors_tbw->removeTab(idx); + delete(editor_wgt); + + bool enable = editors_tbw->count() > 0; + save_as_tb->setEnabled(enable); + save_tb->setEnabled(enable); + indent_all_tb->setEnabled(enable); + save_all_tb->setEnabled(enable); + close_all_tb->setEnabled(enable); + syntax_cfg_edit_frm->setEnabled(enable); + syntax_tb->setEnabled(enable); + + if(!enable) + { + syntax_txt->blockSignals(true); + syntax_conf_sel->blockSignals(true); + + syntax_txt->clear(); + syntax_conf_sel->clearSelector(); + alert_frm->setVisible(false); + + syntax_txt->blockSignals(false); + syntax_conf_sel->blockSignals(false); + } +} diff --git a/apps/pgmodeler-se/src/schemaeditorform.h b/apps/pgmodeler-se/src/schemaeditorform.h new file mode 100644 index 0000000000..42930d9011 --- /dev/null +++ b/apps/pgmodeler-se/src/schemaeditorform.h @@ -0,0 +1,81 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup pgmodeler-se +\class SchemaEditorForm +\brief Implements the pgModeler's schema files editor and syntax checker. +*/ + +#ifndef SCHEMA_EDITOR_FORM_H +#define SCHEMA_EDITOR_FORM_H + +#include +#include "ui_schemaeditorform.h" +#include "widgets/numberedtexteditor.h" +#include "utils/syntaxhighlighter.h" +#include "widgets/fileselectorwidget.h" + +class SchemaEditorForm: public QWidget, public Ui::SchemaEditorForm { + Q_OBJECT + + private: + static const QString UntitledFile; + + NumberedTextEditor *syntax_txt, *dtd_txt; + + SyntaxHighlighter *syntax_hl, *dtd_hl; + + FileSelectorWidget *syntax_conf_sel; + + QActionGroup *stx_action_grp; + + QMenu syntax_cfg_menu; + + void showEvent(QShowEvent *) override; + + void closeEvent(QCloseEvent *event) override; + + bool eventFilter(QObject *object, QEvent *event) override; + + QStringList showFileDialog(bool save_mode); + + public: + explicit SchemaEditorForm(QWidget *parent = nullptr); + void loadFiles(const QStringList &filenames); + bool hasModifiedEditors(); + + private slots: + void loadSyntaxConfig(); + void applySyntaxConfig(bool from_temp_file = true); + void saveSyntaxConfig(); + void addEditorTab(const QString &filename = ""); + void closeEditorTab(int idx, bool confirm_close = true); + void loadFile(); + void saveFile(bool save_as = false); + void setTabModified(bool modified); + void indentAll(); + void saveAll(); + void closeAll(); + void loadSyntaxFromCurrentTab(); +}; + +#endif diff --git a/apps/pgmodeler-se/src/sourceeditorwidget.cpp b/apps/pgmodeler-se/src/sourceeditorwidget.cpp new file mode 100644 index 0000000000..38144555b7 --- /dev/null +++ b/apps/pgmodeler-se/src/sourceeditorwidget.cpp @@ -0,0 +1,431 @@ +#include "sourceeditorwidget.h" +#include "messagebox.h" +#include "guiutilsns.h" +#include "utilsns.h" +#include + +attribs_map SourceEditorWidget::snippets { + {"ifend", "%if {} %then\n\n%end\n"}, + {"ifelseend", "%if {} %then\n\n%else\n\n%end\n"}, + {"ifexpr", "%if ({}) %then\n\n%end\n"}, + {"ifexprelse", "%if ({}) %then\n\n%else\n\n%end\n"}, + {"setattrstr", "%set {} \"\"\n"}, + {"setattrtxt", "%set {} [ ]\n"}, + {"unsetattr", "%unset {}\n"}, + {"unsetattr", "%unset {}\n"}, +}; + +QPalette SourceEditorWidget::def_editor_pal; + +SourceEditorWidget::SourceEditorWidget(QWidget *parent) : QWidget(parent) +{ + setupUi(this); + + is_modified = false; + curr_sytax_cfg = GlobalAttributes::SchHighlightConf; + + editor_txt = GuiUtilsNs::createNumberedTextEditor(editor_parent); + def_editor_pal = editor_txt->palette(); + + editor_hl = new SyntaxHighlighter(editor_txt); + search_wgt = new SearchReplaceWidget(editor_txt, search_parent); + search_parent->setVisible(false); + + code_compl_wgt = new CodeCompletionWidget(editor_txt); + code_compl_wgt->configureCompletion(nullptr, editor_hl); + + source_file_sel = new FileSelectorWidget(source_file_parent); + source_file_sel->setReadOnly(true); + source_file_parent->setVisible(false); + + QVBoxLayout *vbox = GuiUtilsNs::createVBoxLayout(0, 0, source_file_parent); + vbox->addWidget(source_file_sel); + + for(auto &itr : snippets) + code_compl_wgt->insertCustomItem(itr.first, itr.second, GuiUtilsNs::getPixmap("codesnippet")); + + vbox = GuiUtilsNs::createVBoxLayout(0, 0, search_parent); + vbox->setContentsMargins(0, 0, 0, GuiUtilsNs::LtMargin); + vbox->addWidget(search_wgt); + + indent_tb->setMenu(&indent_opts_menu); + act_break_inline_ifs = indent_opts_menu.addAction(tr("Break inline ifs")); + act_break_inline_ifs->setCheckable(true); + act_break_inline_ifs->setChecked(false); + + metachars_tb->setMenu(&metachar_conv_menu); + metachar_conv_menu.addAction(tr("Metachar to escaped"), this, [this](){ + convertMetaChars(false); + }); + + metachar_conv_menu.addAction(tr("Escaped to metachar"), this, [this](){ + convertMetaChars(true); + }); + + connect(code_compl_wgt, &CodeCompletionWidget::s_wordSelected, this, &SourceEditorWidget::handleSelectedSnippet); + connect(search_wgt, &SearchReplaceWidget::s_hideRequested, search_tb, &QToolButton::toggle); + connect(validate_tb, &QToolButton::clicked, this, &SourceEditorWidget::validateSyntax); + connect(indent_tb, &QToolButton::clicked, this, &SourceEditorWidget::applyIndentation); + connect(editor_txt, &NumberedTextEditor::modificationChanged, this, &SourceEditorWidget::restoreEditorPalette); + connect(editor_txt, &NumberedTextEditor::undoAvailable, this, &SourceEditorWidget::setModified); + connect(editor_txt, &NumberedTextEditor::cursorPositionChanged, this, &SourceEditorWidget::restoreEditorPalette); + connect(search_tb, &QToolButton::toggled, search_parent, &QWidget::setVisible); + connect(comment_tb, &QToolButton::clicked, this, &SourceEditorWidget::toggleComment); + + connect(editor_txt, &NumberedTextEditor::selectionChanged, this, [this]() { + comment_tb->setEnabled(editor_txt->textCursor().hasSelection()); + }); +} + +void SourceEditorWidget::saveFile(const QString &filename) +{ + UtilsNs::saveFile(filename, editor_txt->toPlainText().toUtf8()); + + validate_tb->setEnabled(filename.endsWith(GlobalAttributes::SchemaExt)); + indent_tb->setEnabled(filename.endsWith(GlobalAttributes::SchemaExt)); + this->filename = filename; + source_file_sel->setSelectedFile(filename); + source_file_parent->setVisible(true); +} + +void SourceEditorWidget::loadSyntaxConfig(const QString &filename) +{ + try + { + editor_hl->loadConfiguration(filename); + editor_hl->rehighlight(); + curr_sytax_cfg = QFileInfo(filename).baseName(); + metachars_tb->setEnabled(curr_sytax_cfg == GlobalAttributes::SchHighlightConf); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(), PGM_FUNC, PGM_FILE, PGM_LINE, &e); + } +} + +void SourceEditorWidget::toggleComment() +{ + QTextCursor tc = editor_txt->textCursor(); + + if(tc.hasSelection()) + { + QMap comment_chrs = { + { GlobalAttributes::SchHighlightConf, { "# ", ""}}, + { GlobalAttributes::SQLHighlightConf, { "-- ", ""}}, + { GlobalAttributes::XMLHighlightConf, { ""}} + }; + QString open_cmt, close_cmt, + sel_text = tc.selection().toPlainText(); + + open_cmt = comment_chrs[curr_sytax_cfg][0]; + close_cmt = comment_chrs[curr_sytax_cfg][1]; + + if(curr_sytax_cfg == GlobalAttributes::XMLHighlightConf) + { + sel_text.prepend(open_cmt); + sel_text.append(close_cmt); + } + else + { + QStringList lines = sel_text.split(QChar::LineFeed); + + for(auto &line : lines) + { + if(line.isEmpty()) + continue; + + if(line.startsWith(open_cmt)) + line.remove(open_cmt); + else + line.prepend(open_cmt); + + if(line.endsWith(close_cmt)) + line.remove(close_cmt); + else + line.append(close_cmt); + } + + sel_text = lines.join(QChar::LineFeed); + } + + tc.insertText(sel_text); + } +} + +void SourceEditorWidget::convertMetaChars(bool escaped_to_meta) +{ + attribs_map metas { + {"\\#", "$hs"}, {"\\s", "$sp"}, + {"\\t", "$tb"}, {"\\n", "$br"}, + {"\\[", "$ob"}, {"\\]", "$cb"}, + {"\\{", "$oc"}, {"\\}", "$cc"}, + {"\\\\", "$bs"}, {"\\@", "$at"}, + {"\\%", "$ps"}, {"\\&", "$am"}, + {"\\$", "$ms"}, {"\\*", "$ds"} + }; + + QString code = editor_txt->toPlainText(); + + for(const auto &[escaped, metachr] : metas) + { + if(escaped_to_meta) + code.replace(escaped, metachr); + else + code.replace(metachr, escaped); + } + + editor_txt->blockSignals(true); + QTextCursor tc = editor_txt->textCursor(); + tc.setPosition(0); + tc.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + tc.insertText(code); + editor_txt->moveCursor(QTextCursor::Start); + editor_txt->blockSignals(false); +} + +void SourceEditorWidget::handleSelectedSnippet(const QString &snippet) +{ + QTextCursor tc = editor_txt->textCursor(); + tc.movePosition(QTextCursor::PreviousWord, QTextCursor::KeepAnchor); + tc.removeSelectedText(); + tc.insertText(snippets[snippet]); +} + +QString SourceEditorWidget::getCurrentSyntaxConfig() +{ + return curr_sytax_cfg; +} + +void SourceEditorWidget::loadFile(const QString &filename) +{ + if(filename.isEmpty()) + return; + + bool enable = filename.endsWith(GlobalAttributes::SchemaExt); + + editor_txt->setPlainText(UtilsNs::loadFile(filename)); + validate_tb->setEnabled(enable); + indent_tb->setEnabled(enable); + code_compl_wgt->setEnabled(enable); + this->filename = filename; + source_file_sel->setSelectedFile(filename); + source_file_parent->setVisible(true); + + QString ext = "." + QFileInfo(filename).suffix(); + + if(ext == ".sql") + curr_sytax_cfg = GlobalAttributes::SQLHighlightConf; + else if(ext == GlobalAttributes::SchemaExt) + curr_sytax_cfg = GlobalAttributes::SchHighlightConf; + else + curr_sytax_cfg = GlobalAttributes::XMLHighlightConf; +} + +void SourceEditorWidget::validateSyntax() +{ + SchemaParser schparser; + + try + { + editor_txt->setPalette(def_editor_pal); + schparser.ignoreEmptyAttributes(true); + schparser.ignoreUnkownAttributes(true); + schparser.setSearchPath(QFileInfo(filename).absolutePath()); + schparser.loadBuffer(editor_txt->toPlainText()); + schparser.getSourceCode({}); + + Messagebox::info(tr("No lexical or syntactical errors found.")); + } + catch(Exception &e) + { + // When founding an error we try to highlight the exact portion of the document where to problem is + QTextCursor cursor(editor_txt->document()->findBlockByLineNumber(schparser.getCurrentLine() - 1)); + cursor.movePosition(QTextCursor::StartOfLine); + cursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, schparser.getCurrentColumn()); + + editor_txt->blockSignals(true); + editor_txt->setTextCursor(cursor); + editor_txt->blockSignals(false); + + // Changing the text selection color so the user can see where the problem is + QPalette pal = editor_txt->palette(); + pal.setColor(QPalette::Highlight, QColor("#f00000")); + pal.setColor(QPalette::HighlightedText, QColor("#ffffff")); + editor_txt->setPalette(pal); + + Messagebox::error(e, PGM_FUNC, PGM_FILE, PGM_LINE); + } +} + +void SourceEditorWidget::restoreEditorPalette() +{ + editor_txt->setPalette(def_editor_pal); +} + +void SourceEditorWidget::applyIndentation() +{ + QStringList buffer = editor_txt->toPlainText().split(QChar::LineFeed); + int if_level = 0, comment_pos = -1, line_count = buffer.size(); + bool found_cond = false, /* found_if = false,*/ inline_ifend = false; + QString cond_pattern = QString("^(( )|(\\t))*(%1)"), line, + tk_if = SchemaParser::CharStartConditional + SchemaParser::TokenIf, + tk_then = SchemaParser::CharStartConditional + SchemaParser::TokenThen, + tk_else = SchemaParser::CharStartConditional + SchemaParser::TokenElse, + tk_end = SchemaParser::CharStartConditional + SchemaParser::TokenEnd; + QRegularExpression inline_if_regexp(QString("(%1)(.)+(%2)").arg(tk_if).arg(tk_end)); + + for(int ln_idx = 0; ln_idx < line_count; ln_idx++) + { + line = buffer[ln_idx]; + comment_pos = line.indexOf(SchemaParser::CharComment); + inline_ifend = line.contains(inline_if_regexp); + + if(line.contains(QRegularExpression(cond_pattern.arg(tk_if))) && !inline_ifend) + { + if_level++; + /* found_if = */ found_cond = true; + } + else if(line.contains(QRegularExpression(cond_pattern.arg(tk_else))) || + line.contains(QRegularExpression(cond_pattern.arg(tk_end)))) + found_cond = true; + + // If the current line is an inline if: %if ... %then ... %end, we break it + if(act_break_inline_ifs->isChecked() && inline_ifend) + { + line.replace(tk_if, QChar::LineFeed + tk_if); + line.replace(tk_then, tk_then + QChar::LineFeed); + line.replace(tk_else, QChar::LineFeed + tk_else + QChar::LineFeed); + line.replace(tk_end, QChar::LineFeed + tk_end + QChar::LineFeed ); + + /* If the line was broke ( presence of \n) we split the resulting string + * and insert the new lines in the buffer and restart the indentation process */ + if(line.contains(QChar::LineFeed)) + { + QStringList buf_aux = line.split(QChar::LineFeed, Qt::SkipEmptyParts); + buffer.removeAt(ln_idx); + + for(auto itr = buf_aux.rbegin(); itr != buf_aux.rend(); itr++) + buffer.insert(ln_idx, *itr); + + ln_idx = 0; + found_cond = /* found_if = */ false; + if_level = 0; + line_count = buffer.size(); + continue; + } + } + + line = line.simplified(); + + if(!line.isEmpty()) + { + line = line.rightJustified(line.size() + if_level + (found_cond ? -1 : 0), QChar::Tabulation); + + if(!inline_ifend) + if_level -= line.mid(0, comment_pos).count(QString("%1%2").arg(SchemaParser::CharStartConditional).arg(SchemaParser::TokenEnd)); + } + + buffer[ln_idx] = line; + found_cond /* = found_if */ = false; + } + + QRegularExpression cond_tk_regexp(QString("^(( )|(\\t))*(%1)[a-z]+").arg(SchemaParser::CharStartConditional)); + QString prev_line, next_line, next_next_line, + tk_set = SchemaParser::CharStartConditional + SchemaParser::TokenSet, + tk_unset = SchemaParser::CharStartConditional + SchemaParser::TokenUnset; + + for(int ln_idx = 0; ln_idx < buffer.count() - 1; ln_idx++) + { + line = buffer[ln_idx].mid(0, buffer[ln_idx].indexOf(SchemaParser::CharComment)); + + // Ignoring the line if it contains a inline if + if(line.contains(inline_if_regexp)) + continue; + + // Capturing the previous, next lines without comment portion + prev_line = ln_idx > 0 ? buffer[ln_idx - 1].mid(0, buffer[ln_idx - 1].indexOf(SchemaParser::CharComment)) : ""; + next_line = ln_idx < buffer.count() - 1 ? buffer[ln_idx + 1].mid(0, buffer[ln_idx + 1].indexOf(SchemaParser::CharComment)) : ""; + next_next_line = ln_idx < buffer.count() - 2 ? buffer[ln_idx + 2].mid(0, buffer[ln_idx + 2].indexOf(SchemaParser::CharComment)) : ""; + + /* Removing the empty line in the following cases: + * 1) Between a two %end tokens + * 2) Between an %end and %else + * 3) Between an two %if tokens + * 4) Between an %else and %if | %set | %unset */ + if(next_line.isEmpty() && !next_next_line.isEmpty() && + ((line.contains(QRegularExpression(cond_pattern.arg(tk_end))) && + (next_next_line.contains(QRegularExpression(cond_pattern.arg(tk_else))) || + next_next_line.contains(QRegularExpression(cond_pattern.arg(tk_end))))) || + + ((line.contains(QRegularExpression(cond_pattern.arg(tk_if))) || + line.contains(QRegularExpression(cond_pattern.arg(tk_else)))) && + (next_next_line.contains(QRegularExpression(cond_pattern.arg(tk_if))) || + next_next_line.contains(QRegularExpression(cond_pattern.arg(tk_set))) || + next_next_line.contains(QRegularExpression(cond_pattern.arg(tk_unset))))))) + { + buffer.removeAt(ln_idx + 1); + ln_idx--; + continue; + } + + // Separating an end token from any conditional token in the next line + if(line.contains(QRegularExpression(cond_pattern.arg(tk_end))) && + !next_line.isEmpty() && + !next_line.contains(cond_tk_regexp)) + buffer[ln_idx].append(QChar::LineFeed); + + // Separating an closed plain text from the next line + else if(line.endsWith(SchemaParser::CharEndPlainText) && + !next_line.isEmpty() && + !next_line.contains(cond_tk_regexp)) + buffer[ln_idx].append(QChar::LineFeed); + + // If the current line has an %if and the previous is not a conditional instruction % + else if(line.contains(QRegularExpression(cond_pattern.arg(tk_if))) && + !prev_line.isEmpty() && + !prev_line.contains(cond_tk_regexp)) + buffer[ln_idx].prepend(QChar::LineFeed); + + // Separating an if token from previous end, set and unset + else if(line.contains(QRegularExpression(cond_pattern.arg(tk_if))) && + (prev_line.contains(tk_end) || + prev_line.contains(tk_set) || + prev_line.contains(tk_unset))) + buffer[ln_idx].prepend(QChar::LineFeed); + } + + /* Replacing the current code with the formatted one in such a way to preserve + * the undo/redo stack. This is achieved by selecting the whole text document + * and inserting the new text using the cursor. Using QPlainTextEdit::setPlainText + * will clear the stack. */ + editor_txt->blockSignals(true); + QTextCursor cursor = editor_txt->textCursor(); + cursor.movePosition(QTextCursor::Start); + cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); + cursor.insertText(buffer.join(QChar::LineFeed)); + cursor = editor_txt->textCursor(); + editor_txt->moveCursor(QTextCursor::Start); + editor_txt->blockSignals(false); + setModified(true); +} + +void SourceEditorWidget::setModified(bool value) +{ + is_modified = value; + emit s_editorModified(value); +} + +void SourceEditorWidget::setDefaultEditorPalette(const QPalette &pal) +{ + def_editor_pal = pal; +} + +QString SourceEditorWidget::getFilename() +{ + return filename; +} + +bool SourceEditorWidget::isModified() +{ + return is_modified; +} diff --git a/apps/pgmodeler-se/src/sourceeditorwidget.h b/apps/pgmodeler-se/src/sourceeditorwidget.h new file mode 100644 index 0000000000..0fb7e4d582 --- /dev/null +++ b/apps/pgmodeler-se/src/sourceeditorwidget.h @@ -0,0 +1,109 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup pgmodeler-sc +\class SourceEditorWidget +\brief Implements the basic source code editor with minimal code completion for schema files. +*/ + +#ifndef SOURCE_EDITOR_WIDGET_H +#define SOURCE_EDITOR_WIDGET_H + +#include +#include "ui_sourceeditorwidget.h" +#include "widgets/numberedtexteditor.h" +#include "utils/syntaxhighlighter.h" +#include "widgets/searchreplacewidget.h" +#include "widgets/codecompletionwidget.h" +#include "widgets/fileselectorwidget.h" + +class SourceEditorWidget: public QWidget, public Ui::SourceEditorWidget { + Q_OBJECT + + private: + static attribs_map snippets; + + static QPalette def_editor_pal; + + CodeCompletionWidget *code_compl_wgt; + + FileSelectorWidget *source_file_sel; + + NumberedTextEditor *editor_txt; + + SyntaxHighlighter *editor_hl; + + SearchReplaceWidget *search_wgt; + + QString filename, curr_sytax_cfg; + + QAction *act_break_inline_ifs; + + QMenu indent_opts_menu, metachar_conv_menu; + + bool is_modified; + + public: + explicit SourceEditorWidget(QWidget *parent = nullptr); + + /*! \brief Defines the default pallete for text editor. + * This is used to restore the colors of the editor after an error is raised + * during syntax validation and the text selection color is changed to point the + * error location */ + static void setDefaultEditorPalette(const QPalette &pal); + + //! \brief Returns the file being handled by the editor + QString getFilename(); + + //! \brief Returns the current modification status of the editor + bool isModified(); + + QString getCurrentSyntaxConfig(); + + void convertMetaChars(bool escaped_to_meta); + + private slots: + //! \brief Validates the syntax of the editor's content (only for schema micro-language code) + void validateSyntax(); + + //! \brief Restores the editor default colors after highlighting an syntax error in a portion of the text + void restoreEditorPalette(); + + //! \brief Applies a custom identation on the editor's content (only for schema micro-language code) + void applyIndentation(); + + //! \brief Insert the selected snippet into the editors (only for schema micro-language code) + void handleSelectedSnippet(const QString &snippet); + + void toggleComment(); + + public slots: + void setModified(bool value); + void loadFile(const QString &filename); + void saveFile(const QString &filename); + void loadSyntaxConfig(const QString &filename); + + signals: + void s_editorModified(bool value); +}; + +#endif diff --git a/apps/pgmodeler-se/ui/aboutsewidget.ui b/apps/pgmodeler-se/ui/aboutsewidget.ui new file mode 100644 index 0000000000..f47919dfbd --- /dev/null +++ b/apps/pgmodeler-se/ui/aboutsewidget.ui @@ -0,0 +1,436 @@ + + + AboutSEWidget + + + Qt::NonModal + + + + 0 + 0 + 816 + 704 + + + + + 0 + 0 + + + + + 650 + 500 + + + + + 16777215 + 16777215 + + + + About pgModeler Schema Editor + + + + :/images/images/schemafile.png:/images/images/schemafile.png + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + + 100 + 100 + + + + + 100 + 100 + + + + + + + + + + :/images/images/schemafile.png + + + true + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + true + + + + pgModeler Schema Editor + + + Qt::AlignCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + true + true + + + + + + + 0.0.0 + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 129 + 0 + + + + + + + + + 0 + 129 + 0 + + + + + + + + + 128 + 128 + 128 + + + + + + + + + true + false + + + + (BUILD_NUM) + + + Qt::AlignCenter + + + -1 + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + false + + + + QFrame::NoFrame + + + Create, edit and verify the syntax of files written in pgModeler's schema micro-language. You can also tweak the tool's syntax highlighting settings to be used by the main GUI application. + + + Qt::PlainText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 0 + + + Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + License + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + QFrame::Sunken + + + QAbstractScrollArea::AdjustToContents + + + false + + + QTextEdit::WidgetWidth + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><meta charset="utf-8" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:11pt;">pgModeler - PostgreSQL Database Modeler<br />Copyright 2006-2021 - Raphael Araújo e Silva<br /><br />This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3.<br /><br />This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br /><br />The complete text of GPLv3 is at LICENSE file on pgModeler's source code root directory. Also, you can get the complete GNU General Public License at &lt;</span><a href="http://www.gnu.org/licenses"><span style=" font-family:'Courier'; font-size:11pt; text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses</span></a><span style=" font-family:'Courier'; font-size:11pt;">&gt;</span></p></body></html> + + + false + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + 77 + 48 + + + + pgModeler is proudly a Brazilian software! + + + + + + + + + :/images/images/brazil_flag.png + + + true + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + 0 + 0 + + + + <html><head/><body><p>Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> + + + Qt::AutoText + + + 5 + + + true + + + + + + + + + + + + + + + + diff --git a/apps/pgmodeler-se/ui/schemaeditorform.ui b/apps/pgmodeler-se/ui/schemaeditorform.ui new file mode 100644 index 0000000000..ecb5d6da88 --- /dev/null +++ b/apps/pgmodeler-se/ui/schemaeditorform.ui @@ -0,0 +1,1003 @@ + + + SchemaEditorForm + + + + 0 + 0 + 1792 + 1075 + + + + + 800 + 600 + + + + pgModeler Schema Editor + + + + :/images/images/schemafile.png:/images/images/schemafile.png + + + + 0 + + + 0 + + + 5 + + + 5 + + + 5 + + + + + Qt::Orientation::Horizontal + + + 4 + + + false + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 5 + + + + + + 16777215 + 16777215 + + + + QTabWidget::TabPosition::North + + + true + + + true + + + + + + + + false + + + + 0 + + + 5 + + + 0 + + + 0 + + + 5 + + + + + + 0 + 0 + + + + Syntax file: + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + QFrame::Shape::StyledPanel + + + QFrame::Shadow::Raised + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + false + + + Save && apply + + + + :/icons/icons/save.png:/icons/icons/save.png + + + + 25 + 25 + + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + Qt::TextFormat::AutoText + + + :/icons/icons/alert.png + + + true + + + + + + + false + + + Apply only + + + + :/icons/icons/confirm.png:/icons/icons/confirm.png + + + + 25 + 25 + + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + + + + + false + + + Reload + + + + :/icons/icons/refresh.png:/icons/icons/refresh.png + + + + 25 + 25 + + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + + + + + + 0 + 0 + + + + + false + false + false + true + + + + The syntax settings below have changed. Click <strong>Save & apply</strong> to persit the modifications to config file and apply them; <strong>Apply only</strong> to use the modified settings on-the-fly on the current editor without save the changes to the configuration file; or <strong>Reload</strong> to load the file again from the last time that it was saved. <strong>NOTE:</strong> switching to another editor tab will cause all modifications below to be lost. + + + true + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + + + + <p>Instead of loading the configuration file at user's local storage, loads the template one inside the pgModeler's installation folder.</p> + + + Use template configuration file + + + + + + + 0 + + + + XML + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + + + + + DTD + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Choose the syntax highlighting mode + + + Syntax + + + + :/icons/icons/xmlcode.png:/icons/icons/xmlcode.png + + + + 32 + 32 + + + + QToolButton::ToolButtonPopupMode::InstantPopup + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + Qt::ArrowType::NoArrow + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Close all + + + + :/icons/icons/close.png:/icons/icons/close.png + + + + 32 + 32 + + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Save changes to another file + + + Save as + + + + :/icons/icons/saveas.png:/icons/icons/saveas.png + + + + 32 + 32 + + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + + 16777215 + 1 + + + + QFrame::Shadow::Plain + + + Qt::Orientation::Horizontal + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Save all + + + + :/icons/icons/saveall.png:/icons/icons/saveall.png + + + + 32 + 32 + + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + + 16777215 + 1 + + + + QFrame::Shadow::Plain + + + Qt::Orientation::Horizontal + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Open a new editor + + + New + + + + :/icons/icons/new.png:/icons/icons/new.png + + + + 32 + 32 + + + + Ctrl+N + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Exit + + + + :/icons/icons/exit.png:/icons/icons/exit.png + + + + 32 + 32 + + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Save changes + + + Save + + + + :/icons/icons/save.png:/icons/icons/save.png + + + + 32 + 32 + + + + Ctrl+S + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Load files + + + Load + + + + :/icons/icons/open.png:/icons/icons/open.png + + + + 32 + 32 + + + + Ctrl+L + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Apply identation to all open editors + + + Indent all + + + + :/icons/icons/indent.png:/icons/icons/indent.png + + + + 32 + 32 + + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + About + + + + :/icons/icons/help.png:/icons/icons/help.png + + + + 32 + 32 + + + + F1 + + + Qt::ToolButtonStyle::ToolButtonTextUnderIcon + + + true + + + + + + + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + + 169 + 35 + + + + + 169 + 35 + + + + + + + + + + Qt::TextFormat::PlainText + + + :/images/images/pgmodeler_name.png + + + true + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + new_tb + load_tb + save_tb + save_as_tb + save_all_tb + close_all_tb + syntax_tb + indent_all_tb + about_tb + exit_tb + editors_tbw + tabWidget + use_tmpl_file_chk + save_conf_tb + apply_conf_tb + reload_conf_tb + + + + + + diff --git a/apps/pgmodeler-se/ui/sourceeditorwidget.ui b/apps/pgmodeler-se/ui/sourceeditorwidget.ui new file mode 100644 index 0000000000..3e91404e53 --- /dev/null +++ b/apps/pgmodeler-se/ui/sourceeditorwidget.ui @@ -0,0 +1,329 @@ + + + SourceEditorWidget + + + + 0 + 0 + 1212 + 736 + + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + 5 + + + 0 + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Validate the syntax of the schema file + + + Validate + + + + :/icons/icons/validatesch.png:/icons/icons/validatesch.png + + + + 28 + 28 + + + + F5 + + + QToolButton::ToolButtonPopupMode::InstantPopup + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + false + + + Qt::ArrowType::NoArrow + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Apply custom indentation to the code + + + Indent + + + + :/icons/icons/indent.png:/icons/icons/indent.png + + + + 28 + 28 + + + + Ctrl+I + + + QToolButton::ToolButtonPopupMode::MenuButtonPopup + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + false + + + Qt::ArrowType::NoArrow + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Toggles the comments in the current selection + + + Comments + + + + :/icons/icons/comment.png:/icons/icons/comment.png + + + + 28 + 28 + + + + Ctrl+/ + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + false + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Convert metacharacters to escaped and vice-versa + + + Metachars + + + + :/icons/icons/metatoescaped.png:/icons/icons/metatoescaped.png + + + + 28 + 28 + + + + QToolButton::ToolButtonPopupMode::InstantPopup + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + false + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Search + + + + :/icons/icons/findtext.png:/icons/icons/findtext.png + + + + 28 + 28 + + + + Ctrl+F + + + true + + + QToolButton::ToolButtonPopupMode::InstantPopup + + + Qt::ToolButtonStyle::ToolButtonTextBesideIcon + + + false + + + Qt::ArrowType::NoArrow + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + diff --git a/apps/pgmodeler/CMakeLists.txt b/apps/pgmodeler/CMakeLists.txt new file mode 100644 index 0000000000..2c94ee1896 --- /dev/null +++ b/apps/pgmodeler/CMakeLists.txt @@ -0,0 +1,23 @@ +pgm_add_executable(pgmodeler + src/main.cpp + src/pgmodelerapp.cpp src/pgmodelerapp.h) + +pgm_set_default_inc_libs(${PGM_TARGET}) +pgm_inc_priv_core_sources(${PGM_TARGET} OFF) +pgm_install_executable(${PGM_TARGET} OFF) + +# Additional files deployed only on MacOS +if(APPLE) + install(FILES res/Info.plist res/PkgInfo + DESTINATION ${PGM_PREFIX}) + + set(BUNDLE_RES_DIR ${PRIV_PLUGINS_RES}/${PGM_TARGET}/Resources) + + if(PLUS_VERSION AND EXISTS ${BUNDLE_RES_DIR}) + install(DIRECTORY ${BUNDLE_RES_DIR} + DESTINATION ${PGM_PREFIX}) + else() + install(DIRECTORY res/Resources + DESTINATION ${PGM_PREFIX}) + endif() +endif() diff --git a/main/res/Info.plist b/apps/pgmodeler/res/Info.plist similarity index 94% rename from main/res/Info.plist rename to apps/pgmodeler/res/Info.plist index 330902878e..6a51a1b180 100644 --- a/main/res/Info.plist +++ b/apps/pgmodeler/res/Info.plist @@ -25,7 +25,7 @@ CFBundleDisplayName pgModeler CFBundleIdentifier - br.com.pgmodeler.pgModeler + io.pgmodeler.pgModeler CFBundleInfoDictionaryVersion 1.0 CFBundlePackageType @@ -33,7 +33,7 @@ CFBundleSignature ???? CFBundleVersion - 0.8.0 + 1.2.0 CSResourcesFileMapped NSPrincipalClass diff --git a/main/res/PkgInfo b/apps/pgmodeler/res/PkgInfo similarity index 100% rename from main/res/PkgInfo rename to apps/pgmodeler/res/PkgInfo diff --git a/main/res/Resources/empty.lproj b/apps/pgmodeler/res/Resources/empty.lproj similarity index 100% rename from main/res/Resources/empty.lproj rename to apps/pgmodeler/res/Resources/empty.lproj diff --git a/apps/pgmodeler/res/Resources/pgmodeler.icns b/apps/pgmodeler/res/Resources/pgmodeler.icns new file mode 100644 index 0000000000..498163383d Binary files /dev/null and b/apps/pgmodeler/res/Resources/pgmodeler.icns differ diff --git a/apps/pgmodeler/res/Resources/pgmodeler_dbm.icns b/apps/pgmodeler/res/Resources/pgmodeler_dbm.icns new file mode 100644 index 0000000000..e14ed70e9c Binary files /dev/null and b/apps/pgmodeler/res/Resources/pgmodeler_dbm.icns differ diff --git a/apps/pgmodeler/res/pgmodeler.ico b/apps/pgmodeler/res/pgmodeler.ico new file mode 100644 index 0000000000..4abfc78968 Binary files /dev/null and b/apps/pgmodeler/res/pgmodeler.ico differ diff --git a/apps/pgmodeler/res/pgmodeler_dbm.ico b/apps/pgmodeler/res/pgmodeler_dbm.ico new file mode 100644 index 0000000000..b985d79dc5 Binary files /dev/null and b/apps/pgmodeler/res/pgmodeler_dbm.ico differ diff --git a/apps/pgmodeler/res/windows_ico.rc b/apps/pgmodeler/res/windows_ico.rc new file mode 100644 index 0000000000..62d78334f8 --- /dev/null +++ b/apps/pgmodeler/res/windows_ico.rc @@ -0,0 +1,2 @@ + IDI_ICON1 ICON DISCARDABLE "pgmodeler.ico" + IDI_ICON2 ICON DISCARDABLE "pgmodeler_dbm.ico" diff --git a/apps/pgmodeler/src/main.cpp b/apps/pgmodeler/src/main.cpp new file mode 100644 index 0000000000..3d1ac6cb41 --- /dev/null +++ b/apps/pgmodeler/src/main.cpp @@ -0,0 +1,156 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "pgmodelerapp.h" +#include "mainwindow.h" +#include +#include + +#ifdef PRIV_CODE_SYMBOLS + #include "privcoreinit.h" + #include "privcoreclasses.h" +#endif + +#ifndef Q_OS_WIN + #include "execinfo.h" +#endif + +namespace { + void startCrashHandler(int signal) + { + QFile output; + QString lin, cmd; + + /** At the moment the backtrace function does not exists on MingW (Windows) this way + the code that generates the stacktrace is available only on Linux/Unix systems */ + #ifndef Q_OS_WIN + void *stack[30]; + size_t stack_size; + char **symbols=nullptr; + stack_size = backtrace(stack, 30); + symbols = backtrace_symbols(stack, stack_size); + #endif + + cmd=QString("\"%1\"").arg(GlobalAttributes::getPgModelerCHandlerPath()) + " -style " + GlobalAttributes::DefaultQtStyle; + + //Creates the stacktrace file + output.setFileName(GlobalAttributes::getTemporaryFilePath(GlobalAttributes::StacktraceFile)); + output.open(QFile::WriteOnly); + + if(output.isOpen()) + { + lin=QString("** pgModeler crashed after receive signal: %1 **\n\nDate/Time: %2 \nVersion: %3 \nBuild: %4 \n") + .arg(signal) + .arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")) + .arg(GlobalAttributes::PgModelerVersion) + .arg(GlobalAttributes::PgModelerBuildNumber); + + lin+=QString("Compilation Qt version: %1\nRunning Qt version: %2\n\n") + .arg(QT_VERSION_STR) + .arg(qVersion()); + + output.write(lin.toStdString().c_str(), lin.size()); + + #ifndef Q_OS_WIN + for(size_t i=0; i < stack_size; i++) + { + lin=QString("[%1] ").arg(stack_size-1-i) + QString(symbols[i]) + "\n"; + output.write(lin.toStdString().c_str(), lin.size()); + } + free(symbols); + #else + lin = "** Stack trace unavailable on Windows system **"; + output.write(lin.toStdString().c_str(), lin.size()); + #endif + + output.close(); + } + + /* Changing the working dir to the main executable in order to call the crash handler + if the PGMODELER_CHANDLER_PATH isn't set */ + QDir dir; + dir.cd(QApplication::applicationDirPath()); + + exit(1 + system(cmd.toStdString().c_str())); + } +} + +int main(int argc, char **argv) +{ + try + { + //Install a signal handler to start crashhandler when SIGSEGV or SIGABRT is emitted + signal(SIGSEGV, startCrashHandler); + signal(SIGABRT, startCrashHandler); + + GlobalAttributes::init(argv[0], true); + PgModelerApp app(argc,argv); + int res=0; + + // Loading the application splash screen + QSplashScreen splash; + QPixmap pix(":images/images/pgmodeler_splash.png"); + + if(qApp->primaryScreen()->devicePixelRatio() > 1) + pix.setDevicePixelRatio(qApp->primaryScreen()->devicePixelRatio()); + else + pix = pix.scaledToWidth(320, Qt::SmoothTransformation); + + splash.setPixmap(pix); + splash.show(); + splash.raise(); + app.processEvents(); + + //Creates the main form + MainWindow fmain; + + #ifdef PRIV_CODE_SYMBOLS + __pgm_plus_gui_init + #endif + + // Displaying the splash for one and a half second after displaying the main window + QTimer::singleShot(1500, &splash, [&splash, &fmain]() { + fmain.show(); + splash.finish(&fmain); + }); + + //Loading models via command line on MacOSX are disabled until the file association work correclty on that system + #ifndef Q_OS_MACOS + QStringList params = app.arguments(); + params.pop_front(); + + //If the user specifies a list of files to be loaded + if(!params.isEmpty()) + fmain.loadModels(params); + #endif + + res = app.exec(); + app.closeAllWindows(); + + return res; + } + catch(Exception &e) + { + QTextStream ts(stdout); + ts << e.getExceptionsText(); + return enum_t(e.getErrorCode()); + } +} diff --git a/apps/pgmodeler/src/pgmodelerapp.cpp b/apps/pgmodeler/src/pgmodelerapp.cpp new file mode 100644 index 0000000000..af934894c8 --- /dev/null +++ b/apps/pgmodeler/src/pgmodelerapp.cpp @@ -0,0 +1,88 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ +#include "pgmodelerapp.h" +#include "globalattributes.h" +#include "messagebox.h" +#include "attributes.h" +#include + +PgModelerApp::PgModelerApp(int &argc, char **argv) : Application(argc,argv) +{ + QDir dir; + + try + { + //Creating the initial user's configuration + createUserConfiguration(); + } + catch(Exception &e) + { + Messagebox::error(e, PGM_FUNC, PGM_FILE, PGM_LINE); + } + + //Changing the current working dir to the executable's directory in + QDir::setCurrent(this->applicationDirPath()); + + //Adding paths which executable will find plugins and it's dependecies + this->addLibraryPath(this->applicationDirPath()); + + //If pgModeler bundles plugins, add the root plugins path to lib search paths + if(dir.exists(GlobalAttributes::getPluginsPath())) + this->addLibraryPath(GlobalAttributes::getPluginsPath()); + + //Check if the temporary dir exists, if not, creates it. + if(!dir.exists(GlobalAttributes::getTemporaryPath())) + { + if(!dir.mkdir(GlobalAttributes::getTemporaryPath())) + { + Messagebox msg; + msg.show(Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(GlobalAttributes::getTemporaryPath()), + ErrorCode::FileDirectoryNotWritten, PGM_FUNC,PGM_FILE,PGM_LINE)); + } + } + + //Trying to identify if the user defined a custom UI language in the pgmodeler.conf file + QString lang_id = GlobalAttributes::getConfigParamFromFile(Attributes::UiLanguage, GlobalAttributes::GeneralConf); + + if(lang_id.isEmpty()) + lang_id = QLocale::system().name(); + + loadTranslations(lang_id, true); +} + +bool PgModelerApp::notify(QObject *receiver, QEvent *event) +{ + try + { + return QApplication::notify(receiver,event); + } + catch(Exception &e) + { + Messagebox::error(e, PGM_FUNC, PGM_FILE, PGM_LINE); + return false; + } + catch(...) + { + Messagebox::error(tr("Unknown exception caught!"), ErrorCode::Custom, + PGM_FUNC, PGM_FILE, PGM_LINE); + return false; + } +} diff --git a/apps/pgmodeler/src/pgmodelerapp.h b/apps/pgmodeler/src/pgmodelerapp.h new file mode 100644 index 0000000000..93aa379cfb --- /dev/null +++ b/apps/pgmodeler/src/pgmodelerapp.h @@ -0,0 +1,45 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# (c) Copyright 2006-2026 - Raphael Araújo e Silva +# +# DEVELOPMENT, MAINTENANCE AND COMMERCIAL DISTRIBUTION BY: +# Nullptr Labs Software e Tecnologia LTDA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup pgmodeler +\class PgModelerApp +\brief This class inherits from QApplication and has the notify() method modified + to treat the exceptions raised by pgModeler components. +*/ + +#ifndef PGMODELER_APP_H +#define PGMODELER_APP_H + +#include "application.h" +#include +#include +#include + +class PgModelerApp: public Application { + Q_OBJECT + + public: + PgModelerApp(int & argc, char ** argv); + bool notify(QObject *receiver, QEvent *event) override; +}; + +#endif diff --git a/assets/conf/appearance.conf b/assets/conf/appearance.conf new file mode 100644 index 0000000000..0ec819b946 --- /dev/null +++ b/assets/conf/appearance.conf @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/connections.conf b/assets/conf/connections.conf similarity index 100% rename from conf/connections.conf rename to assets/conf/connections.conf diff --git a/assets/conf/diff-presets.conf b/assets/conf/diff-presets.conf new file mode 100644 index 0000000000..923f6a958f --- /dev/null +++ b/assets/conf/diff-presets.conf @@ -0,0 +1,28 @@ + + + + + diff --git a/assets/conf/dtd/appearance.dtd b/assets/conf/dtd/appearance.dtd new file mode 100644 index 0000000000..98e67cfca2 --- /dev/null +++ b/assets/conf/dtd/appearance.dtd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/dtd/connections.dtd b/assets/conf/dtd/connections.dtd similarity index 96% rename from conf/dtd/connections.dtd rename to assets/conf/dtd/connections.dtd index f3d167573c..5da900c26e 100644 --- a/conf/dtd/connections.dtd +++ b/assets/conf/dtd/connections.dtd @@ -3,7 +3,6 @@ Unexpected results may occur if the code is changed deliberately. --> - @@ -20,6 +19,7 @@ + diff --git a/assets/conf/dtd/diff-presets.dtd b/assets/conf/dtd/diff-presets.dtd new file mode 100644 index 0000000000..117e3bc200 --- /dev/null +++ b/assets/conf/dtd/diff-presets.dtd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/conf/dtd/general.dtd b/assets/conf/dtd/general.dtd new file mode 100644 index 0000000000..03e1cc125b --- /dev/null +++ b/assets/conf/dtd/general.dtd @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/conf/dtd/relationships.dtd b/assets/conf/dtd/relationships.dtd new file mode 100644 index 0000000000..0cf5587ab8 --- /dev/null +++ b/assets/conf/dtd/relationships.dtd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/dtd/snippets.dtd b/assets/conf/dtd/snippets.dtd similarity index 86% rename from conf/dtd/snippets.dtd rename to assets/conf/dtd/snippets.dtd index 56ec1c01a9..cd4831a649 100644 --- a/conf/dtd/snippets.dtd +++ b/assets/conf/dtd/snippets.dtd @@ -13,5 +13,5 @@ + extension|eventtrigger|general|policy|foreigndatawrapper|foreignserver|usermapping) "general"> diff --git a/assets/conf/dtd/source-code-highlight.dtd b/assets/conf/dtd/source-code-highlight.dtd new file mode 100644 index 0000000000..db73222784 --- /dev/null +++ b/assets/conf/dtd/source-code-highlight.dtd @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/dtd/sql-history.dtd b/assets/conf/dtd/sql-history.dtd similarity index 100% rename from conf/dtd/sql-history.dtd rename to assets/conf/dtd/sql-history.dtd diff --git a/assets/conf/dtd/theme.dtd b/assets/conf/dtd/theme.dtd new file mode 100644 index 0000000000..fea41c2f4b --- /dev/null +++ b/assets/conf/dtd/theme.dtd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/assets/conf/example.dbm b/assets/conf/example.dbm new file mode 100644 index 0000000000..a3b6061a6e --- /dev/null +++ b/assets/conf/example.dbm @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + ] \n +%end + + \n + \n \ No newline at end of file diff --git a/assets/schemas/datadict/html/index.sch b/assets/schemas/datadict/html/index.sch new file mode 100644 index 0000000000..4fffad47d5 --- /dev/null +++ b/assets/schemas/datadict/html/index.sch @@ -0,0 +1,16 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n \s + +{spc} +{spc} {name} +{spc} {type} +{spc} {columns} +{spc}

{expressions}

+{spc}

{predicate}

+{spc}

{comment}

+ + +{spc} diff --git a/assets/schemas/datadict/html/item.sch b/assets/schemas/datadict/html/item.sch new file mode 100644 index 0000000000..8adf1895c9 --- /dev/null +++ b/assets/schemas/datadict/html/item.sch @@ -0,0 +1,11 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {split} %then + %set {link} {item} [.html] +%else + %set {link} \# {item} +%end + +\n \s
  • {item}
  • diff --git a/assets/schemas/datadict/html/link.sch b/assets/schemas/datadict/html/link.sch new file mode 100644 index 0000000000..f97562f3ec --- /dev/null +++ b/assets/schemas/datadict/html/link.sch @@ -0,0 +1,11 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {split} %then + %set {link} {name} [.html] +%else + %set {link} \# {name} +%end + + {name} diff --git a/assets/schemas/datadict/html/navigation.sch b/assets/schemas/datadict/html/navigation.sch new file mode 100644 index 0000000000..eb9b26bcaa --- /dev/null +++ b/assets/schemas/datadict/html/navigation.sch @@ -0,0 +1,25 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {datadictidx} %then + \n
    + + %if {split} %and {previous} %then + {spc} [←] \s {previous} + %end + + %if {split} %then + \n [ ] + %else + \n [ ] + %end + + [ ↑ Index ] + + %if {split} %and {next} %then + {spc} {next} \s [→] + %end + + \n
    \n +%end diff --git a/assets/schemas/datadict/html/objects.sch b/assets/schemas/datadict/html/objects.sch new file mode 100644 index 0000000000..f0cda20c46 --- /dev/null +++ b/assets/schemas/datadict/html/objects.sch @@ -0,0 +1,112 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n \s + +%if ({type-class} == "table") %then + %set {colspan} 8 +%else + %set {colspan} 5 +%end + +%if {columns} %then + {columns} +%end + +%if {constraints} %then + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + + {constraints} + + {spc}
    Constraints
    Name Type Column(s) References On \s Update On \s Delete Expression Description
    + {spc} + {spc} +%end + +%if {indexes} %then + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + + {indexes} + + {spc}
    Indexes
    Name Type Column(s) Expression(s) Predicate Description
    + {spc} + {spc} +%end + +%if {triggers} %then + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + + {triggers} + + {spc}
    Triggers
    Name Attributes Function [Firing mode] [On event(s)] [Per row] Condition References Description
    + {spc} + {spc} +%end + +%if {sequences} %then + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + {spc} + + {sequences} + + {spc}
    Sequences
    Name Cyclic [Min. value] [Max. value] Column(s) Description
    + {spc} + {spc} +%end \ No newline at end of file diff --git a/assets/schemas/datadict/html/sequence.sch b/assets/schemas/datadict/html/sequence.sch new file mode 100644 index 0000000000..50cd9b0a15 --- /dev/null +++ b/assets/schemas/datadict/html/sequence.sch @@ -0,0 +1,15 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n \s + +{spc} +{spc} {name} +{spc} {cycle} +{spc} {min-value} +{spc} {max-value} +{spc} {columns} +{spc}

    {comment}

    + +{spc} diff --git a/assets/schemas/datadict/html/styles.sch b/assets/schemas/datadict/html/styles.sch new file mode 100644 index 0000000000..e0ea5f39e5 --- /dev/null +++ b/assets/schemas/datadict/html/styles.sch @@ -0,0 +1,224 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[body { +font-family: sans-serif; +color: #333; +margin-left: 2em; +margin-top: 2em; +background-color: white; +} + +footer { +margin-top: 3em; +margin-bottom: .5em; +font-size: 90%; +} + +h3 { +margin-bottom: .5em; +} + +a { +color: #4182c3; +text-decoration: none; +} + +a:hover { +color: #080; +text-decoration: underline; +} + +#index { +background-color: #f8f9fa; +margin-block-end: 1.5em; +list-style: none; +display: inline-block; +padding: 1em; +border: 1px solid #c0c0c0; +border-radius: 4px 4px 4px 4px; +} + +#index li { +list-style: none; +margin: 0; +} + +#index > li > ul { +padding-inline-start: 1em; +} + +.table, .foreigntable, .view { +font-size: 11pt; +border-collapse: collapse; +margin-top: 3em; +margin-bottom: 1em; +page-break-inside: avoid; +} + +.table caption { +background-color: #d2f3ff; +} + +.foreigntable caption { +background-color: #94f0b1; +} + +.view caption { +background-color: #ffd8a1; +} + +.table, +.table caption, +.table th, +.table td { +border: 1px solid #b4d0da; +} + +.foreigntable, +.foreigntable caption, +.foreigntable th, +.foreigntable td { +border: 1px solid #6aad80; +} + +.view, +.view caption, +.view th, +.view td { +border: 1px solid #ba7c00; +} + +.table caption, +.foreigntable caption, +.view caption { +border-bottom: 0; +} + +.table th, +.table .title, +.table .label{ +background-color: #e9f8ff; +} + +.foreigntable th, +.foreigntable .title, +.foreigntable .label { +background-color: #e2ffed; +} + +.view th, +.view .title, +.view .label { +background-color: #ffebd2; +} + +.type-label { +float: right; +color: #212529; +font-size: 70%; +font-weight: bold; +background-color: #f8f9fa; +padding: 5px; +border-radius: 4px 4px 4px 4px; +} + +caption { +border-radius: 5px 5px 0 0; +} + +.nav-link { +font-size: 85%; +background-color: #f2f2f3; +padding: 5px; +border-radius: 4px 4px 4px 4px; +color: #212529; +font-weight: bold; +text-decoration: none; +margin-right: .5em; +} + +.nav-link:hover { +color: white; +background-color: #007bff; +} + +td, th, caption, .title { +margin: 0; +padding: .3em; +} + +.title, th { +font-weight: bold; +text-align: center; +color: #535c67; +} + +.data-type, .value, .constr-type { +font-family: monospace; +text-align: center; +} + +.constr-type { +color: #24486c; +} + +.data-type { +color: #b00; +} + +.bool-field { +text-align: center; +color: #080; +} + +.label { +font-weight: bold; +color: #444f53; +width: 1px; +white-space: nowrap; +} + +.tab-name { +font-size: 112%; +} + +.tab-description { +font-style: italic; +padding: .5em; +} + +.nested-tab-parent { +padding: 0; +} + +.nested-tab { +font-size: 11pt; +width: 100%; +border-collapse: collapse; +} + +.nested-tab > tbody > tr, +.nested-tab > tr{ +padding: 0; +} + +.nested-tab td { +border-bottom: 0; +border-left: 0; +} + +.nested-tab > tbody > tr:first-child td, +.nested-tab > tr:first-child td { +border-top: 0; +} + +.nested-tab td:last-child { +border-right: 0; +} + +.max-td-wth { +max-width: 500px; +} + +] diff --git a/assets/schemas/datadict/html/table.sch b/assets/schemas/datadict/html/table.sch new file mode 100644 index 0000000000..6f613e2b03 --- /dev/null +++ b/assets/schemas/datadict/html/table.sch @@ -0,0 +1,96 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if ({type-class} == "table") %then + %set {colspan} 8 +%else + %set {colspan} 5 +%end + +%set {spc} \n \s + + + +{spc} +{spc} + +%if {comment} %then + {spc} + {spc} + {spc} +%end + +%if {columns} %then + {spc} + {spc} + {spc} + + %if ({type-class} == "table") %then + {spc} + {spc} + {spc} + %end + + {spc} + {spc} + {spc} + {spc} +%else + {spc} + {spc} + {spc} +%end + +{spc} +{spc} + +%if {objects} %then + {objects} +%end + +{spc} + +%if {inherit} %or {partitioned-table} %or {partition-tables} %then + {spc} + {spc} + {spc} + {spc} + {spc} \n +%end + +\n
    +{spc} {schema} . {name} +{spc} {type} +{spc}
    + {comment} + {spc}
    Name [Data type] PK FK UQ [Not null] [Default value] Description
    + {spc} [No columns] + {spc}
    + {spc} + + %if {inherit} %then + {spc} + {spc} + {spc} + {spc} + %end + + %if {partitioned-table} %then + {spc} + {spc} + {spc} + {spc} + %end + + %if {partition-tables} %then + {spc} + {spc} + {spc} + {spc} + %end + + {spc}
    Inherits: {inherit}
    [Partition of:] {partitioned-table}
    [Partitions:] {partition-tables}
    + {spc}
    \n + +@include "navigation" diff --git a/assets/schemas/datadict/html/trigger.sch b/assets/schemas/datadict/html/trigger.sch new file mode 100644 index 0000000000..454fd8327f --- /dev/null +++ b/assets/schemas/datadict/html/trigger.sch @@ -0,0 +1,29 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n \s + +{spc} +{spc} {name} +{spc} {attributes} +{spc} {function} +{spc} {firing-type} +{spc} {events} +{spc} {per-line} +{spc}

    {condition}

    + +{spc} + %if {ref-table} %then + %if {split} %then + {ref-table} + %else + {ref-table} + %end + %end +{spc} + +{spc}

    {comment}

    + + +{spc} diff --git a/assets/schemas/datadict/html/view.sch b/assets/schemas/datadict/html/view.sch new file mode 100644 index 0000000000..00f4d0df8d --- /dev/null +++ b/assets/schemas/datadict/html/view.sch @@ -0,0 +1,62 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n \s + + +{spc} +{spc} + +%if {comment} %then + {spc} + {spc} + {spc} +%end + +%if {columns} %then + {spc} + {spc} + {spc} + {spc} +%else + {spc} + {spc} + {spc} +%end + +{spc} +{spc} + +%if {objects} %then + {objects} +%end + +{spc} + + +%if {references} %then + {spc} + {spc} + {spc} + {spc} + {spc} \n +%end + +\n
    +{spc} {schema} . {name} +{spc} {type} +{spc}
    + {comment} + {spc}
    Name [Data type]
    + {spc} [No columns] + {spc}
    + {spc} + {spc} + {spc} + {spc} + {spc} + {spc}
    References: {references}
    + {spc}
    \n + +@include "navigation" diff --git a/assets/schemas/datadict/md/column.sch b/assets/schemas/datadict/md/column.sch new file mode 100644 index 0000000000..d4a5932822 --- /dev/null +++ b/assets/schemas/datadict/md/column.sch @@ -0,0 +1,19 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[| ] {name} [ | ] {type} + +%if ({parent} != "view") %then + %if ({parent} == "table") %then + [ | ] {pk-constr} + [ | ] {fk-constr} + [ | ] {uq-constr} + %end + + [ | ] {not-null} + [ | ] {default-value} + [ | ] {comment} +%end + +[ |] \n diff --git a/assets/schemas/datadict/md/constraint.sch b/assets/schemas/datadict/md/constraint.sch new file mode 100644 index 0000000000..a35127b970 --- /dev/null +++ b/assets/schemas/datadict/md/constraint.sch @@ -0,0 +1,29 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[| ] {name} [ | ] {type} [ | ] {columns} [ | ] + +%if {ref-table} %then + %if {split} %then + \[ {ref-table} \] ({ref-table}.md) + %else + \[ {ref-table} \] (\# {ref-table}) + %end +%end + +[ | ] + +%if ({type} != "FOREIGN KEY") %then + [ | ] +%else + {upd-action} [ | ] {del-action} +%end + +[ | ] + +%if ({type} == "CHECK") %then + {expression} +%end + +[ | ] {comment} [ |] \n diff --git a/assets/schemas/datadict/md/datadict.sch b/assets/schemas/datadict/md/datadict.sch new file mode 100644 index 0000000000..d6e8c55bbd --- /dev/null +++ b/assets/schemas/datadict/md/datadict.sch @@ -0,0 +1,15 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if %not {split} %and {datadictidx} %then + \#\#\s [Data dictionary generated by pgModeler] \n + + {datadictidx} + + \n --- \n +%end + +{objects} + +@include "footer" diff --git a/assets/schemas/datadict/md/datadictidx.sch b/assets/schemas/datadict/md/datadictidx.sch new file mode 100644 index 0000000000..143eef91e0 --- /dev/null +++ b/assets/schemas/datadict/md/datadictidx.sch @@ -0,0 +1,27 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n\#\#\#\s + +\n [] +{spc} [Database: ] {name} \n + +%if {table} %then + {spc} Tables \n + {table} +%end + +%if {foreigntable} %then + {spc} [Foreign tables] \n + {foreigntable} +%end + +%if {view} %then + {spc} Views \n + {view} +%end + +%if {split} %then + @include "footer" +%end diff --git a/assets/schemas/datadict/md/footer.sch b/assets/schemas/datadict/md/footer.sch new file mode 100644 index 0000000000..c9a825860e --- /dev/null +++ b/assets/schemas/datadict/md/footer.sch @@ -0,0 +1,7 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +\n [Generated at ] _{date}_ [ by **pgModeler ] {version} ** \n +\[ [PostgreSQL Database Modeler - pgmodeler.io ] \] (https://pgmodeler.io) \n +[Copyright © 2006 - ] {year} [ Raphael Araújo e Silva ] \n \ No newline at end of file diff --git a/assets/schemas/datadict/md/index.sch b/assets/schemas/datadict/md/index.sch new file mode 100644 index 0000000000..6e8807712e --- /dev/null +++ b/assets/schemas/datadict/md/index.sch @@ -0,0 +1,5 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[| ] {name} [ | ] {type} [ | ] {columns} [ | ] {expressions} [ | ] {predicate} [ | ] {comment} [ |] \n diff --git a/assets/schemas/datadict/md/item.sch b/assets/schemas/datadict/md/item.sch new file mode 100644 index 0000000000..f2b05b91e1 --- /dev/null +++ b/assets/schemas/datadict/md/item.sch @@ -0,0 +1,11 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {split} %then + %set {link} {item} [.md] +%else + %set {link} \# {item} +%end + +* \s \[ {item} \] ({link}) \n diff --git a/assets/schemas/datadict/md/link.sch b/assets/schemas/datadict/md/link.sch new file mode 100644 index 0000000000..833a2947f1 --- /dev/null +++ b/assets/schemas/datadict/md/link.sch @@ -0,0 +1,11 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {split} %then + %set {link} {name} [.md] +%else + %set {link} \# {name} +%end + +\[ {name} \] ({link}) \ No newline at end of file diff --git a/assets/schemas/datadict/md/navigation.sch b/assets/schemas/datadict/md/navigation.sch new file mode 100644 index 0000000000..c7083e1d46 --- /dev/null +++ b/assets/schemas/datadict/md/navigation.sch @@ -0,0 +1,25 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {datadictidx} %then + \n + + %if {split} %and {previous} %then + \[ \← \s {previous} \] ({previous}.md) \n + %end + + \[ \↑ \s Index \] ( + %if {split} %then + index.md + %else + \# index + %end + ) \n + + %if {split} %and {next} %then + \[ {next} \s \→ \] ({next}.md) \n + %end +%end + +\n --- \n \ No newline at end of file diff --git a/assets/schemas/datadict/md/objects.sch b/assets/schemas/datadict/md/objects.sch new file mode 100644 index 0000000000..d84f7ad7a5 --- /dev/null +++ b/assets/schemas/datadict/md/objects.sch @@ -0,0 +1,48 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {spc} \n\#\#\#\#\s +%set {colsdiv} [ --- | --- | --- |] +%set {t6cols} [| ] {colsdiv} {colsdiv} \n +%set {t8cols} [| ] {colsdiv} {colsdiv} [ --- | --- |] \n + +%if {columns} %then + {columns} +%end + +%if {constraints} %then + {spc} Constraints \n + + [| Name | Type | Column(s) | References | On Update | On Delete | Expression | Description |] \n + {t8cols} + + {constraints} +%end + +%if {indexes} %then + {spc} Indexes \n + + [| Name | Type | Column(s) | Expression(s) | Predicate | Description |] \n + {t6cols} + + {indexes} +%end + +%if {triggers} %then + {spc} Triggers \n + + [| Name | Attributes | Function | Firing mode | On event(s) | Per row | Condition | References | Description |] \n + [| ] {colsdiv} [ --- | --- | :---: |] {colsdiv} \n + + {triggers} +%end + +%if {sequences} %then + {spc} Sequences \n + + [| Name | Cyclic | Min. value | Max. value | Column(s) | Description |] \n + [| --- | :---: | --- |] {colsdiv} \n + + {sequences} +%end \ No newline at end of file diff --git a/assets/schemas/datadict/md/sequence.sch b/assets/schemas/datadict/md/sequence.sch new file mode 100644 index 0000000000..7bc5cdcff1 --- /dev/null +++ b/assets/schemas/datadict/md/sequence.sch @@ -0,0 +1,5 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[| ] {name} [ | ] {cycle} [ | ] {min-value} [ | ] {max-value} [ | ] {columns} [ | ] {comment} [ |] \n diff --git a/assets/schemas/datadict/md/table.sch b/assets/schemas/datadict/md/table.sch new file mode 100644 index 0000000000..3ca0d2443a --- /dev/null +++ b/assets/schemas/datadict/md/table.sch @@ -0,0 +1,50 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +\n [] \n +\#\#\#\s _{schema}_.**{name}** \s `{type}` \n + +%if {comment} %then + \n {comment} \n\n +%end + +[| Name | Data type ] + +%if {columns} %then + + %if ({type-class} == "table") %then + [ | PK | FK | UQ ] + %end + + [ | Not null | Default value | Description |] \n + [| --- | --- | :---: | :---: | :---: | :---: | --- | --- |] \n +%else + [ | No columns | ] \n + [| --- | --- | --- |] \n +%end + +%if {objects} %then + {objects} +%end + +%if {inherit} %or {partitioned-table} %or {partition-tables} %then + \n\#\#\#\#\s Inhiritances [ & ] Partitions \n + + \n [| | Tables |] \n + [| --- | --- |] \n + + %if {inherit} %then + [| Inherits: | ] {inherit} [ |] \n + %end + + %if {partitioned-table} %then + [| Partition of: | ] {partitioned-table} [ |] \n + %end + + %if {partition-tables} %then + [| Partition(s): | ] {partition-tables} [ |] \n + %end +%end + +@include "navigation" diff --git a/assets/schemas/datadict/md/trigger.sch b/assets/schemas/datadict/md/trigger.sch new file mode 100644 index 0000000000..24d1cdc119 --- /dev/null +++ b/assets/schemas/datadict/md/trigger.sch @@ -0,0 +1,17 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[| ] {name} [ | ] {attributes} [ | ] {function} [ | ] {firing-type} + +[ | ] {events} [ | ] {per-line} [ | ] {condition} [ | ] + +%if {ref-table} %then + %if {split} %then + \[ {ref-table} \] ({ref-table}.md) + %else + \[ {ref-table} \] (\# {ref-table}) + %end +%end + +[ | ] {comment} [ |] \n diff --git a/assets/schemas/datadict/md/view.sch b/assets/schemas/datadict/md/view.sch new file mode 100644 index 0000000000..087536f757 --- /dev/null +++ b/assets/schemas/datadict/md/view.sch @@ -0,0 +1,32 @@ +# Template code for data dictionary generation +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +\n [] \n +\#\#\#\s _{schema}_.**{name}** \s `{type}` \n + +%if {comment} %then + \n {comment} \n\n +%end + +%if {columns} %then + [| Name | Data type ] \n + [| --- | --- |] \n +%else + [ | No columns | ] \n + [ | --- |] \n +%end + +%if {objects} %then + {objects} +%end + +%if {references} %then + \n\#\#\#\#\s References \n + + \n [| Tables |] \n + [| --- |] \n + [| ] {references} [ |] \n +%end + +@include "navigation" diff --git a/assets/schemas/sql/aggregate.sch b/assets/schemas/sql/aggregate.sch new file mode 100644 index 0000000000..9bd645ad92 --- /dev/null +++ b/assets/schemas/sql/aggregate.sch @@ -0,0 +1,17 @@ +# SQL definition for aggregate functions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OR REPLACE AGGREGATE ] {name} [ (]{types}[) (] $br +$tb [SFUNC = ] {transition}, $br +$tb [STYPE = ] {state-type} $br +%if {final} %then $tb [,FINALFUNC = ] {final} $br %end +%if {initial-cond} %then $tb [,INITCOND = ] {initial-cond} $br %end +%if {sort-op} %then $tb [,SORTOP = ] {sort-op} $br %end +); + +@include "footer" diff --git a/assets/schemas/sql/cast.sch b/assets/schemas/sql/cast.sch new file mode 100644 index 0000000000..8abcb4533c --- /dev/null +++ b/assets/schemas/sql/cast.sch @@ -0,0 +1,27 @@ +# SQL definition for type casts +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE CAST (] {source-type} [ AS ] {destiny-type} ) $br + +%if {io-cast} %then + $tb [WITH INOUT ] +%else + %if {function} %then + $tb [WITH FUNCTION ] {function} + %else + $tb [WITHOUT FUNCTION] + %end +%end + +%if {cast-type} %then + $br $tb [AS ] {cast-type} +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/collation.sch b/assets/schemas/sql/collation.sch new file mode 100644 index 0000000000..daed0383fe --- /dev/null +++ b/assets/schemas/sql/collation.sch @@ -0,0 +1,72 @@ +# SQL definition for collations +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +%set {attr-sep} [,] $br + +[CREATE COLLATION ] {name} + +%if {collation} %then + [ FROM ] {collation} +%else + [ (] $br + + %if {locale} %then + [ LOCALE = '] + + {locale} + + %if {locale-mod} %then + @ {locale-mod} + %end + + ['] + %else + %if {lc-ctype} %then + [ LC_CTYPE = '] + + {lc-ctype} + + %if {lc-ctype-mod} %then + @ {lc-ctype-mod} + %end + + ['] + %end + + %if {lc-collate} %then + %if {lc-ctype} %then {attr-sep} %end + [ LC_COLLATE = '] + + {lc-collate} + + %if {lc-collate-mod} %then + @ {lc-collate-mod} + %end + + ['] + %end + %end + + %if ({pgsql-ver} >=f "10.0") %then + %if {provider} %then + %if {locale} %or {lc-collate} %or {lc-ctype} %then {attr-sep} %end + [ PROVIDER =] '{provider}' + %end + %end + + %if ({pgsql-ver} >=f "12.0") %then + %if {locale} %or {lc-collate} %or {lc-ctype} %or {provider} %then {attr-sep} %end + [ DETERMINISTIC = ] {deterministic} + %end + + $br [)] +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/column.sch b/assets/schemas/sql/column.sch new file mode 100644 index 0000000000..9bb6605c8a --- /dev/null +++ b/assets/schemas/sql/column.sch @@ -0,0 +1,83 @@ +# SQL definition for columns +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" + +%if {decl-in-table} %then + $tb +%else + [-- object: ] {name} [ | type: ] {sql-object} [ --] $br + + %if {table} %then + [ALTER TABLE ] {table} [ ADD COLUMN ] + %end +%end + +{name} $sp {type} + +%if {collation} %then + [ COLLATE ] {collation} +%end + +%if {not-null} %then + [ NOT NULL] +%end + +%if {identity-type} %then + [ GENERATED ] {identity-type} [ AS IDENTITY ] + + %if {increment} %or {min-value} %or {max-value} %or {start} %or {cache} %or {cycle} %then + [(] + %end + + %if {increment} %then + [ INCREMENT BY ] {increment} + %end + + %if {min-value} %then + [ MINVALUE ] {min-value} + %end + + %if {max-value} %then + [ MAXVALUE ] {max-value} + %end + + %if {start} %then + [ START WITH ] {start} + %end + + %if {cache} %then + [ CACHE ] {cache} + %end + + %if {cycle} %then + [ CYCLE] + %end + + %if {increment} %or {min-value} %or {max-value} %or {start} %or {cache} %or {cycle} %then + [ )] + %end +%else + %if ({pgsql-ver} >=f "12.0") %and {generated} %then + [ GENERATED ALWAYS AS (] {default-value} [) STORED] + %else + %if {default-value} %then + [ DEFAULT ] {default-value} + %end + %end +%end + +%if {decl-in-table} %then + [,] +%else + [;] + + {ddl-end} $br +%end + +%if %not {decl-in-table} %and {comment} %then + {comment} $br +%end + +$br diff --git a/assets/schemas/sql/comment.sch b/assets/schemas/sql/comment.sch new file mode 100644 index 0000000000..a3347f4a11 --- /dev/null +++ b/assets/schemas/sql/comment.sch @@ -0,0 +1,29 @@ +# SQL definition for comments +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if ({obj-type} != "genericsql") %and {comment} %or ({comment}=="unset") %then + @include "ddlend" + + [COMMENT ON ] {sql-object} $sp + + %if ({sql-object}=="CONSTRAINT") %or ({sql-object}=="TRIGGER") %or + ({sql-object}=="RULE") %or ({sql-object}=="POLICY") %then + {name} [ ON ] {table} + %else + {signature} + %end + + [ IS ] + + %if ({comment}=="unset") %then + '' + %else + %if {escape-comment} %then E %end + '{comment}' + %end + + ; + + {ddl-end} +%end diff --git a/assets/schemas/sql/confparam.sch b/assets/schemas/sql/confparam.sch new file mode 100644 index 0000000000..47ef58b327 --- /dev/null +++ b/assets/schemas/sql/confparam.sch @@ -0,0 +1,5 @@ +# SQL definition for functions/procedures configuration parameters definition +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb [SET ] {name} [ = ] {value} $br diff --git a/assets/schemas/sql/constraint.sch b/assets/schemas/sql/constraint.sch new file mode 100644 index 0000000000..972da63ed3 --- /dev/null +++ b/assets/schemas/sql/constraint.sch @@ -0,0 +1,93 @@ +# SQL definition for constraints +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {decl-in-table} %then + $tb +%else + @include "ddlend" + + [-- object: ] {name} [ | type: ] {sql-object} [ --] $br + + %if {table} %then + [-- ] {drop} + [ALTER TABLE ] {table} [ ADD ] + %end +%end + +[CONSTRAINT ] {name} + +%if {ck-constr} %then + [ CHECK ] ({expression}) + + %if {no-inherit} %then [ NO INHERIT] %end + +%end + +%if {pk-constr} %then [ PRIMARY KEY ] ({src-columns}) %end + +%if {uq-constr} %then + [ UNIQUE ] + + %if ({pgsql-ver} >=f "15.0") %and {nulls-not-distinct} %then + [NULLS NOT DISTINCT ] + %end + + ({src-columns}) +%end + +%if {ex-constr} %then + [ EXCLUDE ] $br + $tb + + %if {index-type} %then + [USING ] {index-type} + %end + + ( {elements} $br $tb ) +%end + +%if {pk-constr} %or {uq-constr} %then + %if {factor} %then + %if {decl-in-table} %then $br $tb %end + [ WITH (FILLFACTOR = ] {factor} [)] + %end +%end + +%if {tablespace} %then + $br + %if {decl-in-table} %then $tb %end + %if {pk-constr} %or {uq-constr} %or {ex-constr} %then [USING INDEX TABLESPACE ] {tablespace} %end +%end + +%if {ex-constr} %and {expression} %then + $sp WHERE $sp ( {expression}) +%end + +%if {fk-constr} %then + [ FOREIGN KEY ] ({src-columns}) $br + + %if {decl-in-table} %then $tb %end + [REFERENCES ] {ref-table} $sp ({dst-columns}) + $sp {comparison-type} $br + + %if {decl-in-table} %then $tb %end + [ON DELETE ] {del-action} [ ON UPDATE ] {upd-action} +%end + +%if {deferrable} %then + [ DEFERRABLE ] {defer-type} +%end + +%if {decl-in-table} %then + [,] +%else + [;] + + {ddl-end} +%end + +%if %not {decl-in-table} %and {comment} %then + {comment} $br +%end + +$br diff --git a/assets/schemas/sql/conversion.sch b/assets/schemas/sql/conversion.sch new file mode 100644 index 0000000000..40e8379094 --- /dev/null +++ b/assets/schemas/sql/conversion.sch @@ -0,0 +1,15 @@ +# SQL definition for encoding conversions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +CREATE %if {default} %then [ DEFAULT] %end + +[ CONVERSION ] {name} $br +$tb [FOR ] '{src-encoding}' [ TO ] '{dst-encoding}' $br +$tb [FROM ] {function}; + +@include "footer" \ No newline at end of file diff --git a/assets/schemas/sql/database.sch b/assets/schemas/sql/database.sch new file mode 100644 index 0000000000..79d5059a2c --- /dev/null +++ b/assets/schemas/sql/database.sch @@ -0,0 +1,48 @@ +# SQL definition for databases +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE DATABASE ] {name} + +%if {template} %then + $br $tb [TEMPLATE = ] {template} +%end + +%if {encoding} %then + $br $tb [ENCODING = ] {encoding} +%end + +%if {lc-collate} %then + $br $tb [LC_COLLATE = ] {lc-collate} +%end + +%if {lc-ctype} %then + $br $tb [LC_CTYPE = ] {lc-ctype} +%end + +%if {tablespace} %then + $br $tb [TABLESPACE = ] {tablespace} +%end + +%if {owner} %then + $br $tb [OWNER = ] {owner} +%end + +%if {connlimit} %then + $br $tb [CONNECTION LIMIT = ] {connlimit} +%end + +%if ({is-template} == "true") %then + $br $tb [IS_TEMPLATE = ] {is-template} +%end + +%if ({allow-conns} == "false") %then + $br $tb [ALLOW_CONNECTIONS = ] {allow-conns} +%end +; + +@include "footer" diff --git a/assets/schemas/sql/dbmodel.sch b/assets/schemas/sql/dbmodel.sch new file mode 100644 index 0000000000..264b2eb169 --- /dev/null +++ b/assets/schemas/sql/dbmodel.sch @@ -0,0 +1,68 @@ +# SQL definition for database model +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[-- ** Database generated with pgModeler (PostgreSQL Database Modeler).] $br +[-- ** pgModeler version: ] {pgmodeler-ver} $br +[-- ** PostgreSQL version: ] {pgsql-ver} $br +[-- ** Project Site: pgmodeler.io] $br +[-- ** Model Author: ] + +@include "ddlend" + +%if {author} %then + {author} +%else + --- +%end + +$br + +%if {export-to-file} %then + %if {role} %then + {role} + %end + + %if {tablespace} %then + [-- ** Tablespaces creation must be performed outside a multi lined SQL file. ] $br + [-- ** These commands were put in this file only as a convenience.] $br $br + {tablespace} $br + %end + + $br + + %if {database} %then + [-- ** Database creation must be performed outside a multi lined SQL file. ] $br + [-- ** These commands were put in this file only as a convenience.] $br $br + {database} $br + %end +%end + +%if {function} %then + [SET check_function_bodies = false;] + {ddl-end} $br +%end + +%if {schema} %then + {schema} +%end + +%if {search-path} %then + [SET search_path TO ] {search-path}; + {ddl-end} $br +%end + + +%if {shell-types} %then + {shell-types} +%end + +%if {objects} %then + {objects} +%end + +%if {permission} %then + {permission} +%end + +$br diff --git a/assets/schemas/sql/ddlend.sch b/assets/schemas/sql/ddlend.sch new file mode 100644 index 0000000000..b232df9cc9 --- /dev/null +++ b/assets/schemas/sql/ddlend.sch @@ -0,0 +1,6 @@ +# This is a special token that pgModeler recognizes as end of DDL command +# when exporting models directly to DBMS. +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {ddl-end} $br [-- ddl-end --] $br diff --git a/assets/schemas/sql/domain.sch b/assets/schemas/sql/domain.sch new file mode 100644 index 0000000000..1187129f3e --- /dev/null +++ b/assets/schemas/sql/domain.sch @@ -0,0 +1,29 @@ +# SQL definition for domains +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE DOMAIN ] {name} [ AS ] {type} + +%if {collation} %then + $br $tb [COLLATE ] {collation} +%end + +%if {default-value} %then + $br $tb [DEFAULT ] {default-value} +%end + +%if {not-null} %then + $br $tb [NOT NULL] +%end + +%if {constraints} %then + {constraints} +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/domconstraint.sch b/assets/schemas/sql/domconstraint.sch new file mode 100644 index 0000000000..0e8c6beb2c --- /dev/null +++ b/assets/schemas/sql/domconstraint.sch @@ -0,0 +1,5 @@ +# SQL definition for domain's check constraint +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$br $tb CONSTRAINT $sp {name} $sp CHECK $sp ({expression}) diff --git a/assets/schemas/sql/drop.sch b/assets/schemas/sql/drop.sch new file mode 100644 index 0000000000..2c9f62cfcf --- /dev/null +++ b/assets/schemas/sql/drop.sch @@ -0,0 +1,31 @@ +# SQL command to drop an object +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" + +%if %not {domain} %and {constraint} %or {column} %then + %if %not {decl-in-table} %then + [ALTER TABLE ] {table} [ DROP ] {sql-object} [ IF EXISTS ] + %end +%else + [DROP ] {sql-object} [ IF EXISTS ] +%end + +%if {column} %or {constraint} %and %not {decl-in-table} %or {extension} %or {rule} %or {trigger} %or {policy} %then + {name} +%else + {signature} +%end + +%if {trigger} %or {rule} %or {policy} %then + [ ON ] {table} +%end + +%if {cascade} %and %not {database} %and %not {tablespace} %and %not {role} %and %not {usermapping} %then + [ CASCADE] +%end + +; + +{ddl-end} diff --git a/assets/schemas/sql/element.sch b/assets/schemas/sql/element.sch new file mode 100644 index 0000000000..ae4c5b8077 --- /dev/null +++ b/assets/schemas/sql/element.sch @@ -0,0 +1,20 @@ +# SQL definition for operator class elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {function} %then + $tb FUNCTION $tb {stg-number} $tb {signature} +%end + +%if {operator} %then + $tb OPERATOR $tb {stg-number} $tb {signature} + + %if {opfamily} %then + [ FOR ORDER BY ] {opfamily} + %else + [ FOR SEARCH ] + %end +%end + +%if {storage} %then + $tb STORAGE $tb {type} +%end diff --git a/assets/schemas/sql/eventtrigger.sch b/assets/schemas/sql/eventtrigger.sch new file mode 100644 index 0000000000..db24480992 --- /dev/null +++ b/assets/schemas/sql/eventtrigger.sch @@ -0,0 +1,18 @@ +# SQL definition for event triggers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE EVENT TRIGGER ] {name} +$br $tb [ON ] {event} + +%if {filter} %then + $br $tb [WHEN ] {filter} +%end + +$br $tb [EXECUTE PROCEDURE ] {function}; + +@include "footer" diff --git a/assets/schemas/sql/excelement.sch b/assets/schemas/sql/excelement.sch new file mode 100644 index 0000000000..9163aa22a4 --- /dev/null +++ b/assets/schemas/sql/excelement.sch @@ -0,0 +1,32 @@ +# SQL definition for exclude constraints elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$br $tb $sp $sp + +%if {column} %then + {column} +%else + %if {expression} %then + {expression} + %end +%end + +%if {opclass} %then + $sp {opclass} +%end + +%if {use-sorting} %then + %if {asc-order} %then + [ ASC ] + %else + [ DESC ] + %end + + %if {nulls-first} %then + [NULLS FIRST] + %else + [NULLS LAST] + %end +%end + +[ WITH ] {operator} diff --git a/assets/schemas/sql/extension.sch b/assets/schemas/sql/extension.sch new file mode 100644 index 0000000000..09c02b2f27 --- /dev/null +++ b/assets/schemas/sql/extension.sch @@ -0,0 +1,25 @@ +# SQL definition for extensions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE EXTENSION ] {name} $br + +%if {schema} %then + [WITH SCHEMA ] {schema} +%end + +%if {cur-version} %then + $br [VERSION ] '{cur-version}' +%end + +%if {old-version} %then + $br [FROM ] '{old-version}' +%end + +; + +@include "footer" \ No newline at end of file diff --git a/assets/schemas/sql/footer.sch b/assets/schemas/sql/footer.sch new file mode 100644 index 0000000000..77df949903 --- /dev/null +++ b/assets/schemas/sql/footer.sch @@ -0,0 +1,20 @@ +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +{ddl-end} + +%if {owner} %and + ({sql-object} != "TABLESPACE") %and + ({sql-object} != "DATABASE") %and + ({sql-object} != "USER MAPPING") %then + {owner} +%end + +%if {comment} %then {comment} %end + +%if {appended-sql} %then + {appended-sql} + {ddl-end} +%end + +$br \ No newline at end of file diff --git a/assets/schemas/sql/foreigndatawrapper.sch b/assets/schemas/sql/foreigndatawrapper.sch new file mode 100644 index 0000000000..a03f352f15 --- /dev/null +++ b/assets/schemas/sql/foreigndatawrapper.sch @@ -0,0 +1,31 @@ +# SQL definition for foreign data wrappers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE ] {sql-object} $sp {name} $br + +%if %not {handler} %then + [NO HANDLER] +%else + [HANDLER ] {handler} +%end + +$br + +%if %not {validator} %then + [NO VALIDATOR] +%else + [VALIDATOR ] {validator} +%end + +%if {options} %then + $br [OPTIONS (] {options} ) +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/foreignserver.sch b/assets/schemas/sql/foreignserver.sch new file mode 100644 index 0000000000..33b32e70e8 --- /dev/null +++ b/assets/schemas/sql/foreignserver.sch @@ -0,0 +1,27 @@ +# SQL definition for foreign server +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE SERVER ] {name} + +%if {type} %then + [ TYPE ] '{type}' +%end + +%if {version} %then + [ VERSION ] '{version}' +%end + +$br [FOREIGN DATA WRAPPER ] {fdw} + +%if {options} %then + $br [OPTIONS (] {options} ) +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/foreigntable.sch b/assets/schemas/sql/foreigntable.sch new file mode 100644 index 0000000000..c5f4380768 --- /dev/null +++ b/assets/schemas/sql/foreigntable.sch @@ -0,0 +1,72 @@ +# SQL definition for foreign tables +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE FOREIGN TABLE ] {name} + +%if {partitioned-table} %then + $br [PARTITION OF ] {partitioned-table} $sp +%end + +%if %not {partitioned-table} %then + + [ (] $br + + %if %not {gen-alter-cmds} %then + %if {columns} %then + {columns} + %end + + %if {inh-columns} %then + {inh-columns} + %end + + %if {constraints} %then + {constraints} + %end + %end + + %if %not {constraints} %then $br %end + ) + +%else + %if %not {gen-alter-cmds} %and {partitioned-table} %and {constraints} %then + [ (] $br {constraints} $br [)] + %end +%end + +%if {partitioned-table} %then + $br [FOR VALUES ] {partition-bound-expr} +%end + +%if {ancestor-table} %then $br [ INHERITS(] {ancestor-table} [)] %end +$br [SERVER ] {server} +%if {options} %then $br [OPTIONS (] {options} [)] %end + +; + +{ddl-end} + +%if {gen-alter-cmds} %then + %if {columns} %then $br {columns} %end + %if {constraints} %then $br {constraints} %end +%end + +%if {comment} %then {comment} %end +%if {cols-comment} %then {cols-comment} %end +%if {owner} %then {owner} %end + +%if {appended-sql} %then + {appended-sql} + {ddl-end} +%end + +%if {initial-data} %then + $br {initial-data} $br +%end + +$br diff --git a/assets/schemas/sql/function.sch b/assets/schemas/sql/function.sch new file mode 100644 index 0000000000..8e5cbaef3d --- /dev/null +++ b/assets/schemas/sql/function.sch @@ -0,0 +1,70 @@ +# SQL definition for functions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OR REPLACE FUNCTION ] {name} $sp ( %if {parameters} %then {parameters} %end ) $br +$tb [RETURNS ] + +%if {return-table} %then + [TABLE ] ( {return-table} ) +%else + %if {returns-setof} %then [SETOF ] %end + {return-type} +%end + +$br + + +$tb [LANGUAGE ] {language} $br + +%if {transform-types} %then + $tb TRANSFORM {transform-types} $br +%end + +%if {window-func} %then + $tb WINDOW $br +%end + +$tb {function-type} $sp %if {leakproof} %then LEAKPROOF %end $br + +$tb {behavior-type} $br +$tb {security-type} $br +$tb {parallel-type} $br + +$tb [COST ] {execution-cost} $br + +%if {returns-setof} %then + $tb [ROWS ] {row-amount} $br +%end + +%if {config-params} %then + {config-params} +%end + +$tb [AS ] + +%if {library} %then + '{library}' + + %if {symbol} %then + [, ] '{symbol}' + %end +%else + %if ({language} == "internal") %then + '{definition}' + %else + $br [$function$] + + $br {definition} + + $br [$function$] + %end +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/genericsql.sch b/assets/schemas/sql/genericsql.sch new file mode 100644 index 0000000000..bdd6beade5 --- /dev/null +++ b/assets/schemas/sql/genericsql.sch @@ -0,0 +1,16 @@ +# SQL definition for generic sql objects +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {hide-description} %then + [-- object: ] {name} [ | type: Generic SQL Object --] $br +%end + +{definition} + +%if {hide-description} %then + @include "ddlend" + {ddl-end} +%end + +$br diff --git a/assets/schemas/sql/idxelement.sch b/assets/schemas/sql/idxelement.sch new file mode 100644 index 0000000000..66d5bf4946 --- /dev/null +++ b/assets/schemas/sql/idxelement.sch @@ -0,0 +1,34 @@ +# SQL definition for index elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$br $tb + +%if {column} %then + {column} +%else + %if {expression} %then + ({expression}) + %end +%end + +%if {collation} %then + [ COLLATE ] {collation} +%end + +%if {opclass} %then + $sp {opclass} +%end + +%if {use-sorting} %then + %if {asc-order} %then + [ ASC ] + %else + [ DESC ] + %end + + %if {nulls-first} %then + [NULLS FIRST] + %else + [NULLS LAST] + %end +%end diff --git a/assets/schemas/sql/index.sch b/assets/schemas/sql/index.sch new file mode 100644 index 0000000000..a4967a4376 --- /dev/null +++ b/assets/schemas/sql/index.sch @@ -0,0 +1,65 @@ +# SQL definition for indexes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE ] %if {unique} %then [UNIQUE ] %end [INDEX ] + +%if {concurrent} %then + [ CONCURRENTLY ] +%end + +{name} [ ON ] {table} + +%if {index-type} %then + $br [USING ] {index-type} +%end + +$br ( {elements} $br ) + +%if {expression} %then + $br ({expression}) $sp +%end + +%if ({pgsql-ver} >=f "15.0") %and {nulls-not-distinct} %then + $br [NULLS NOT DISTINCT] +%end + +%if ({pgsql-ver} >=f "11.0") %and {include-cols} %then + $br [INCLUDE ] ({include-cols}) +%end + +%if {stg-params} %then + $br [WITH (] + + %if {factor} %then + [FILLFACTOR = ] {factor} + %end + + %if {fast-update} %then + %if {factor} %then [, ] %end + [FASTUPDATE = ON] + %end + + %if {buffering} %then + %if {factor} %then [, ] %end + [BUFFERING = ON] + %end + + [)] +%end + +%if {tablespace} %then + $br [TABLESPACE ] {tablespace} +%end + +%if {predicate} %then + $br [WHERE (] {predicate} [)] +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/language.sch b/assets/schemas/sql/language.sch new file mode 100644 index 0000000000..b9b1fd1774 --- /dev/null +++ b/assets/schemas/sql/language.sch @@ -0,0 +1,34 @@ +# SQL definition for procedural languages +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OR REPLACE ] + +%if {trusted} %then + + %if {handler} %then + [TRUSTED ] + %end +%end + +[ LANGUAGE ] {name} + +%if {handler} %then + $br $tb [HANDLER ] {handler} +%end + +%if {validator} %then + $br [VALIDATOR ] {validator} +%end + +%if {inline} %then + $br [INLINE ] {inline} +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/objlabel.sch b/assets/schemas/sql/objlabel.sch new file mode 100644 index 0000000000..e87097b826 --- /dev/null +++ b/assets/schemas/sql/objlabel.sch @@ -0,0 +1,6 @@ +# An special comment prepended to each object definition briefly describing it. +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[-- object: ] {name} [ | type: ] {sql-object} [ --] $br +[-- ] {drop} diff --git a/assets/schemas/sql/opclass.sch b/assets/schemas/sql/opclass.sch new file mode 100644 index 0000000000..3d5110c5a4 --- /dev/null +++ b/assets/schemas/sql/opclass.sch @@ -0,0 +1,20 @@ +# SQL definition for operator classes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OPERATOR CLASS ] {name} +%if {default} %then [ DEFAULT ] %end + +[ FOR TYPE ] {type} $br +[ USING ] {index-type} + +%if {family} %then [ FAMILY ] {family} %end +[ AS] $br + +{elements}; + +@include "footer" diff --git a/assets/schemas/sql/operator.sch b/assets/schemas/sql/operator.sch new file mode 100644 index 0000000000..68d477fb5c --- /dev/null +++ b/assets/schemas/sql/operator.sch @@ -0,0 +1,47 @@ +# SQL definition for operators +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OPERATOR ] {name} [ (] + +$br $tb [PROCEDURE = ] {operfunc} + +%if {left-type} %then + $br $tb [, LEFTARG = ] {left-type} +%end + +%if {right-type} %then + $br $tb [, RIGHTARG = ] {right-type} +%end + +%if {commutator-op} %then + $br $tb [, COMMUTATOR = ] OPERATOR({commutator-op}) +%end + +%if {negator-op} %then + $br $tb [, NEGATOR = ] OPERATOR({negator-op}) +%end + +%if {restriction} %then + $br $tb [, RESTRICT = ] {restriction} +%end + +%if {join} %then + $br $tb [, JOIN = ] {join} +%end + +%if {hashes} %then + $br $tb [, HASHES ] +%end + +%if {merges} %then + $br $tb [, MERGES ] +%end + +); + +@include "footer" diff --git a/assets/schemas/sql/opfamily.sch b/assets/schemas/sql/opfamily.sch new file mode 100644 index 0000000000..ef755d5227 --- /dev/null +++ b/assets/schemas/sql/opfamily.sch @@ -0,0 +1,11 @@ +# SQL definition for operator family +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OPERATOR FAMILY ] {name} [ USING ] {index-type}; + +@include "footer" diff --git a/assets/schemas/sql/parameter.sch b/assets/schemas/sql/parameter.sch new file mode 100644 index 0000000000..1c0e958320 --- /dev/null +++ b/assets/schemas/sql/parameter.sch @@ -0,0 +1,22 @@ +# SQL definition for function parameters +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {variadic} %then + VARIADIC $sp +%else + %if {in} %then IN $sp %end + %if {out} %then OUT $sp %end +%end + +%if {reduced-form} %then + {type}, $sp +%else + {name} $sp {type} + + %if {default-value} %then + [ DEFAULT ] {default-value} + %end + + , $sp +%end diff --git a/assets/schemas/sql/partitionkey.sch b/assets/schemas/sql/partitionkey.sch new file mode 100644 index 0000000000..ef28c88691 --- /dev/null +++ b/assets/schemas/sql/partitionkey.sch @@ -0,0 +1,19 @@ +# SQL definition for partition key elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {column} %then + {column} +%else + %if {expression} %then + ({expression}) + %end +%end + +%if {collation} %then + [ COLLATE ] {collation} +%end + +%if {opclass} %then + $sp {opclass} +%end diff --git a/assets/schemas/sql/permission.sch b/assets/schemas/sql/permission.sch new file mode 100644 index 0000000000..45b8783e49 --- /dev/null +++ b/assets/schemas/sql/permission.sch @@ -0,0 +1,71 @@ +# SQL definition for permissions on objects +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" + +[-- object: ] {name} [ | type: ] PERMISSION [ --] + +%if {privileges} %then + + $br + + %if {revoke} %then + [REVOKE ] + %else + [GRANT ] + %end + + {privileges} $br + + %if {parent} %then + $sp $sp [ ON TABLE ] {parent} $br + %else + $sp $sp [ ON ] {type} $sp {object} $br + %end + + $sp $sp %if {revoke} %then [ FROM ] %else [ TO ] %end + + %if {roles} %then + {roles} + + %if {revoke} %and {cascade} %then + [ CASCADE] + %end + %else + PUBLIC + %end + + ; $br +%end + + +%if {privileges-gop} %then + + $br + + %if {revoke} %then + [REVOKE GRANT OPTION FOR ] + %else + [GRANT ] + %end + + {privileges-gop} $br + + %if {parent} %then + $sp $sp [ ON TABLE ] {parent} $br + %else + $sp $sp [ ON ] {type} $sp {object} $br + %end + + $sp $sp + + %if {revoke} %then + [ FROM ] {roles} + %if {cascade} %then [ CASCADE] %end ; $br + %else + [ TO ] {roles} [ WITH GRANT OPTION]; $br + %end +%end + +{ddl-end} $br $br diff --git a/assets/schemas/sql/policy.sch b/assets/schemas/sql/policy.sch new file mode 100644 index 0000000000..04851f5bf1 --- /dev/null +++ b/assets/schemas/sql/policy.sch @@ -0,0 +1,36 @@ +# SQL definition for policy +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE POLICY ] {name} [ ON ] {table} + +%if {permissive} %then + $br $tb [AS PERMISSIVE] +%else + $br $tb [AS RESTRICTIVE] +%end + +$br $tb [FOR ] {command} +$br $tb [TO ] + +%if {roles} %then + {roles} +%else + PUBLIC +%end + +%if {using-exp} %then + $br $tb [USING (] {using-exp} [)] +%end + +%if {check-exp} %then + $br $tb [WITH CHECK (] {check-exp} [)] +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/prependedsql.sch b/assets/schemas/sql/prependedsql.sch new file mode 100644 index 0000000000..4d133f3797 --- /dev/null +++ b/assets/schemas/sql/prependedsql.sch @@ -0,0 +1,8 @@ +# Prepended SQL commands attached to objects' defintion. +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {prepended-sql} %then + {prepended-sql} + {ddl-end} $br +%end diff --git a/assets/schemas/sql/procedure.sch b/assets/schemas/sql/procedure.sch new file mode 100644 index 0000000000..b01c7e04ff --- /dev/null +++ b/assets/schemas/sql/procedure.sch @@ -0,0 +1,42 @@ +# SQL definition for procedures +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if ({pgsql-ver} >=f "11.0") %then + @include "ddlend" + @include "objlabel" + @include "prependedsql" + + [CREATE OR REPLACE PROCEDURE ] {name} $sp ( %if {parameters} %then {parameters} %end ) $br + $tb [LANGUAGE ] {language} $br + + %if {transform-types} %then + $tb TRANSFORM {transform-types} $br + %end + + $tb {security-type} $br + + %if {config-params} %then + {config-params} + %end + + $tb [AS ] + + %if {library} %then + '{library}' + + %if {symbol} %then + [, ] '{symbol}' + %end + %else + $br [$function$] + + $br {definition} + + $br [$function$] + %end + + ; + + @include "footer" +%end diff --git a/assets/schemas/sql/relationship.sch b/assets/schemas/sql/relationship.sch new file mode 100644 index 0000000000..a3d9c3e661 --- /dev/null +++ b/assets/schemas/sql/relationship.sch @@ -0,0 +1,17 @@ +# SQL definition for relationships +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {rel1n} %then + {constraints} +%end + +%if {relnn} %then + {table} + {constraints} +%end + +%if {rel1n} %or {relnn} %and {index} %then + {index} +%end + diff --git a/assets/schemas/sql/role.sch b/assets/schemas/sql/role.sch new file mode 100644 index 0000000000..6b3d978001 --- /dev/null +++ b/assets/schemas/sql/role.sch @@ -0,0 +1,30 @@ +# SQL definition for type roles +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE ROLE ] {name} + +%if {has-options} %then + [ WITH ] + %if {superuser} %then $br $tb SUPERUSER %end + %if {createdb} %then $br $tb CREATEDB %end + %if {createrole} %then $br $tb CREATEROLE %end + %if {inherit} %then $br $tb INHERIT %end + %if {login} %then $br $tb LOGIN %end + %if {replication} %then $br $tb REPLICATION %end + %if {bypassrls} %then $br $tb BYPASSRLS %end + + %if {password} %then $br $tb [ PASSWORD ] '{password}' %end + %if {connlimit} %then $br $tb [CONNECTION LIMIT ] {connlimit} %end + %if {validity} %then $br $tb [VALID UNTIL ] '{validity}' %end + + %if {member-roles} %then $br $tb [ROLE ] {member-roles} %end + %if {admin-roles} %then $br $tb [ADMIN ] {admin-roles} %end +%end +; + +@include "footer" diff --git a/assets/schemas/sql/rule.sch b/assets/schemas/sql/rule.sch new file mode 100644 index 0000000000..d39ae9185d --- /dev/null +++ b/assets/schemas/sql/rule.sch @@ -0,0 +1,26 @@ +# SQL definition for rules +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OR REPLACE RULE ] {name} [ AS ] {event-type} $br +$tb [TO ] {table} $br + +%if {condition} %then + $tb [WHERE ] {condition} $br +%end + +$tb [DO ] {exec-type} $sp + +%if {commands} %then + ({commands}) +%else + NOTHING +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/schema.sch b/assets/schemas/sql/schema.sch new file mode 100644 index 0000000000..fd1a7327fc --- /dev/null +++ b/assets/schemas/sql/schema.sch @@ -0,0 +1,11 @@ +# SQL definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE SCHEMA ] {name}; + +@include "footer" diff --git a/assets/schemas/sql/sequence.sch b/assets/schemas/sql/sequence.sch new file mode 100644 index 0000000000..62a7c30d14 --- /dev/null +++ b/assets/schemas/sql/sequence.sch @@ -0,0 +1,49 @@ +# SQL definition for sequences +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE SEQUENCE ] {name} $br + +%if {increment} %then + $tb [INCREMENT BY ] {increment} $br +%end + +%if {min-value} %then + $tb [MINVALUE ] {min-value} $br +%end + +%if {max-value} %then + $tb [MAXVALUE ] {max-value} $br +%end + +%if {start} %then + $tb [START WITH ] {start} $br +%end + +%if {cache} %then + $tb [CACHE ] {cache} $br +%end + +%if {cycle} %then + $tb CYCLE +%else + $tb [NO CYCLE] +%end + +$br + +$tb [OWNED BY ] +%if {owner-col} %then {owner-col} %else NONE %end +; $br + +%if {owner-col} %and %not {col-is-identity} %then + $br + [ALTER TABLE ] {table} [ ALTER COLUMN ] {column} $br + [ SET DEFAULT nextval('] {name} ['::regclass);] +%end + +@include "footer" diff --git a/assets/schemas/sql/sessionopts.sch b/assets/schemas/sql/sessionopts.sch new file mode 100644 index 0000000000..366f2b97f0 --- /dev/null +++ b/assets/schemas/sql/sessionopts.sch @@ -0,0 +1,14 @@ +# This is a special token that pgModeler recognizes as end of DDL command +# when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! + +@include "ddlend" + +%if {function} %then + [SET check_function_bodies = false;] + {ddl-end} $br +%end + +%if {search-path} %then + [SET search_path TO ] {search-path}; + {ddl-end} $br +%end diff --git a/assets/schemas/sql/table.sch b/assets/schemas/sql/table.sch new file mode 100644 index 0000000000..d1571b3eb1 --- /dev/null +++ b/assets/schemas/sql/table.sch @@ -0,0 +1,134 @@ +# SQL definition for tables +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE] + +%if {unlogged} %then + [ UNLOGGED] +%end + +[ TABLE ] {name} + +%if {partitioned-table} %then + $br [PARTITION OF ] {partitioned-table} $sp +%end + +%if %not {partitioned-table} %then + + [ (] $br + + %if {copy-table} %then + $tb LIKE $sp {copy-table} + + %if %not {gen-alter-cmds} %then + %if {columns} %or {constraints} %then + [,] + %end + %end + + $br + %end + + %if %not {gen-alter-cmds} %then + %if {columns} %then + {columns} + %end + + %if {inh-columns} %then + {inh-columns} + %end + + %if {constraints} %then + {constraints} + %end + %end + + + %if %not {constraints} %then + $br + %end + + ) +%else + %if %not {gen-alter-cmds} %and {partitioned-table} %and {constraints} %then + [ (] $br {constraints} $br [)] + %end +%end + +%if {partitioned-table} %then + %if {partition-bound-expr} %then + $br [FOR VALUES ] {partition-bound-expr} + %else + DEFAULT + %end +%end + +%if {partitioning} %then + $br [PARTITION BY ] {partitioning} [ (] {partitionkey} [)] +%end + +%if {ancestor-table} %then + $br [ INHERITS(] {ancestor-table} [)] +%end + +%if ({pgsql-ver} <=f "11.0") %and {oids} %then + $br [WITH ( OIDS = TRUE )] +%end + +%if {tablespace} %then + $br [TABLESPACE ] {tablespace} +%end + +; + +{ddl-end} + +%if {gen-alter-cmds} %then + %if {columns} %then + $br {columns} + %end + + %if {constraints} %then + $br {constraints} + %end +%end + +%if {comment} %then + {comment} +%end + +%if {cols-comment} %then + {cols-comment} +%end + +%if {owner} %then + {owner} +%end + +%if {rls-enabled} %then + [ALTER TABLE ] {name} [ ENABLE ROW LEVEL SECURITY;] + + {ddl-end} + + %if {rls-forced} %then + [ALTER TABLE ] {name} [ FORCE ROW LEVEL SECURITY;] + + {ddl-end} + %end +%end + +%if {appended-sql} %then + {appended-sql} + {ddl-end} +%end + +%if {initial-data} %then + $br {initial-data} $br +%end + +$br diff --git a/assets/schemas/sql/tablespace.sch b/assets/schemas/sql/tablespace.sch new file mode 100644 index 0000000000..919a6f29a8 --- /dev/null +++ b/assets/schemas/sql/tablespace.sch @@ -0,0 +1,17 @@ +# SQL definition for tablespaces +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE TABLESPACE ] {name} $br + +%if {owner} %then + $tb [OWNER ] {owner} $br +%end + +$tb [LOCATION ] {directory}; $br + +@include "footer" diff --git a/assets/schemas/sql/transform.sch b/assets/schemas/sql/transform.sch new file mode 100644 index 0000000000..25cf42d4a1 --- /dev/null +++ b/assets/schemas/sql/transform.sch @@ -0,0 +1,27 @@ +# SQL definition for transforms +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE OR REPLACE TRANSFORM FOR ] {type} [ LANGUAGE ] {language} [ (] + +# One of the two function should be defined otherwise the code generation will fail + +%if {fromsql} %or %not {tosql} %then + $br $tb [FROM SQL WITH FUNCTION ] {fromsql} +%end + +%if {fromsql} %and {tosql} %then + , +%end + +%if {tosql} %or %not {fromsql} %then + $br $tb [TO SQL WITH FUNCTION ] {tosql} +%end + +$br [);] + +@include "footer" diff --git a/assets/schemas/sql/trigger.sch b/assets/schemas/sql/trigger.sch new file mode 100644 index 0000000000..5a96bcb630 --- /dev/null +++ b/assets/schemas/sql/trigger.sch @@ -0,0 +1,48 @@ +# SQL definition for triggers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE ] + +%if %not {constraint} %then + [OR REPLACE ] +%else + [CONSTRAINT ] +%end + +[TRIGGER ] {name} $br +$tb {firing-type} $sp {events} $br + +$tb [ON ] {table} $br + +%if {constraint} %then + %if {ref-table} %then + $tb [FROM ] {ref-table} $br + %end + + %if {deferrable} %then + $tb [DEFERRABLE ] {defer-type} $br + %else + $tb [NOT DEFERRABLE ] $br + %end +%end + +%if {old-table-name} %or {new-table-name} %then + $tb REFERENCING + %if {old-table-name} %then [ OLD TABLE AS ] {old-table-name} %end + %if {new-table-name} %then [ NEW TABLE AS ] {new-table-name} %end + $br +%end + +$tb [FOR EACH ] %if {per-line} %then ROW %else STATEMENT %end $br + +%if {condition} %then $tb WHEN $sp ({condition}) $br %end + +$tb [EXECUTE PROCEDURE ] {trigger-func}( +%if {arguments} %then {arguments} %end ); + +@include "footer" diff --git a/assets/schemas/sql/typeattribute.sch b/assets/schemas/sql/typeattribute.sch new file mode 100644 index 0000000000..ea66dd2070 --- /dev/null +++ b/assets/schemas/sql/typeattribute.sch @@ -0,0 +1,10 @@ +# SQL definition for user defined type attributes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ ] {name} $sp {type} + +%if {collation} %then + [ COLLATE ] {collation} +%end + +, $br diff --git a/assets/schemas/sql/usermapping.sch b/assets/schemas/sql/usermapping.sch new file mode 100644 index 0000000000..d754c4d4e2 --- /dev/null +++ b/assets/schemas/sql/usermapping.sch @@ -0,0 +1,21 @@ +# SQL definition for user mapping +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +[CREATE USER MAPPING FOR ] + +%if {owner} %then {owner} %else PUBLIC %end $br + +[SERVER ] {server} + +%if {options} %then + $br [OPTIONS (] {options} ) +%end + +; + +@include "footer" diff --git a/assets/schemas/sql/usertype.sch b/assets/schemas/sql/usertype.sch new file mode 100644 index 0000000000..7268d27680 --- /dev/null +++ b/assets/schemas/sql/usertype.sch @@ -0,0 +1,71 @@ +# SQL definition for user defined types +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" + +%if %not {reduced-form} %then + @include "objlabel" + @include "prependedsql" +%end + +[CREATE TYPE ] {name} + +%if {reduced-form} %then + ; {ddl-end} $br +%else + %if {base} %then + [ (] $br + %else + [ AS] $br + %end + + %if {composite} %then + ( $br {typeattrib} $br ); + %end + + %if {enumeration} %then + [ENUM ] ( + %if {labels} %then {labels} %end + [);] + %end + + %if {range} %then + [RANGE (] $br + [SUBTYPE = ] {subtype} + + %if {collation} %then $br [, COLLATE = ] {collation} %end + %if {opclass} %then $br [, SUBTYPE_OPCLASS = ] {opclass} %end + %if {canonical} %then $br [, CANONICAL = ] {canonical} %end + %if {subtypediff} %then $br [, SUBTYPE_DIFF = ] {subtypediff} %end + + ); + %end + + %if {base} %then + %if {input} %then $tb [INPUT = ] {input}, $br %end + %if {output} %then $tb [OUTPUT = ] {output} $br %end + %if {receive} %then $tb [, RECEIVE = ] {receive} $br %end + %if {send} %then $tb [, SEND = ] {send} $br %end + %if {tpmodin} %then $tb [, TYPMOD_IN = ] {tpmodin} $br %end + %if {tpmodout} %then $tb [, TYPMOD_OUT = ] {tpmodout} $br %end + %if {analyze} %then $tb [, ANALYZE = ] {analyze} $br %end + %if {internal-length} %then $tb [, INTERNALLENGTH = ] {internal-length} $br %end + %if {by-value} %then $tb [, PASSEDBYVALUE ] $br %end + %if {alignment} %then $tb [, ALIGNMENT = ] {alignment} $br %end + %if {storage} %then $tb [, STORAGE = ] {storage} $br %end + %if {default-value} %then $tb [, DEFAULT = ] {default-value} $br %end + %if {element} %then $tb [, ELEMENT = ] {element} $br %end + %if {delimiter} %then $tb [, DELIMITER = ] '{delimiter}' $br %end + %if {like-type} %then $tb [, LIKE = ] {like-type} $br %end + %if {category} %then $tb [, CATEGORY = ] '{category}' $br %end + %if {preferred} %then $tb [, PREFERRED = ] true $br %end + %if {collatable} %then $tb [, COLLATABLE = ] true $br %end + + ); + %end + + @include "footer" +%end + + diff --git a/assets/schemas/sql/view.sch b/assets/schemas/sql/view.sch new file mode 100644 index 0000000000..697a144812 --- /dev/null +++ b/assets/schemas/sql/view.sch @@ -0,0 +1,49 @@ +# SQL definition for views +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +@include "ddlend" +@include "objlabel" +@include "prependedsql" + +%if {materialized} %then +[CREATE ] +%else +[CREATE OR REPLACE ] +%end + +%if {recursive} %then + [RECURSIVE ] +%else + %if {materialized} %then + [MATERIALIZED ] + %end +%end + +VIEW $sp {name} + +%if {columns} %then + [ (] {columns} [)] +%end + +%if {materialized} %and {tablespace} %then + $br TABLESPACE $sp {tablespace} +%end + +%if {options} %then + $br [WITH (] {options} [)] +%end + +$br [AS ] $br {definition} + +%if {materialized} %and {with-no-data} %then + $br [WITH NO DATA] +%end + +%if %not {materialized} %and {check-option} %then + $br [WITH ] {check-option} [ OPTION] +%end + +[;] + +@include "footer" diff --git a/assets/schemas/xml/aggregate.sch b/assets/schemas/xml/aggregate.sch new file mode 100644 index 0000000000..d7031397ff --- /dev/null +++ b/assets/schemas/xml/aggregate.sch @@ -0,0 +1,31 @@ +# XML definition for aggregate functions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br +{schema} +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +%if {types} %then {types} %end + +{state-type} +{transition} +%if {final} %then {final} %end +%if {sort-op} %then {sort-op} %end + $br $br diff --git a/assets/schemas/xml/appendedsql.sch b/assets/schemas/xml/appendedsql.sch new file mode 100644 index 0000000000..c9fac7f519 --- /dev/null +++ b/assets/schemas/xml/appendedsql.sch @@ -0,0 +1,9 @@ +# XML definition for appendend SQL commands +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +#Creates element envolving the appended-sql +#The tag is converted to in order +#to not cause syntax errors on the schema parser + +$tb $sp $sp $br diff --git a/assets/schemas/xml/basetype.sch b/assets/schemas/xml/basetype.sch new file mode 100644 index 0000000000..c4934b45cb --- /dev/null +++ b/assets/schemas/xml/basetype.sch @@ -0,0 +1,36 @@ +# XML definition for native types +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [ $br diff --git a/assets/schemas/xml/cast.sch b/assets/schemas/xml/cast.sch new file mode 100644 index 0000000000..c9cc112517 --- /dev/null +++ b/assets/schemas/xml/cast.sch @@ -0,0 +1,33 @@ +# XML definition for type casts +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +{source-type} +{destiny-type} + +%if {function} %then {function} %end + + $br $br diff --git a/assets/schemas/xml/changelog.sch b/assets/schemas/xml/changelog.sch new file mode 100644 index 0000000000..bcc0697051 --- /dev/null +++ b/assets/schemas/xml/changelog.sch @@ -0,0 +1,9 @@ +# XML definition for database model changelog +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {entry} %then + $br + {entry} + $br $br +%end diff --git a/assets/schemas/xml/collation.sch b/assets/schemas/xml/collation.sch new file mode 100644 index 0000000000..0eacd2605a --- /dev/null +++ b/assets/schemas/xml/collation.sch @@ -0,0 +1,36 @@ +# XML definition for collations +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {reduced-form} %then $tb %end + + $br + + %if {schema} %then {schema} %end + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + + +%else + /> $br +%end diff --git a/assets/schemas/xml/column.sch b/assets/schemas/xml/column.sch new file mode 100644 index 0000000000..a613cffba7 --- /dev/null +++ b/assets/schemas/xml/column.sch @@ -0,0 +1,54 @@ +# XML definition for columns +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [ $br + +$tb {type} + +%if {collation} %then $tb {collation} %end + +%if {comment} %then $tb {comment} %end + +$tb $br diff --git a/assets/schemas/xml/comment.sch b/assets/schemas/xml/comment.sch new file mode 100644 index 0000000000..7c3c1015e8 --- /dev/null +++ b/assets/schemas/xml/comment.sch @@ -0,0 +1,9 @@ +# XML definition for comments +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +#Creates element envolving the comment +#The tag is converted to in order +#to not cause syntax errors on the schema parser + +$tb $sp $sp $br \ No newline at end of file diff --git a/assets/schemas/xml/confparam.sch b/assets/schemas/xml/confparam.sch new file mode 100644 index 0000000000..49e5185c97 --- /dev/null +++ b/assets/schemas/xml/confparam.sch @@ -0,0 +1,5 @@ +# XML definition for functions/procedures configuration parameters definition +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb $br diff --git a/assets/schemas/xml/constraint.sch b/assets/schemas/xml/constraint.sch new file mode 100644 index 0000000000..7954762321 --- /dev/null +++ b/assets/schemas/xml/constraint.sch @@ -0,0 +1,87 @@ +# XML definition for constraints +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {decl-in-table} %then $tb %end + +[ $br + +%if {tablespace} %then $tb {tablespace} %end + +%if {decl-in-table} %then $tb %end + +%if {src-columns} %then + $tb $br +%end + +%if {dst-columns} %then + %if {decl-in-table} %then $tb %end + $tb $br +%end + +%if {ex-constr} %then + {elements} +%end + +%if {ck-constr} %or {ex-constr} %then + %if {expression} %then + %if {decl-in-table} %then $tb %end + $tb $sp $sp $br + %end +%end + +%if {comment} %then $tb {comment} %end + +%if {decl-in-table} %then $tb %end + $br +%if %not {decl-in-table} %then $br %end diff --git a/assets/schemas/xml/conversion.sch b/assets/schemas/xml/conversion.sch new file mode 100644 index 0000000000..990854c5de --- /dev/null +++ b/assets/schemas/xml/conversion.sch @@ -0,0 +1,30 @@ +# XML definition for type encoding conversion +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +{schema} +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +{function} + + $br $br diff --git a/assets/schemas/xml/customidxs.sch b/assets/schemas/xml/customidxs.sch new file mode 100644 index 0000000000..ff20ceece3 --- /dev/null +++ b/assets/schemas/xml/customidxs.sch @@ -0,0 +1,6 @@ +# XML definition for custom object indexes in tables +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$br $tb [ $br +{objects} +$tb diff --git a/assets/schemas/xml/database.sch b/assets/schemas/xml/database.sch new file mode 100644 index 0000000000..bfcf590411 --- /dev/null +++ b/assets/schemas/xml/database.sch @@ -0,0 +1,34 @@ +# XML definition for tablespaces +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {owner} %then {owner} %end +%if {tablespace} %then {tablespace} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + + $br $br diff --git a/assets/schemas/xml/dbmodel.sch b/assets/schemas/xml/dbmodel.sch new file mode 100644 index 0000000000..fe7cb263be --- /dev/null +++ b/assets/schemas/xml/dbmodel.sch @@ -0,0 +1,96 @@ +# XML definition for database model +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + $br +[] $br + $br +%if {objects} %then {objects} %end +%if {permission} %then {permission} %end +%if {changelog} %then {changelog} %end + $br diff --git a/assets/schemas/xml/domain.sch b/assets/schemas/xml/domain.sch new file mode 100644 index 0000000000..1c2a18c3c2 --- /dev/null +++ b/assets/schemas/xml/domain.sch @@ -0,0 +1,41 @@ +# XML definition for domains +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br +%else + + #%if {constraint} %then + # [ constraint=] "{constraint}" + #%end + + [ not-null=] %if {not-null} %then "true" %else "false" %end + %if {default-value} %then [ default-value=] "&{default-value}" %end + + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + {schema} + %if {owner} %then {owner} %end + %if {collation} %then {collation} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + {type} + + %if {constraints} %then + {constraints} + %end + + $br $br +%end diff --git a/assets/schemas/xml/domconstraint.sch b/assets/schemas/xml/domconstraint.sch new file mode 100644 index 0000000000..1eb8adccda --- /dev/null +++ b/assets/schemas/xml/domconstraint.sch @@ -0,0 +1,8 @@ +# XML definition for domain's check constraint +# PostgreSQL Version: 9.x +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb [] $br +$tb $tb $sp $sp $br +$tb [] $br diff --git a/schemas/xml/dtd/aggregate.dtd b/assets/schemas/xml/dtd/aggregate.dtd similarity index 100% rename from schemas/xml/dtd/aggregate.dtd rename to assets/schemas/xml/dtd/aggregate.dtd diff --git a/assets/schemas/xml/dtd/baseelements.dtd b/assets/schemas/xml/dtd/baseelements.dtd new file mode 100644 index 0000000000..e59cfc6855 --- /dev/null +++ b/assets/schemas/xml/dtd/baseelements.dtd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/xml/dtd/basetype.dtd b/assets/schemas/xml/dtd/basetype.dtd similarity index 100% rename from schemas/xml/dtd/basetype.dtd rename to assets/schemas/xml/dtd/basetype.dtd diff --git a/schemas/xml/dtd/cast.dtd b/assets/schemas/xml/dtd/cast.dtd similarity index 100% rename from schemas/xml/dtd/cast.dtd rename to assets/schemas/xml/dtd/cast.dtd diff --git a/assets/schemas/xml/dtd/changelog.dtd b/assets/schemas/xml/dtd/changelog.dtd new file mode 100644 index 0000000000..2b44a79887 --- /dev/null +++ b/assets/schemas/xml/dtd/changelog.dtd @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/assets/schemas/xml/dtd/collation.dtd b/assets/schemas/xml/dtd/collation.dtd new file mode 100644 index 0000000000..7a067b87be --- /dev/null +++ b/assets/schemas/xml/dtd/collation.dtd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/assets/schemas/xml/dtd/column.dtd b/assets/schemas/xml/dtd/column.dtd new file mode 100644 index 0000000000..0a8fde39b1 --- /dev/null +++ b/assets/schemas/xml/dtd/column.dtd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + diff --git a/schemas/xml/dtd/constraint.dtd b/assets/schemas/xml/dtd/constraint.dtd similarity index 91% rename from schemas/xml/dtd/constraint.dtd rename to assets/schemas/xml/dtd/constraint.dtd index be1946fbdb..5d0c6f9a23 100644 --- a/schemas/xml/dtd/constraint.dtd +++ b/assets/schemas/xml/dtd/constraint.dtd @@ -1,12 +1,14 @@ - + + diff --git a/schemas/xml/dtd/conversion.dtd b/assets/schemas/xml/dtd/conversion.dtd similarity index 100% rename from schemas/xml/dtd/conversion.dtd rename to assets/schemas/xml/dtd/conversion.dtd diff --git a/schemas/xml/dtd/customidxs.dtd b/assets/schemas/xml/dtd/customidxs.dtd similarity index 100% rename from schemas/xml/dtd/customidxs.dtd rename to assets/schemas/xml/dtd/customidxs.dtd diff --git a/schemas/xml/dtd/database.dtd b/assets/schemas/xml/dtd/database.dtd similarity index 100% rename from schemas/xml/dtd/database.dtd rename to assets/schemas/xml/dtd/database.dtd diff --git a/assets/schemas/xml/dtd/dbmodel.dtd b/assets/schemas/xml/dtd/dbmodel.dtd new file mode 100644 index 0000000000..eaff3f8c1c --- /dev/null +++ b/assets/schemas/xml/dtd/dbmodel.dtd @@ -0,0 +1,112 @@ + + +%baseelements; + +%basetype; + +%object; + +%simplecol; + +%reference; + +%role; + +%tablespace; + +%database; + +%schema; + +%language; + +%parameter; + +%function; + +%usertype; + +%cast; + +%conversion; + +%operator; + +%opfamily; + +%opclass; + +%aggregate; + +%domain; + +%index; + +%rule; + +%trigger; + +%table; + +%sequence; + +%view; + +%textbox; + +%relationship; + +%permission; + +%collation; + +%extension; + +%tag; + +%customidxs; + +%eventtrigger; + +%genericsql; + +%policy; + +%foreigndatawrapper; + +%foreignserver; + +%usermapping; + +%foreigntable; + +%transform; + +%procedure; + +%changelog; + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/xml/dtd/domain.dtd b/assets/schemas/xml/dtd/domain.dtd similarity index 100% rename from schemas/xml/dtd/domain.dtd rename to assets/schemas/xml/dtd/domain.dtd diff --git a/schemas/xml/dtd/element.dtd b/assets/schemas/xml/dtd/element.dtd similarity index 100% rename from schemas/xml/dtd/element.dtd rename to assets/schemas/xml/dtd/element.dtd diff --git a/schemas/xml/dtd/eventtrigger.dtd b/assets/schemas/xml/dtd/eventtrigger.dtd similarity index 100% rename from schemas/xml/dtd/eventtrigger.dtd rename to assets/schemas/xml/dtd/eventtrigger.dtd diff --git a/schemas/xml/dtd/extension.dtd b/assets/schemas/xml/dtd/extension.dtd similarity index 84% rename from schemas/xml/dtd/extension.dtd rename to assets/schemas/xml/dtd/extension.dtd index 7deb70a313..9c1ae7bec2 100644 --- a/schemas/xml/dtd/extension.dtd +++ b/assets/schemas/xml/dtd/extension.dtd @@ -2,7 +2,7 @@ CAUTION: Do not modify this file directly on it's code unless you know what you are doing. Unexpected results may occur if the code is changed deliberately. --> - + diff --git a/assets/schemas/xml/dtd/foreigndatawrapper.dtd b/assets/schemas/xml/dtd/foreigndatawrapper.dtd new file mode 100644 index 0000000000..78b4689c6e --- /dev/null +++ b/assets/schemas/xml/dtd/foreigndatawrapper.dtd @@ -0,0 +1,9 @@ + + + + + + diff --git a/assets/schemas/xml/dtd/foreignserver.dtd b/assets/schemas/xml/dtd/foreignserver.dtd new file mode 100644 index 0000000000..b9abb46e87 --- /dev/null +++ b/assets/schemas/xml/dtd/foreignserver.dtd @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/assets/schemas/xml/dtd/foreigntable.dtd b/assets/schemas/xml/dtd/foreigntable.dtd new file mode 100644 index 0000000000..647ef0e08e --- /dev/null +++ b/assets/schemas/xml/dtd/foreigntable.dtd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/schemas/xml/dtd/function.dtd b/assets/schemas/xml/dtd/function.dtd new file mode 100644 index 0000000000..180e0fcea1 --- /dev/null +++ b/assets/schemas/xml/dtd/function.dtd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/schemas/xml/dtd/genericsql.dtd b/assets/schemas/xml/dtd/genericsql.dtd similarity index 85% rename from schemas/xml/dtd/genericsql.dtd rename to assets/schemas/xml/dtd/genericsql.dtd index 40ec0a02f5..edfc49aa28 100644 --- a/schemas/xml/dtd/genericsql.dtd +++ b/assets/schemas/xml/dtd/genericsql.dtd @@ -2,7 +2,7 @@ CAUTION: Do not modify this file directly on it's code unless you know what you are doing. Unexpected results may occur if the code is changed deliberately. --> - + diff --git a/schemas/xml/dtd/index.dtd b/assets/schemas/xml/dtd/index.dtd similarity index 86% rename from schemas/xml/dtd/index.dtd rename to assets/schemas/xml/dtd/index.dtd index f7d02fe9e3..acd7137c54 100644 --- a/schemas/xml/dtd/index.dtd +++ b/assets/schemas/xml/dtd/index.dtd @@ -1,10 +1,12 @@ - - + + + diff --git a/schemas/xml/dtd/label.dtd b/assets/schemas/xml/dtd/label.dtd similarity index 100% rename from schemas/xml/dtd/label.dtd rename to assets/schemas/xml/dtd/label.dtd diff --git a/schemas/xml/dtd/language.dtd b/assets/schemas/xml/dtd/language.dtd similarity index 100% rename from schemas/xml/dtd/language.dtd rename to assets/schemas/xml/dtd/language.dtd diff --git a/assets/schemas/xml/dtd/metadata.dtd b/assets/schemas/xml/dtd/metadata.dtd new file mode 100644 index 0000000000..5dc502ee98 --- /dev/null +++ b/assets/schemas/xml/dtd/metadata.dtd @@ -0,0 +1,57 @@ + + +%baseelements; + + +%label; + + +%textbox; + + +%tag; + + +%object; + + +%genericsql; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/schemas/xml/dtd/object.dtd b/assets/schemas/xml/dtd/object.dtd new file mode 100644 index 0000000000..a55fc52da5 --- /dev/null +++ b/assets/schemas/xml/dtd/object.dtd @@ -0,0 +1,9 @@ + + + + + + diff --git a/schemas/xml/dtd/opclass.dtd b/assets/schemas/xml/dtd/opclass.dtd similarity index 100% rename from schemas/xml/dtd/opclass.dtd rename to assets/schemas/xml/dtd/opclass.dtd diff --git a/schemas/xml/dtd/operator.dtd b/assets/schemas/xml/dtd/operator.dtd similarity index 100% rename from schemas/xml/dtd/operator.dtd rename to assets/schemas/xml/dtd/operator.dtd diff --git a/schemas/xml/dtd/opfamily.dtd b/assets/schemas/xml/dtd/opfamily.dtd similarity index 100% rename from schemas/xml/dtd/opfamily.dtd rename to assets/schemas/xml/dtd/opfamily.dtd diff --git a/assets/schemas/xml/dtd/parameter.dtd b/assets/schemas/xml/dtd/parameter.dtd new file mode 100644 index 0000000000..23c9c3c698 --- /dev/null +++ b/assets/schemas/xml/dtd/parameter.dtd @@ -0,0 +1,10 @@ + + + + + + + diff --git a/schemas/xml/dtd/permission.dtd b/assets/schemas/xml/dtd/permission.dtd similarity index 77% rename from schemas/xml/dtd/permission.dtd rename to assets/schemas/xml/dtd/permission.dtd index f7db5da3d0..a470a5c0ca 100644 --- a/schemas/xml/dtd/permission.dtd +++ b/assets/schemas/xml/dtd/permission.dtd @@ -21,10 +21,3 @@ - - - - - - - diff --git a/schemas/xml/dtd/policy.dtd b/assets/schemas/xml/dtd/policy.dtd similarity index 93% rename from schemas/xml/dtd/policy.dtd rename to assets/schemas/xml/dtd/policy.dtd index bc5c4d06b3..eba99706e2 100644 --- a/schemas/xml/dtd/policy.dtd +++ b/assets/schemas/xml/dtd/policy.dtd @@ -4,6 +4,7 @@ --> + diff --git a/assets/schemas/xml/dtd/procedure.dtd b/assets/schemas/xml/dtd/procedure.dtd new file mode 100644 index 0000000000..0a2df993bb --- /dev/null +++ b/assets/schemas/xml/dtd/procedure.dtd @@ -0,0 +1,10 @@ + + + + + + + diff --git a/assets/schemas/xml/dtd/reference.dtd b/assets/schemas/xml/dtd/reference.dtd new file mode 100644 index 0000000000..4ab5b67b21 --- /dev/null +++ b/assets/schemas/xml/dtd/reference.dtd @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/schemas/xml/dtd/relationship.dtd b/assets/schemas/xml/dtd/relationship.dtd similarity index 88% rename from schemas/xml/dtd/relationship.dtd rename to assets/schemas/xml/dtd/relationship.dtd index 01baad3ad9..92651ae4fb 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/assets/schemas/xml/dtd/relationship.dtd @@ -5,11 +5,13 @@ %label; - + + + - + @@ -19,6 +21,7 @@ + @@ -27,6 +30,7 @@ + diff --git a/schemas/xml/dtd/role.dtd b/assets/schemas/xml/dtd/role.dtd similarity index 88% rename from schemas/xml/dtd/role.dtd rename to assets/schemas/xml/dtd/role.dtd index da52230792..9cbf9dd248 100644 --- a/schemas/xml/dtd/role.dtd +++ b/assets/schemas/xml/dtd/role.dtd @@ -1,4 +1,4 @@ - @@ -12,7 +12,6 @@ - @@ -20,4 +19,4 @@ - + diff --git a/schemas/xml/dtd/rule.dtd b/assets/schemas/xml/dtd/rule.dtd similarity index 93% rename from schemas/xml/dtd/rule.dtd rename to assets/schemas/xml/dtd/rule.dtd index a340b78336..0ce3103323 100644 --- a/schemas/xml/dtd/rule.dtd +++ b/assets/schemas/xml/dtd/rule.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/schema.dtd b/assets/schemas/xml/dtd/schema.dtd similarity index 80% rename from schemas/xml/dtd/schema.dtd rename to assets/schemas/xml/dtd/schema.dtd index 8e17e3fc82..05eb223850 100644 --- a/schemas/xml/dtd/schema.dtd +++ b/assets/schemas/xml/dtd/schema.dtd @@ -1,11 +1,14 @@ - + + + diff --git a/schemas/xml/dtd/sequence.dtd b/assets/schemas/xml/dtd/sequence.dtd similarity index 100% rename from schemas/xml/dtd/sequence.dtd rename to assets/schemas/xml/dtd/sequence.dtd diff --git a/assets/schemas/xml/dtd/simplecol.dtd b/assets/schemas/xml/dtd/simplecol.dtd new file mode 100644 index 0000000000..c558942b08 --- /dev/null +++ b/assets/schemas/xml/dtd/simplecol.dtd @@ -0,0 +1,8 @@ + + + + + diff --git a/assets/schemas/xml/dtd/table.dtd b/assets/schemas/xml/dtd/table.dtd new file mode 100644 index 0000000000..a01ca763f6 --- /dev/null +++ b/assets/schemas/xml/dtd/table.dtd @@ -0,0 +1,36 @@ + + +%column; + +%constraint; + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/xml/dtd/tablespace.dtd b/assets/schemas/xml/dtd/tablespace.dtd similarity index 100% rename from schemas/xml/dtd/tablespace.dtd rename to assets/schemas/xml/dtd/tablespace.dtd diff --git a/schemas/xml/dtd/tag.dtd b/assets/schemas/xml/dtd/tag.dtd similarity index 82% rename from schemas/xml/dtd/tag.dtd rename to assets/schemas/xml/dtd/tag.dtd index 72cdefd1f3..0fe1591be4 100644 --- a/schemas/xml/dtd/tag.dtd +++ b/assets/schemas/xml/dtd/tag.dtd @@ -8,4 +8,4 @@ - + diff --git a/schemas/xml/dtd/textbox.dtd b/assets/schemas/xml/dtd/textbox.dtd similarity index 81% rename from schemas/xml/dtd/textbox.dtd rename to assets/schemas/xml/dtd/textbox.dtd index 5c3c86984a..5256fc600a 100644 --- a/schemas/xml/dtd/textbox.dtd +++ b/assets/schemas/xml/dtd/textbox.dtd @@ -1,9 +1,10 @@ - + @@ -11,3 +12,5 @@ + + diff --git a/assets/schemas/xml/dtd/transform.dtd b/assets/schemas/xml/dtd/transform.dtd new file mode 100644 index 0000000000..b4215616cb --- /dev/null +++ b/assets/schemas/xml/dtd/transform.dtd @@ -0,0 +1,7 @@ + + + + diff --git a/schemas/xml/dtd/trigger.dtd b/assets/schemas/xml/dtd/trigger.dtd similarity index 87% rename from schemas/xml/dtd/trigger.dtd rename to assets/schemas/xml/dtd/trigger.dtd index 22d745cd16..6c6f8672f9 100644 --- a/schemas/xml/dtd/trigger.dtd +++ b/assets/schemas/xml/dtd/trigger.dtd @@ -4,6 +4,7 @@ --> + @@ -18,3 +19,5 @@ + + diff --git a/assets/schemas/xml/dtd/usermapping.dtd b/assets/schemas/xml/dtd/usermapping.dtd new file mode 100644 index 0000000000..bf99399153 --- /dev/null +++ b/assets/schemas/xml/dtd/usermapping.dtd @@ -0,0 +1,9 @@ + + + + + + diff --git a/schemas/xml/dtd/usertype.dtd b/assets/schemas/xml/dtd/usertype.dtd similarity index 93% rename from schemas/xml/dtd/usertype.dtd rename to assets/schemas/xml/dtd/usertype.dtd index 6883df89ee..223d14841e 100644 --- a/schemas/xml/dtd/usertype.dtd +++ b/assets/schemas/xml/dtd/usertype.dtd @@ -1,8 +1,8 @@ - - + @@ -19,7 +19,7 @@ - + diff --git a/assets/schemas/xml/dtd/view.dtd b/assets/schemas/xml/dtd/view.dtd new file mode 100644 index 0000000000..74c405f5ff --- /dev/null +++ b/assets/schemas/xml/dtd/view.dtd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/schemas/xml/element.sch b/assets/schemas/xml/element.sch new file mode 100644 index 0000000000..6eae11f925 --- /dev/null +++ b/assets/schemas/xml/element.sch @@ -0,0 +1,16 @@ +# XML definition for operator classes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [ $br +$tb {definition} +$tb $br diff --git a/assets/schemas/xml/entry.sch b/assets/schemas/xml/entry.sch new file mode 100644 index 0000000000..9b9d97e0f3 --- /dev/null +++ b/assets/schemas/xml/entry.sch @@ -0,0 +1,4 @@ +# XML definition for database model changelog entries +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$br $tb diff --git a/assets/schemas/xml/enumeration.sch b/assets/schemas/xml/enumeration.sch new file mode 100644 index 0000000000..86d0a55650 --- /dev/null +++ b/assets/schemas/xml/enumeration.sch @@ -0,0 +1,4 @@ +# XML definition for enumeration labels in user-defined types +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [ $br \ No newline at end of file diff --git a/assets/schemas/xml/eventtrigger.sch b/assets/schemas/xml/eventtrigger.sch new file mode 100644 index 0000000000..045ffe8b8a --- /dev/null +++ b/assets/schemas/xml/eventtrigger.sch @@ -0,0 +1,28 @@ +# XML definition for event triggers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {function} %then {function} %end +%if {filter} %then {filter} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + + $br $br + diff --git a/assets/schemas/xml/excelement.sch b/assets/schemas/xml/excelement.sch new file mode 100644 index 0000000000..173a1fcc3d --- /dev/null +++ b/assets/schemas/xml/excelement.sch @@ -0,0 +1,31 @@ +# XML definition for exclude constraint elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $tb $br + +%if {column} %then + $tb $tb $tb [ $br +%else + #%if {expression} %then + $tb $tb $tb $sp $sp $br + #%end +%end + +%if {opclass} %then + $tb $tb $tb {opclass} +%end + +#%if {operator} %then +$tb $tb $tb {operator} +#%end + +$tb $tb $br diff --git a/assets/schemas/xml/extension.sch b/assets/schemas/xml/extension.sch new file mode 100644 index 0000000000..7615816c95 --- /dev/null +++ b/assets/schemas/xml/extension.sch @@ -0,0 +1,37 @@ +# XML definition for extensions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {schema} %then + {schema} +%end + +%if {comment} %then {comment} %end + +%if {objects} %then + {objects} +%end + +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + + $br $br diff --git a/assets/schemas/xml/foreigndatawrapper.sch b/assets/schemas/xml/foreigndatawrapper.sch new file mode 100644 index 0000000000..5b083765bf --- /dev/null +++ b/assets/schemas/xml/foreigndatawrapper.sch @@ -0,0 +1,37 @@ +# XML definition for indexes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {reduced-form} %then + $tb +%end + +[ $br +%else + %if {options} %then + [ options=] "&{options}" + %end + + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + %if {handler} %then {handler} %end + %if {validator} %then {validator} %end + + $br $br +%end diff --git a/assets/schemas/xml/foreignserver.sch b/assets/schemas/xml/foreignserver.sch new file mode 100644 index 0000000000..4336d624b3 --- /dev/null +++ b/assets/schemas/xml/foreignserver.sch @@ -0,0 +1,41 @@ +# XML definition for servers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {reduced-form} %then $tb %end + +[ $br +%else + %if {type} %then + [ type=] "&{type}" + %end + + %if {version} %then + [ version=] "&{version}" + %end + + %if {options} %then + [ options=] "&{options}" + %end + + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + %if {fdw} %then {fdw} %end + + $br $br +%end diff --git a/assets/schemas/xml/foreigntable.sch b/assets/schemas/xml/foreigntable.sch new file mode 100644 index 0000000000..c68a584934 --- /dev/null +++ b/assets/schemas/xml/foreigntable.sch @@ -0,0 +1,42 @@ +# XML definition for tables +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +{schema} +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +{server} +%if {tag} %then {tag} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end +{position} + +%if {columns} %then {columns} %end +%if {constraints} %then {constraints} %end + +%if {col-indexes} %then {col-indexes} %end +%if {constr-indexes} %then {constr-indexes} %end + +%if {initial-data} %then + $tb $br + + $br $tb $br +%end + + + $br $br diff --git a/assets/schemas/xml/function.sch b/assets/schemas/xml/function.sch new file mode 100644 index 0000000000..37f81af008 --- /dev/null +++ b/assets/schemas/xml/function.sch @@ -0,0 +1,85 @@ +# XML definition for functions +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then $tb %end + + $br +%else + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + $br + $tb $tb window-func=%if {window-func} %then "true" %else "false" %end $br + + %if {leakproof} %then $tb $tb leakproof="true" $br %end + + $tb $tb returns-setof=%if {returns-setof} %then "true" %else "false" %end $br + $tb $tb behavior-type="{behavior-type}" $br + $tb $tb function-type="{function-type}" $br + $tb $tb security-type="{security-type}" $br + $tb $tb parallel-type="{parallel-type}" $br + $tb $tb execution-cost="{execution-cost}" $br + $tb $tb row-amount="{row-amount}" + > $br + + {schema} + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + %if {language} %then {language} %end + + $tb $br + + %if {return-table} %then + {return-table} + %else + {return-type} + %end + + $tb $br + + %if {transform-types} %then + $tb [ $br + %end + + %if {config-params} %then + {config-params} + %end + + %if {parameters} %then {parameters} %end + + + %if {library} %then + $tb [ $br + + %else + $tb $sp $sp $br + %end + + $br $br +%end diff --git a/assets/schemas/xml/genericsql.sch b/assets/schemas/xml/genericsql.sch new file mode 100644 index 0000000000..a6c815bdb5 --- /dev/null +++ b/assets/schemas/xml/genericsql.sch @@ -0,0 +1,26 @@ +# XML definition for generic sql objects +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {references} %then + {references} +%end + +$tb $sp $sp $br + +%if {comment} %then + {comment} +%end + + $br $br diff --git a/assets/schemas/xml/idxelement.sch b/assets/schemas/xml/idxelement.sch new file mode 100644 index 0000000000..62706517a9 --- /dev/null +++ b/assets/schemas/xml/idxelement.sch @@ -0,0 +1,31 @@ +# XML definition for indexes elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $tb $br + +%if {column} %then + $tb $tb $tb [ $br +%else + #%if {expression} %then + $tb $tb $tb $sp $sp $br + #%end +%end + +%if {collation} %then + $tb $tb {collation} +%end + +%if {opclass} %then + $tb $tb $tb {opclass} +%end + +$tb $tb $br diff --git a/assets/schemas/xml/index.sch b/assets/schemas/xml/index.sch new file mode 100644 index 0000000000..fca571cc55 --- /dev/null +++ b/assets/schemas/xml/index.sch @@ -0,0 +1,47 @@ +# XML definition for indexes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[ $br + +%if {tablespace} %then {tablespace} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +{elements} + +%if {predicate} %then + $tb $sp $sp $br +%end + +%if {include-cols} %then + $tb [] $br +%end + + $br $br diff --git a/assets/schemas/xml/info.sch b/assets/schemas/xml/info.sch new file mode 100644 index 0000000000..b4eeb4e028 --- /dev/null +++ b/assets/schemas/xml/info.sch @@ -0,0 +1,108 @@ +# XML definition for a single object's metadata +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%set {space} $br $tb $tb + +$tb [ $br + %if {position} %then {position} %end + %if {appended-sql} %then $tb {appended-sql} %end + %if {prepended-sql} %then $tb {prepended-sql} %end + $tb +%else + [/>] +%end + +$br diff --git a/assets/schemas/xml/label.sch b/assets/schemas/xml/label.sch new file mode 100644 index 0000000000..a1dca9825a --- /dev/null +++ b/assets/schemas/xml/label.sch @@ -0,0 +1,6 @@ +# XML definition for relationship label positioning +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $br \ No newline at end of file diff --git a/assets/schemas/xml/language.sch b/assets/schemas/xml/language.sch new file mode 100644 index 0000000000..aa3a2781d3 --- /dev/null +++ b/assets/schemas/xml/language.sch @@ -0,0 +1,34 @@ +# XML definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {reduced-form} %then $tb %end + +[] $br +%else + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + [ trusted=] %if {trusted} %then "true" %else "false" %end + + [>]$br + + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + %if {handler} %then {handler} %end + %if {validator} %then {validator} %end + %if {inline} %then {inline} %end + + $br $br +%end diff --git a/assets/schemas/xml/metadata.sch b/assets/schemas/xml/metadata.sch new file mode 100644 index 0000000000..b0cba3a577 --- /dev/null +++ b/assets/schemas/xml/metadata.sch @@ -0,0 +1,11 @@ +# XML definition for graphical object metada file +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + $br +[] $br + $br +%if {info} %then {info} %end + diff --git a/assets/schemas/xml/object.sch b/assets/schemas/xml/object.sch new file mode 100644 index 0000000000..b7469f1886 --- /dev/null +++ b/assets/schemas/xml/object.sch @@ -0,0 +1,12 @@ +# XML definition for custom index for a single column or constraint +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {index} %then $tb %end +$tb [ $br diff --git a/assets/schemas/xml/opclass.sch b/assets/schemas/xml/opclass.sch new file mode 100644 index 0000000000..c566376ea3 --- /dev/null +++ b/assets/schemas/xml/opclass.sch @@ -0,0 +1,43 @@ +# XML definition for operator classes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br +%else + + [ index-type=] "{index-type}" + [ default=] %if {default} %then "true" %else "false" %end + + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + {schema} + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + %if {family} %then + $tb [] $br + %end + + {type} + {elements} + + $br $br +%end diff --git a/assets/schemas/xml/operator.sch b/assets/schemas/xml/operator.sch new file mode 100644 index 0000000000..f0d7a8ce3d --- /dev/null +++ b/assets/schemas/xml/operator.sch @@ -0,0 +1,45 @@ +# XML definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then $tb %end + +[ $br +%else + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + {schema} + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + %if {left-type} %then {left-type} %end + %if {right-type} %then {right-type} %end + + + %if {commutator-op} %then {commutator-op} %end + %if {negator-op} %then {negator-op} %end + %if {operfunc} %then {operfunc} %end + %if {join} %then {join} %end + %if {restriction} %then {restriction} %end + + $br $br +%end diff --git a/assets/schemas/xml/opfamily.sch b/assets/schemas/xml/opfamily.sch new file mode 100644 index 0000000000..2b43768c61 --- /dev/null +++ b/assets/schemas/xml/opfamily.sch @@ -0,0 +1,30 @@ +# XML definition for operator families +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {reduced-form} %then $tb %end + +[ $br +%else + [name=] "&{name}" [ index-type=] "{index-type}" + + %if {protected} %then + [ protected=] "true" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + > $br + + {schema} + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + $br $br +%end diff --git a/assets/schemas/xml/parameter.sch b/assets/schemas/xml/parameter.sch new file mode 100644 index 0000000000..10ba6adb7a --- /dev/null +++ b/assets/schemas/xml/parameter.sch @@ -0,0 +1,13 @@ +# XML definition for function parameters +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [$br + +$tb {type} + +$tb $br diff --git a/assets/schemas/xml/partitionkey.sch b/assets/schemas/xml/partitionkey.sch new file mode 100644 index 0000000000..0a61bf6eda --- /dev/null +++ b/assets/schemas/xml/partitionkey.sch @@ -0,0 +1,20 @@ +# XML definition for indexes elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $tb $br + +%if {column} %then + $tb $tb $tb [ $br +%else + $tb $tb $tb $sp $sp $br +%end + +%if {collation} %then + $tb $tb {collation} +%end + +%if {opclass} %then + $tb $tb $tb {opclass} +%end + +$tb $tb $br diff --git a/assets/schemas/xml/permission.sch b/assets/schemas/xml/permission.sch new file mode 100644 index 0000000000..23032d6028 --- /dev/null +++ b/assets/schemas/xml/permission.sch @@ -0,0 +1,48 @@ +# XML definition for grants +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + $br + + +$tb [] $br + +%if {roles} %then + $tb [] $br +%end + +$tb [] $br + + $br diff --git a/assets/schemas/xml/policy.sch b/assets/schemas/xml/policy.sch new file mode 100644 index 0000000000..f23f9d5b16 --- /dev/null +++ b/assets/schemas/xml/policy.sch @@ -0,0 +1,35 @@ +# XML definition for policies +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[ + +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +%if {roles} %then + $tb [] +%end + +%if {using-exp} %then + $br $tb [] $sp $sp +%end + +%if {check-exp} %then + $br $tb [] $sp $sp +%end + +$br $br $br diff --git a/assets/schemas/xml/position.sch b/assets/schemas/xml/position.sch new file mode 100644 index 0000000000..de227501b6 --- /dev/null +++ b/assets/schemas/xml/position.sch @@ -0,0 +1,5 @@ +# XML definition for object positioning +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb [ $br diff --git a/assets/schemas/xml/prependedsql.sch b/assets/schemas/xml/prependedsql.sch new file mode 100644 index 0000000000..d241a46050 --- /dev/null +++ b/assets/schemas/xml/prependedsql.sch @@ -0,0 +1,9 @@ +# XML definition for prepended SQL commands +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +#Creates element envolving the prepended-sql +#The tag is converted to in order +#to not cause syntax errors on the schema parser + +$tb $sp $sp $br diff --git a/assets/schemas/xml/procedure.sch b/assets/schemas/xml/procedure.sch new file mode 100644 index 0000000000..1798ad052c --- /dev/null +++ b/assets/schemas/xml/procedure.sch @@ -0,0 +1,41 @@ +# XML definition for procedures +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + + $br + +{schema} + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end +%if {language} %then {language} %end + +%if {transform-types} %then + $tb [ $br +%end + +%if {config-params} %then + {config-params} +%end + +%if {parameters} %then {parameters} %end + +%if {library} %then + $tb [ $br +%else + $tb $sp $sp $br +%end + + $br $br diff --git a/assets/schemas/xml/reference.sch b/assets/schemas/xml/reference.sch new file mode 100644 index 0000000000..7aef45bba8 --- /dev/null +++ b/assets/schemas/xml/reference.sch @@ -0,0 +1,15 @@ +# XML definition for view / generic SQL references +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $br diff --git a/assets/schemas/xml/reftable.sch b/assets/schemas/xml/reftable.sch new file mode 100644 index 0000000000..a4ea2e787c --- /dev/null +++ b/assets/schemas/xml/reftable.sch @@ -0,0 +1,5 @@ +# XML definition for view references +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb $tb [] $br diff --git a/assets/schemas/xml/relationship.sch b/assets/schemas/xml/relationship.sch new file mode 100644 index 0000000000..ba3994d88c --- /dev/null +++ b/assets/schemas/xml/relationship.sch @@ -0,0 +1,126 @@ +# XML definition for relationships +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br $br +%else + > $br + + %if {points} %then $tb $br $tb {points} $tb $br %end + %if {labels-pos} %then {labels-pos} %end + + %if %not {relgen} %and %not {reldep} %and %not {relpart} %then + %if {columns} %then {columns} %end + %if {constraints} %then {constraints} %end + %end + + %if {original-pk} %then + {original-pk} + %end + + %if {special-pk-cols} %then + $tb [ $br + %end + + %if {partition-bound-expr} %then + $tb $sp $sp $br + %end + + $br $br +%end diff --git a/assets/schemas/xml/role.sch b/assets/schemas/xml/role.sch new file mode 100644 index 0000000000..5621eb53d0 --- /dev/null +++ b/assets/schemas/xml/role.sch @@ -0,0 +1,39 @@ +# XML definition for roles +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then $tb %end +[ $br +%else + %if {superuser} %then $br [ superuser="true"] %end + %if {createdb} %then $br [ createdb="true"] %end + %if {replication} %then $br [ replication="true"] %end + %if {createrole} %then $br [ createrole="true"] %end + %if {inherit} %then $br [ inherit="true"] %end + %if {login} %then $br [ login="true"] %end + %if {bypassrls} %then $br [ bypassrls="true"] %end + %if {connlimit} %then $br [ connlimit=]"{connlimit}" %end + %if {validity} %then $br [ validity=]"{validity}" %end + %if {password} %then $br [ password=]"&{password}" %end + + %if {protected} %then + $br [ protected="true"] + %end + + %if {sql-disabled} %then + $br [ sql-disabled="true"] + %end + + > $br + + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + %if {member-roles} %then $tb [] $br %end + %if {admin-roles} %then $tb [] $br %end + + $br $br +%end diff --git a/assets/schemas/xml/rule.sch b/assets/schemas/xml/rule.sch new file mode 100644 index 0000000000..8f99dc3b78 --- /dev/null +++ b/assets/schemas/xml/rule.sch @@ -0,0 +1,37 @@ +# XML definition for indexes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +%if {comment} %then $tb {comment} %end + +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +%if {condition} %then + $tb $tb $sp $sp $br +%end + +%if {commands} %then + $tb $tb $sp $sp $br +%end + + $br $br diff --git a/assets/schemas/xml/schema.sch b/assets/schemas/xml/schema.sch new file mode 100644 index 0000000000..9a286e93b7 --- /dev/null +++ b/assets/schemas/xml/schema.sch @@ -0,0 +1,50 @@ +# XML definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then $tb %end +[ $br +%else + %if {layers} %then + [ layers=] "{layers}" + %end + + %if {alias} %then + $sp alias="&{alias}" + %end + + %if {protected} %then + [ protected=] "true" + %end + + %if {rect-visible} %then + [ rect-visible=] "true" + %end + + %if {fill-color} %then + [ fill-color=] "{fill-color}" + %end + + %if {name-color} %then + [ name-color=] "{name-color}" + %end + + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end + + %if {faded-out} %then + [ faded-out=] "true" + %end + + > $br + + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + + $br $br +%end diff --git a/assets/schemas/xml/sequence.sch b/assets/schemas/xml/sequence.sch new file mode 100644 index 0000000000..6269f3445e --- /dev/null +++ b/assets/schemas/xml/sequence.sch @@ -0,0 +1,47 @@ +# XML definition for sequences +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[ $br + +{schema} +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + $br $br diff --git a/assets/schemas/xml/simplecol.sch b/assets/schemas/xml/simplecol.sch new file mode 100644 index 0000000000..d504c8082b --- /dev/null +++ b/assets/schemas/xml/simplecol.sch @@ -0,0 +1,14 @@ +# XML definition for view simple columns +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb [ $br \ No newline at end of file diff --git a/assets/schemas/xml/style.sch b/assets/schemas/xml/style.sch new file mode 100644 index 0000000000..8529e0bcf1 --- /dev/null +++ b/assets/schemas/xml/style.sch @@ -0,0 +1,7 @@ +# XML definition for object tag styles +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb [