Skip to content

silverqx/TinyORM-HelloWorld

Repository files navigation

TinyORM Logo Hello world example for TinyORM

www.tinyorm.org Building: Hello world - TinyORM - www.tinyorm.org License MIT

This Hello world example application does several things, it prepares the qmake or CMake build systems using dynamic linkage and does two simple queries against the SQLite database. The first query uses the QueryBuilder and the second one uses the ORM (Post model).

The HelloWorld.sqlite3 database contains one posts table with two records. Copy this database into the build folder, one folder up, or wherever you want, and set the correct path to it in the main.cpp file.

Copy the .qmake.conf.example to .qmake.conf, open it, and set the following qmake variable so the HelloWorld project can find the qmake/TinyOrm.pri file:

  • TINY_MAIN_DIR - Path to the folder that contains the TinyORM/ folder, it's not a path to the TinyORM source folder itself! Look at the expected Folders structure.

Copy the .env.(win32|unix|mingw).example file to .env.(win32|unix|mingw) and set the following qmake variables so the HelloWorld project can find the shared library in the TinyORM's build folder:

  • TINYORM_BUILD_TREE - Path to the TinyORM build folder.
  • TINY_VCPKG_ROOT - Path to the vcpkg installation folder. If not defined, then it tries to use the VCPKG_ROOT environment variable.
  • TINY_VCPKG_TRIPLET - The vcpkg triplet to use (vcpkg/installed/$$TINY_VCPKG_TRIPLET/). If not defined, then it tries to guess the vcpkg triplet based on the current compiler and OS (based on the QMAKESPEC), and as the last thing, it tries to use the VCPKG_DEFAULT_TRIPLET environment variable.

The qmake/TinyOrm.pri auto-configures the TinyORM library.

I will not explain all details here as everything is already described in the Building - Hello world with qmake or Building - Hello world with CMake documentation.

About

Hello world application for TinyORM C++ library

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published