Build pgModeler

Once in the icy winter ... day I needed a free tool for database design. One that could also generate scripts. I really like the Visual Paradigm , but it costs, of course, like a plane. Therefore, armed with Google and the advice of familiar developers, I went in search.

As a result, I came across a very good tool pgModeler . The only thing that didn’t really like was that he can generate sql scripts only for PostgreSQL . But since At that time (and now, and even later) this database was used, then this tool was quite enough.

He knows how, really, a lot. And to draw tables, and hang checks on the fields, and even the function allows you to write (which will be included in the final script during generation). More information about the possibilities can be found on the project website .

pgModeler is an open source project, but in order to get binaries, you need to pay a denyuzhku. Only source codes of the project are available free of charge ... Which need to be collected ... Using Qt ...

I came across Qt only once in my life - on labs in the university - and it was a long time and not true. Apparently, therefore, I had some difficulties during the assembly. Well, either because there are not so many suitable articles (in fact, at that time I found only one ), and the documentation on the assembly is very scarce.

Well, go to the assembly itself.

Environment

System: Windows 7 x64.
Version pgModeler: 0.9.2-alpha.
PostgreSQL Version: 10.4.
Qt: Qt 5.6.3 for Windows 32-bit (MinGW 4.9.2).

Assembly

The above instructions were written in accordance with the above environment.

3. Install in C: \ PostgreSQL \.
IMPORTANT!
You need to install the 32-bit version, because to build a 32-bit version of Qt, 32-bit libraries from PostgreSQL are required. You can install in any directory, but then you have to change the path in the assembly file. Also there should not be spaces in the path, otherwise the collector will try to split this path into several.
IMPORTANT!
You need to install a 32-bit version with MinGW even on a 64-bit system, since in nature, there are only 32-bit versions of Qt and MinGW that can work with each other.
5. Install Qt in C: \ Qt \ Qt5.6.3 \.
6. Add paths to Qt and MinGW in the Path environment variable.
1. Go to Computer \ System Properties \ Advanced System Settings \ Environment Variables ... \ System Variables \ Path \ Change.
qmake - C: \ Qt \ Qt5.6.3 \ 5.6.3 \ mingw49_32 \ bin.
mingw32-make - C: \ Qt \ Qt5.6.3 \ Tools \ mingw492_32 \ bin.

7. In the source in the file pgmodeler.pri, if necessary, change the path. It is best to edit the configuration file in the Qt editor to avoid problems with encodings.
8. Create a folder C: \ pgModeler for the compiled application.
9. Open cmd.
10. Go to the source folder with cd.
11. To configure the configuration files you need to run
`qmake PREFIX+=C:/pgModeler -r -spec win32-g++ CONFIG+=release pgmodeler.pro`
12. To compile the project run
`mingw32-make -j5`
13. To move the compiled files to C: \ pgModeler, run
`mingw32-make install`
14. Go to the folder with the application
`cd C:\pgModeler`
15. Copy Qt files to application folder
`windeployqt pgmodeler.exe`
16. Copy the following DLL to the application folder:
• C: \ PostgreSQL \ 10 \ bin \ libeay32.dll
• C: \ PostgreSQL \ 10 \ bin \ libiconv-2.dll
• C: \ PostgreSQL \ 10 \ bin \ libintl-8.dll
• C: \ PostgreSQL \ 10 \ bin \ libpq.dll
• C: \ PostgreSQL \ 10 \ bin \ libxml2.dll
• C: \ PostgreSQL \ 10 \ bin \ ssleay32.dll

17. To run without Qt on the system, copy the following DLLs to the folder with the application:
• C: \ Qt \ Qt5.6.3 \ 5.6.3 \ mingw49_32 \ bin \ Qt5Network.dll
• C: \ Qt \ Qt5.6.3 \ 5.6.3 \ mingw49_32 \ bin \ Qt5PrintSupport.dll

Conclusion

Here, in general, that's all. I hope this article will be useful to someone.

Tried to understand how to build this application on the basis of the article . But the instruction is a little bit crooked, incomprehensible in some places and there are unnecessary actions, for example, installing a third-party MinGW (by the way, I didn’t work with Qt 5.6.3, because of what I had to move away from this article and figure out what it was and how) or download libxml2, which is in PostgreSQL.

The official, "very useful", "understandable" and very "complete" instruction for building this application is here . True, it is written in it about the compatibility of Qt and MinGW.