├── .clang-tidy ├── .editorconfig ├── .env.mingw.example ├── .env.unix.example ├── .env.win32.example ├── .gitattributes ├── .github ├── SECURITY.md ├── resources │ ├── linux │ │ ├── crystal_client.template.cnf │ │ ├── crystal_client_ssl.template.cnf │ │ ├── crystal_mysqld.cnf │ │ └── crystal_mysqld_ssl.cnf │ ├── openssl │ │ └── usr_cert.cnf │ ├── postgresql │ │ └── conf.d │ │ │ └── 90-crystal.conf │ └── windows │ │ ├── my_5.template.ini │ │ ├── my_8.template.ini │ │ └── my_8_ssl.template.ini └── workflows │ ├── analyzers.yml │ ├── clang-cl-qt6.yml │ ├── linux-qt6-drivers.yml │ ├── linux-qt6.yml │ ├── msvc2022-qt6-drivers.yml │ ├── msvc2022-qt6.yml │ ├── msys2-ucrt64-drivers.yml │ ├── msys2-ucrt64.yml │ ├── vcpkg-linux-drivers.yml │ ├── vcpkg-linux.yml │ ├── vcpkg-windows-drivers.yml │ └── vcpkg-windows.yml ├── .gitignore ├── .qmake.conf ├── AUTHORS ├── CMakeLists.txt ├── LICENSE ├── NOTES.txt ├── README.md ├── TinyORM.pro ├── cmake ├── CommonModules │ ├── CsDebug.cmake │ ├── TinyCommon.cmake │ ├── TinyFeatureOptions.cmake │ ├── TinyHelpers.cmake │ ├── TinyMsvcParallel.cmake │ ├── TinyResourceAndManifest.cmake │ └── TinyToolchainRequirement.cmake ├── Modules │ ├── FindMySQL.cmake │ ├── GeneratePkgConfig.cmake │ ├── GeneratePkgConfig │ │ ├── generate-pkg-config.cmake.in │ │ ├── pkg-config.cmake.in │ │ └── target-compile-settings.cmake.in │ ├── TinyDeployment.cmake │ ├── TinyDrivers.cmake │ ├── TinyInitDefaultVariables.cmake │ ├── TinyOptions.cmake │ ├── TinySources.cmake │ └── TinyTestCommon.cmake ├── TinyBuildTreeConfigVersionBuildTypeReq.cmake.in ├── TinyConfigVersionBuildTypeReq.cmake.in ├── TinyOrmBuildTreeConfig.cmake.in ├── TinyOrmConfig.cmake.in ├── TinyPackageConfigHelpers.cmake └── vcpkg │ ├── README.md │ ├── ports │ └── tinyorm │ │ ├── portfile.cmake │ │ └── vcpkg.json │ ├── triplets │ └── x64-linux-dynamic.cmake │ └── usage.in ├── conf.pri.example ├── docs ├── README.mdx ├── assets │ └── img │ │ └── features-summary │ │ ├── tinyorm-passed_all_unit_tests.png │ │ ├── tinyormplayground-multi-threaded.png │ │ └── tinyormplayground-single-threaded.png ├── building │ ├── README.md │ ├── _category_.yml │ ├── assets │ │ └── img │ │ │ ├── hello-world │ │ │ ├── qmake-build_settings.png │ │ │ └── qmake-configure_project.png │ │ │ ├── migrations │ │ │ ├── qmake-build_settings.png │ │ │ ├── qmake-configure_project.png │ │ │ ├── tom_file_properties.png │ │ │ └── tom_migrate_status.png │ │ │ └── tinyorm │ │ │ ├── qmake-additional_arguments.png │ │ │ ├── qmake-build_settings.png │ │ │ └── qmake-configure_project.png │ ├── hello-world.mdx │ ├── migrations.mdx │ └── tinyorm.mdx ├── database │ ├── README.md │ ├── _category_.yml │ ├── assets │ │ └── img │ │ │ └── migrations │ │ │ └── tom_cli.png │ ├── getting-started.mdx │ ├── migrations.mdx │ ├── query-builder.mdx │ └── seeding.mdx ├── dependencies.mdx ├── donations.mdx ├── features-summary.mdx ├── stability.mdx ├── supported-compilers.mdx ├── tinydrivers │ ├── README.md │ ├── _category_.yml │ └── getting-started.mdx └── tinyorm │ ├── README.md │ ├── _category_.yml │ ├── casts.mdx │ ├── collections.mdx │ ├── getting-started.mdx │ ├── relationships.mdx │ └── serialization.mdx ├── drivers ├── CMakeLists.txt ├── common │ ├── CMakeLists.txt │ ├── common.pro │ ├── include │ │ ├── include.pri │ │ ├── orm │ │ │ └── drivers │ │ │ │ ├── concerns │ │ │ │ └── selectsallcolumnswithlimit0.hpp │ │ │ │ ├── driverstypes.hpp │ │ │ │ ├── dummysqlerror.hpp │ │ │ │ ├── exceptions │ │ │ │ ├── driverserror.hpp │ │ │ │ ├── invalidargumenterror.hpp │ │ │ │ ├── logicerror.hpp │ │ │ │ ├── outofrangeerror.hpp │ │ │ │ ├── queryerror.hpp │ │ │ │ ├── runtimeerror.hpp │ │ │ │ ├── sqlerror.hpp │ │ │ │ └── sqltransactionerror.hpp │ │ │ │ ├── libraryinfo.hpp │ │ │ │ ├── macros │ │ │ │ └── export.hpp │ │ │ │ ├── sqldatabase.hpp │ │ │ │ ├── sqldatabasemanager.hpp │ │ │ │ ├── sqldriver.hpp │ │ │ │ ├── sqlfield.hpp │ │ │ │ ├── sqlquery.hpp │ │ │ │ ├── sqlrecord.hpp │ │ │ │ ├── sqlresult.hpp │ │ │ │ ├── utils │ │ │ │ └── notnull.hpp │ │ │ │ └── version.hpp │ │ ├── pch.h │ │ └── pch.pri │ ├── include_private │ │ ├── include_private.pri │ │ └── orm │ │ │ └── drivers │ │ │ ├── config_p.hpp │ │ │ ├── constants_extern_p.hpp │ │ │ ├── constants_inline_p.hpp │ │ │ ├── constants_p.hpp │ │ │ ├── macros │ │ │ └── declaresqldriverprivate_p.hpp │ │ │ ├── sqldatabase_p.hpp │ │ │ ├── sqldriver_p.hpp │ │ │ ├── sqlresult_p.hpp │ │ │ ├── support │ │ │ ├── connectionshash_p.hpp │ │ │ ├── sqldriverfactory_p.hpp │ │ │ └── sqlrecordcache_p.hpp │ │ │ └── utils │ │ │ ├── fs_p.hpp │ │ │ └── type_p.hpp │ ├── resources │ │ ├── TinyDrivers.dll.manifest │ │ └── TinyDrivers.rc.in │ └── src │ │ ├── orm │ │ └── drivers │ │ │ ├── concerns │ │ │ └── selectsallcolumnswithlimit0.cpp │ │ │ ├── constants_extern_p.cpp │ │ │ ├── dummysqlerror.cpp │ │ │ ├── exceptions │ │ │ ├── logicerror.cpp │ │ │ ├── queryerror.cpp │ │ │ ├── runtimeerror.cpp │ │ │ └── sqlerror.cpp │ │ │ ├── libraryinfo.cpp │ │ │ ├── sqldatabase.cpp │ │ │ ├── sqldatabase_p.cpp │ │ │ ├── sqldatabasemanager.cpp │ │ │ ├── sqldriver.cpp │ │ │ ├── sqlfield.cpp │ │ │ ├── sqlquery.cpp │ │ │ ├── sqlrecord.cpp │ │ │ ├── sqlresult.cpp │ │ │ ├── sqlresult_p.cpp │ │ │ ├── support │ │ │ └── sqldriverfactory_p.cpp │ │ │ └── utils │ │ │ ├── fs_p.cpp │ │ │ └── type_p.cpp │ │ └── src.pri ├── conf.pri.example ├── drivers.pro └── mysql │ ├── CMakeLists.txt │ ├── include │ ├── include.pri │ ├── orm │ │ └── drivers │ │ │ └── mysql │ │ │ ├── mysqldriver.hpp │ │ │ ├── mysqlresult.hpp │ │ │ └── version.hpp │ ├── pch.h │ └── pch.pri │ ├── include_private │ ├── include_private.pri │ └── orm │ │ └── drivers │ │ └── mysql │ │ ├── concerns │ │ └── populatesfielddefaultvalues_p.hpp │ │ ├── macros │ │ └── includemysqlh_p.hpp │ │ ├── mysqlconstants_extern_p.hpp │ │ ├── mysqlconstants_inline_p.hpp │ │ ├── mysqlconstants_p.hpp │ │ ├── mysqldriver_p.hpp │ │ ├── mysqlresult_p.hpp │ │ ├── mysqltypes_p.hpp │ │ └── mysqlutils_p.hpp │ ├── mysql.pro │ ├── resources │ ├── TinyMySql.dll.manifest │ └── TinyMySql.rc.in │ └── src │ ├── orm │ └── drivers │ │ └── mysql │ │ ├── concerns │ │ └── populatesfielddefaultvalues_p.cpp │ │ ├── main.cpp │ │ ├── mysqlconstants_extern_p.cpp │ │ ├── mysqldriver.cpp │ │ ├── mysqldriver_p.cpp │ │ ├── mysqlresult.cpp │ │ ├── mysqlresult_p.cpp │ │ └── mysqlutils_p.cpp │ └── src.pri ├── examples ├── CMakeLists.txt ├── examples.pro └── tom │ ├── CMakeLists.txt │ ├── conf.pri.example │ ├── main.cpp │ └── tom.pro ├── include ├── include.pri ├── orm │ ├── basegrammar.hpp │ ├── concerns │ │ ├── countsqueries.hpp │ │ ├── detectslostconnections.hpp │ │ ├── explainqueries.hpp │ │ ├── hasconnectionresolver.hpp │ │ ├── logsqueries.hpp │ │ ├── managestransactions.hpp │ │ └── parsessearchpath.hpp │ ├── config.hpp │ ├── configurations │ │ ├── configurationoptionsparser.hpp │ │ ├── configurationparser.hpp │ │ ├── configurationparserfactory.hpp │ │ ├── configurationparserinterface.hpp │ │ ├── mysqlconfigurationparser.hpp │ │ ├── postgresconfigurationparser.hpp │ │ └── sqliteconfigurationparser.hpp │ ├── connectionresolverinterface.hpp │ ├── connectors │ │ ├── connectionfactory.hpp │ │ ├── connector.hpp │ │ ├── connectorinterface.hpp │ │ ├── mysqlconnector.hpp │ │ ├── postgresconnector.hpp │ │ └── sqliteconnector.hpp │ ├── constants.hpp │ ├── constants_extern.hpp │ ├── constants_inline.hpp │ ├── databaseconnection.hpp │ ├── databasemanager.hpp │ ├── db.hpp │ ├── exceptions │ │ ├── domainerror.hpp │ │ ├── invalidargumenterror.hpp │ │ ├── invalidformaterror.hpp │ │ ├── invalidtemplateargumenterror.hpp │ │ ├── logicerror.hpp │ │ ├── lostconnectionerror.hpp │ │ ├── multiplecolumnsselectederror.hpp │ │ ├── multiplerecordsfounderror.hpp │ │ ├── ormerror.hpp │ │ ├── outofrangeerror.hpp │ │ ├── queryerror.hpp │ │ ├── recordsnotfounderror.hpp │ │ ├── runtimeerror.hpp │ │ ├── searchpathemptyerror.hpp │ │ ├── sqlerror.hpp │ │ ├── sqlitedatabasedoesnotexisterror.hpp │ │ └── sqltransactionerror.hpp │ ├── libraryinfo.hpp │ ├── macros │ │ ├── archdetect.hpp │ │ ├── commonnamespace.hpp │ │ ├── compilerdetect.hpp │ │ ├── export.hpp │ │ ├── export_common.hpp │ │ ├── likely.hpp │ │ ├── logexecutedquery.hpp │ │ ├── sqldrivermappings.hpp │ │ ├── stringify.hpp │ │ ├── systemheader.hpp │ │ └── threadlocal.hpp │ ├── mysqlconnection.hpp │ ├── ormconcepts.hpp │ ├── ormtypes.hpp │ ├── postgresconnection.hpp │ ├── query │ │ ├── concerns │ │ │ └── buildsqueries.hpp │ │ ├── expression.hpp │ │ ├── grammars │ │ │ ├── grammar.hpp │ │ │ ├── mysqlgrammar.hpp │ │ │ ├── postgresgrammar.hpp │ │ │ └── sqlitegrammar.hpp │ │ ├── joinclause.hpp │ │ ├── processors │ │ │ ├── mysqlprocessor.hpp │ │ │ ├── postgresprocessor.hpp │ │ │ ├── processor.hpp │ │ │ └── sqliteprocessor.hpp │ │ └── querybuilder.hpp │ ├── schema.hpp │ ├── schema │ │ ├── blueprint.hpp │ │ ├── columndefinition.hpp │ │ ├── columndefinitionreference.hpp │ │ ├── foreignidcolumndefinitionreference.hpp │ │ ├── foreignkeydefinitionreference.hpp │ │ ├── grammars │ │ │ ├── mysqlschemagrammar.hpp │ │ │ ├── postgresschemagrammar.hpp │ │ │ ├── schemagrammar.hpp │ │ │ └── sqliteschemagrammar.hpp │ │ ├── indexdefinitionreference.hpp │ │ ├── mysqlschemabuilder.hpp │ │ ├── postgresschemabuilder.hpp │ │ ├── schemabuilder.hpp │ │ ├── schemaconstants.hpp │ │ ├── schemaconstants_extern.hpp │ │ ├── schemaconstants_inline.hpp │ │ ├── schematypes.hpp │ │ └── sqliteschemabuilder.hpp │ ├── sqliteconnection.hpp │ ├── support │ │ ├── databaseconfiguration.hpp │ │ ├── databaseconnectionsmap.hpp │ │ └── replacebindings.hpp │ ├── tiny │ │ ├── casts │ │ │ └── attribute.hpp │ │ ├── concerns │ │ │ ├── buildsqueries.hpp │ │ │ ├── buildssoftdeletes.hpp │ │ │ ├── guardedmodel.hpp │ │ │ ├── guardsattributes.hpp │ │ │ ├── hasattributes.hpp │ │ │ ├── hasrelationships.hpp │ │ │ ├── hasrelationstore.hpp │ │ │ ├── hastimestamps.hpp │ │ │ ├── hidesattributes.hpp │ │ │ └── queriesrelationships.hpp │ │ ├── exceptions │ │ │ ├── massassignmenterror.hpp │ │ │ ├── modelnotfounderror.hpp │ │ │ ├── mutatormappingnotfounderror.hpp │ │ │ ├── relationmappingnotfounderror.hpp │ │ │ └── relationnotloadederror.hpp │ │ ├── macros │ │ │ ├── crtpmodel.hpp │ │ │ ├── crtpmodelwithbase.hpp │ │ │ └── relationstoresaliases.hpp │ │ ├── model.hpp │ │ ├── modelproxies.hpp │ │ ├── relations │ │ │ ├── basepivot.hpp │ │ │ ├── belongsto.hpp │ │ │ ├── belongstomany.hpp │ │ │ ├── concerns │ │ │ │ ├── comparesrelatedmodels.hpp │ │ │ │ ├── interactswithpivottable.hpp │ │ │ │ └── supportsdefaultmodels.hpp │ │ │ ├── hasmany.hpp │ │ │ ├── hasone.hpp │ │ │ ├── hasoneormany.hpp │ │ │ ├── pivot.hpp │ │ │ ├── relation.hpp │ │ │ ├── relationproxies.hpp │ │ │ └── relationtypes.hpp │ │ ├── softdeletes.hpp │ │ ├── support │ │ │ └── stores │ │ │ │ ├── baserelationstore.hpp │ │ │ │ ├── belongstomanyrelatedtablestore.hpp │ │ │ │ ├── eagerrelationstore.hpp │ │ │ │ ├── lazyrelationstore.hpp │ │ │ │ ├── pushrelationstore.hpp │ │ │ │ ├── queriesrelationshipsstore.hpp │ │ │ │ ├── serializerelationstore.hpp │ │ │ │ └── touchownersrelationstore.hpp │ │ ├── tinybuilder.hpp │ │ ├── tinybuilderproxies.hpp │ │ ├── tinyconcepts.hpp │ │ ├── tinytypes.hpp │ │ ├── types │ │ │ ├── connectionoverride.hpp │ │ │ ├── modelattributes.hpp │ │ │ ├── modelscollection.hpp │ │ │ └── syncchanges.hpp │ │ └── utils │ │ │ └── attribute.hpp │ ├── types │ │ ├── aboutvalue.hpp │ │ ├── log.hpp │ │ ├── sqlquery.hpp │ │ └── statementscounter.hpp │ ├── utils │ │ ├── configuration.hpp │ │ ├── container.hpp │ │ ├── fs.hpp │ │ ├── helpers.hpp │ │ ├── integralcast.hpp │ │ ├── notnull.hpp │ │ ├── nullvariant.hpp │ │ ├── query.hpp │ │ ├── string.hpp │ │ ├── thread.hpp │ │ └── type.hpp │ └── version.hpp ├── pch.h └── pch.pri ├── qmake ├── TinyOrm.pri ├── common │ ├── TinyOrm.pri │ ├── common.pri │ ├── executables.pri │ ├── libraries.pri │ ├── macxconf.pri │ ├── unixconf.pri │ └── winconf.pri ├── features │ ├── ccache.prf │ ├── disable_orm.prf │ ├── disable_thread_local.prf │ ├── disable_tom.prf │ ├── extern_constants.prf │ ├── inline_constants.prf │ ├── private │ │ ├── tiny_ccache_version.prf │ │ ├── tiny_compiler_version.prf │ │ ├── tiny_debug.prf │ │ ├── tiny_dependencies_requirement.prf │ │ ├── tiny_dotenv.prf │ │ ├── tiny_drivers.prf │ │ ├── tiny_find_packages.prf │ │ ├── tiny_info_messages.prf │ │ ├── tiny_resource_and_manifest.prf │ │ ├── tiny_staticlib_check.prf │ │ ├── tiny_system_includepath.prf │ │ ├── tiny_toolchain_requirement.prf │ │ ├── tiny_vcpkg.prf │ │ └── tiny_version_numbers.prf │ ├── silent.prf │ ├── tiny_ccache_win32.prf │ ├── tiny_system_headers.prf │ └── tom_example.prf ├── support │ └── variables.pri └── tom.pri ├── resources ├── TinyOrm.dll.manifest ├── TinyOrm.rc.in └── icons │ ├── favicon.ico │ ├── logo-optim.svg │ ├── logo.png │ ├── logo.svg │ ├── logo_simple.svg │ ├── logo_text.svg │ └── tinyorm.ico ├── src ├── orm │ ├── basegrammar.cpp │ ├── concerns │ │ ├── countsqueries.cpp │ │ ├── detectslostconnections.cpp │ │ ├── explainqueries.cpp │ │ ├── hasconnectionresolver.cpp │ │ ├── logsqueries.cpp │ │ ├── managestransactions.cpp │ │ └── parsessearchpath.cpp │ ├── configurations │ │ ├── configurationoptionsparser.cpp │ │ ├── configurationparser.cpp │ │ ├── configurationparserfactory.cpp │ │ ├── mysqlconfigurationparser.cpp │ │ ├── postgresconfigurationparser.cpp │ │ └── sqliteconfigurationparser.cpp │ ├── connectors │ │ ├── connectionfactory.cpp │ │ ├── connector.cpp │ │ ├── mysqlconnector.cpp │ │ ├── postgresconnector.cpp │ │ └── sqliteconnector.cpp │ ├── constants_extern.cpp │ ├── databaseconnection.cpp │ ├── databasemanager.cpp │ ├── db.cpp │ ├── exceptions │ │ ├── logicerror.cpp │ │ ├── queryerror.cpp │ │ ├── runtimeerror.cpp │ │ └── sqlerror.cpp │ ├── libraryinfo.cpp │ ├── mysqlconnection.cpp │ ├── postgresconnection.cpp │ ├── query │ │ ├── concerns │ │ │ └── buildsqueries.cpp │ │ ├── grammars │ │ │ ├── grammar.cpp │ │ │ ├── mysqlgrammar.cpp │ │ │ ├── postgresgrammar.cpp │ │ │ └── sqlitegrammar.cpp │ │ ├── joinclause.cpp │ │ ├── processors │ │ │ ├── processor.cpp │ │ │ └── sqliteprocessor.cpp │ │ └── querybuilder.cpp │ ├── schema.cpp │ ├── schema │ │ ├── blueprint.cpp │ │ ├── foreignidcolumndefinitionreference.cpp │ │ ├── foreignkeydefinitionreference.cpp │ │ ├── grammars │ │ │ ├── mysqlschemagrammar.cpp │ │ │ ├── postgresschemagrammar.cpp │ │ │ ├── schemagrammar.cpp │ │ │ └── sqliteschemagrammar.cpp │ │ ├── indexdefinitionreference.cpp │ │ ├── mysqlschemabuilder.cpp │ │ ├── postgresschemabuilder.cpp │ │ ├── schemabuilder.cpp │ │ ├── schemaconstants_extern.cpp │ │ └── sqliteschemabuilder.cpp │ ├── sqliteconnection.cpp │ ├── tiny │ │ ├── concerns │ │ │ └── guardedmodel.cpp │ │ ├── exceptions │ │ │ ├── modelnotfounderror.cpp │ │ │ ├── relationmappingnotfounderror.cpp │ │ │ └── relationnotloadederror.cpp │ │ ├── tinytypes.cpp │ │ └── utils │ │ │ └── attribute.cpp │ ├── types │ │ └── sqlquery.cpp │ └── utils │ │ ├── configuration.cpp │ │ ├── fs.cpp │ │ ├── helpers.cpp │ │ ├── nullvariant.cpp │ │ ├── query.cpp │ │ ├── string.cpp │ │ ├── thread.cpp │ │ └── type.cpp ├── src.pri └── src.pro ├── tests ├── CMakeLists.txt ├── README.md ├── TinyUtils │ ├── CMakeLists.txt │ ├── TinyUtils.pro │ ├── resources │ │ ├── TinyUtils.dll.manifest │ │ └── TinyUtils.rc.in │ └── src │ │ ├── common │ │ └── collection.hpp │ │ ├── databases.cpp │ │ ├── databases.hpp │ │ ├── export.hpp │ │ ├── fs.cpp │ │ ├── fs.hpp │ │ ├── macros.hpp │ │ ├── src.pri │ │ └── version.hpp ├── auto │ ├── .clang-tidy │ ├── CMakeLists.txt │ ├── auto.pro │ ├── functional │ │ ├── CMakeLists.txt │ │ ├── drivers │ │ │ ├── CMakeLists.txt │ │ │ ├── drivers.pro │ │ │ ├── sqldatabase │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqldatabase.pro │ │ │ │ └── tst_sqldatabase.cpp │ │ │ ├── sqldatabasemanager │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqldatabasemanager.pro │ │ │ │ └── tst_sqldatabasemanager.cpp │ │ │ ├── sqlquery_normal │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqlquery_normal.pro │ │ │ │ └── tst_sqlquery_normal.cpp │ │ │ └── sqlquery_prepared │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqlquery_prepared.pro │ │ │ │ └── tst_sqlquery_prepared.cpp │ │ ├── functional.pro │ │ ├── orm │ │ │ ├── CMakeLists.txt │ │ │ ├── databasemanager │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── databasemanager.pro │ │ │ │ └── tst_databasemanager.cpp │ │ │ ├── orm.pro │ │ │ ├── postgresql_connection │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── postgresql_connection.pro │ │ │ │ └── tst_postgresql_connection.cpp │ │ │ ├── query │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── blobs │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── blobs.pro │ │ │ │ │ └── tst_blobs.cpp │ │ │ │ ├── mysql_qdatetime │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── mysql_qdatetime.pro │ │ │ │ │ └── tst_mysql_qdatetime.cpp │ │ │ │ ├── postgresql_qdatetime │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── postgresql_qdatetime.pro │ │ │ │ │ └── tst_postgresql_qdatetime.cpp │ │ │ │ ├── query.pro │ │ │ │ ├── querybuilder │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── querybuilder.pro │ │ │ │ │ └── tst_querybuilder.cpp │ │ │ │ └── sqlite_qdatetime │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── sqlite_qdatetime.pro │ │ │ │ │ └── tst_sqlite_qdatetime.cpp │ │ │ ├── schema │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── psql_schemabuilder_f │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── psql_schemabuilder_f.pro │ │ │ │ │ └── tst_postgresql_schemabuilder_f.cpp │ │ │ │ ├── schema.pro │ │ │ │ └── schemabuilder │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── schemabuilder.pro │ │ │ │ │ └── tst_schemabuilder.cpp │ │ │ └── tiny │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── castattributes │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── castattributes.pro │ │ │ │ └── tst_castattributes.cpp │ │ │ │ ├── collection_models │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── collection_models.pro │ │ │ │ └── tst_collection_models.cpp │ │ │ │ ├── collection_relations │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── collection_relations.pro │ │ │ │ └── tst_collection_relations.cpp │ │ │ │ ├── model │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model.pro │ │ │ │ └── tst_model.cpp │ │ │ │ ├── model_appends │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_appends.pro │ │ │ │ └── tst_model_appends.cpp │ │ │ │ ├── model_conn_indep │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_conn_indep.pro │ │ │ │ └── tst_model_connection_independent.cpp │ │ │ │ ├── model_hidesattributes │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_hidesattributes.pro │ │ │ │ └── tst_model_hidesattributes.cpp │ │ │ │ ├── model_qdatetime │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_qdatetime.pro │ │ │ │ └── tst_model_qdatetime.cpp │ │ │ │ ├── model_relations │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_relations.pro │ │ │ │ └── tst_model_relations.cpp │ │ │ │ ├── model_return_relation │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_return_relation.pro │ │ │ │ └── tst_model_return_relation.cpp │ │ │ │ ├── model_serialization │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── model_serialization.pro │ │ │ │ └── tst_model_serialization.cpp │ │ │ │ ├── queriesrelationships │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── queriesrelationships.pro │ │ │ │ └── tst_queriesrelationships.cpp │ │ │ │ ├── relations_buildsqueries │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── relations_buildsqueries.pro │ │ │ │ └── tst_relations_buildsqueries.cpp │ │ │ │ ├── relations_conn_indep │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── relations_conn_indep.pro │ │ │ │ └── tst_relations_connection_independent.cpp │ │ │ │ ├── relations_insrt_updt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── relations_insrt_updt.pro │ │ │ │ └── tst_relations_inserting_updating.cpp │ │ │ │ ├── softdeletes │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── softdeletes.pro │ │ │ │ └── tst_softdeletes.cpp │ │ │ │ ├── tiny.pro │ │ │ │ └── tinybuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── tinybuilder.pro │ │ │ │ └── tst_tinybuilder.cpp │ │ ├── others │ │ │ ├── CMakeLists.txt │ │ │ ├── others.pro │ │ │ └── versions │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── include │ │ │ │ ├── versionsdebug_cmake.hpp.in │ │ │ │ └── versionsdebug_qmake.hpp.in │ │ │ │ ├── tst_versions.cpp │ │ │ │ └── versions.pro │ │ └── tom │ │ │ ├── CMakeLists.txt │ │ │ ├── migrate │ │ │ ├── CMakeLists.txt │ │ │ ├── migrate.pro │ │ │ └── tst_migrate.cpp │ │ │ └── tom.pro │ └── unit │ │ ├── CMakeLists.txt │ │ ├── orm │ │ ├── CMakeLists.txt │ │ ├── databaseconnection │ │ │ ├── CMakeLists.txt │ │ │ ├── databaseconnection.pro │ │ │ └── tst_databaseconnection.cpp │ │ ├── orm.pro │ │ ├── query │ │ │ ├── CMakeLists.txt │ │ │ ├── mysql_querybuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── mysql_querybuilder.pro │ │ │ │ └── tst_mysql_querybuilder.cpp │ │ │ ├── postgresql_querybuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── postgresql_querybuilder.pro │ │ │ │ └── tst_postgresql_querybuilder.cpp │ │ │ ├── query.pro │ │ │ └── sqlite_querybuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqlite_querybuilder.pro │ │ │ │ └── tst_sqlite_querybuilder.cpp │ │ ├── schema │ │ │ ├── CMakeLists.txt │ │ │ ├── blueprint │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── blueprint.pro │ │ │ │ └── tst_blueprint.cpp │ │ │ ├── mysql_schemabuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── mysql_schemabuilder.pro │ │ │ │ └── tst_mysql_schemabuilder.cpp │ │ │ ├── postgresql_schemabuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── postgresql_schemabuilder.pro │ │ │ │ └── tst_postgresql_schemabuilder.cpp │ │ │ ├── schema.pro │ │ │ └── sqlite_schemabuilder │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── sqlite_schemabuilder.pro │ │ │ │ └── tst_sqlite_schemabuilder.cpp │ │ └── tiny │ │ │ ├── CMakeLists.txt │ │ │ ├── mysql_tinybuilder │ │ │ ├── CMakeLists.txt │ │ │ ├── mysql_tinybuilder.pro │ │ │ └── tst_mysql_tinybuilder.cpp │ │ │ └── tiny.pro │ │ └── unit.pro ├── conf.pri.example ├── database │ ├── migrations.pri │ ├── migrations │ │ ├── 2014_10_12_000000_create_posts_table.hpp │ │ ├── 2014_10_12_100000_add_factor_column_to_posts_table.hpp │ │ ├── 2014_10_12_200000_create_properties_table.hpp │ │ └── 2014_10_12_300000_create_phones_table.hpp │ ├── seeders.pri │ └── seeders │ │ ├── databaseseeder.hpp │ │ ├── phoneseeder.hpp │ │ └── propertyseeder.hpp ├── models │ ├── .clang-tidy │ ├── models.pri │ └── models │ │ ├── album.hpp │ │ ├── albumimage.hpp │ │ ├── datetime.hpp │ │ ├── datetime_serializeoverride.hpp │ │ ├── filepropertyproperty.hpp │ │ ├── massassignmentmodels.hpp │ │ ├── phone.hpp │ │ ├── role.hpp │ │ ├── roleuser.hpp │ │ ├── roleuser_appends.hpp │ │ ├── setting.hpp │ │ ├── tag.hpp │ │ ├── tag_returnrelation.hpp │ │ ├── tagged.hpp │ │ ├── tagproperty.hpp │ │ ├── torrent.hpp │ │ ├── torrent_returnrelation.hpp │ │ ├── torrenteager.hpp │ │ ├── torrenteager_failed.hpp │ │ ├── torrenteager_withdefault.hpp │ │ ├── torrenteager_without_qdatetime.hpp │ │ ├── torrentpeer.hpp │ │ ├── torrentpeereager.hpp │ │ ├── torrentpeereager_norelations.hpp │ │ ├── torrentpreviewablefile.hpp │ │ ├── torrentpreviewablefileeager.hpp │ │ ├── torrentpreviewablefileeager_withdefault.hpp │ │ ├── torrentpreviewablefileproperty.hpp │ │ ├── torrentpreviewablefilepropertyeager.hpp │ │ ├── torrentstate.hpp │ │ ├── type.hpp │ │ └── user.hpp ├── qmake │ ├── TinyUtils.pri │ └── common.pri ├── resources │ ├── TinyTest.exe.manifest │ └── TinyTest.rc.in ├── testdata │ ├── composer.json │ ├── composer.lock │ ├── create_and_seed_database.php │ ├── dotenv.ps1.example │ ├── dotenv.sh.example │ └── mysql-tinyorm_test_1.sql ├── testdata_tom │ ├── CMakeLists.txt │ ├── conf.pri.example │ ├── database │ │ ├── migrations.pri │ │ ├── migrations │ │ │ ├── 2022_05_11_170000_create_users_table.hpp │ │ │ ├── 2022_05_11_170100_create_roles_table.hpp │ │ │ ├── 2022_05_11_170200_create_role_user_table.hpp │ │ │ ├── 2022_05_11_170300_create_user_phones_table.hpp │ │ │ ├── 2022_05_11_170400_create_settings_table.hpp │ │ │ ├── 2022_05_11_170500_create_torrents_table.hpp │ │ │ ├── 2022_05_11_170600_create_torrent_peers_table.hpp │ │ │ ├── 2022_05_11_170700_create_torrent_previewable_files_table.hpp │ │ │ ├── 2022_05_11_170800_create_torrent_previewable_file_properties_table.hpp │ │ │ ├── 2022_05_11_170900_create_file_property_properties_table.hpp │ │ │ ├── 2022_05_11_171000_create_torrent_tags_table.hpp │ │ │ ├── 2022_05_11_171100_create_tag_torrent_table.hpp │ │ │ ├── 2022_05_11_171200_create_tag_properties_table.hpp │ │ │ ├── 2022_05_11_171300_create_types_table.hpp │ │ │ ├── 2022_05_11_171400_create_datetimes_table.hpp │ │ │ ├── 2022_05_11_171500_create_albums_table.hpp │ │ │ ├── 2022_05_11_171600_create_album_images_table.hpp │ │ │ ├── 2022_05_11_171700_create_torrent_states_table.hpp │ │ │ ├── 2022_05_11_171800_create_state_torrent_table.hpp │ │ │ ├── 2022_05_11_171900_create_role_tag_table.hpp │ │ │ └── 2022_05_11_172000_create_empty_with_default_values_table.hpp │ │ ├── seeders.pri │ │ └── seeders │ │ │ └── databaseseeder.hpp │ ├── main.cpp │ └── testdata_tom.pro └── tests.pro ├── tom ├── include │ ├── include.pri │ └── tom │ │ ├── application.hpp │ │ ├── commands │ │ ├── aboutcommand.hpp │ │ ├── command.hpp │ │ ├── completecommand.hpp │ │ ├── database │ │ │ ├── seedcommand.hpp │ │ │ └── wipecommand.hpp │ │ ├── environmentcommand.hpp │ │ ├── helpcommand.hpp │ │ ├── inspirecommand.hpp │ │ ├── integratecommand.hpp │ │ ├── listcommand.hpp │ │ ├── make │ │ │ ├── concerns │ │ │ │ └── prepareoptionvalues.hpp │ │ │ ├── makecommand.hpp │ │ │ ├── migrationcommand.hpp │ │ │ ├── modelcommand.hpp │ │ │ ├── modelcommandconcepts.hpp │ │ │ ├── modelcommandtypes.hpp │ │ │ ├── projectcommand.hpp │ │ │ ├── seedercommand.hpp │ │ │ ├── stubs │ │ │ │ ├── migrationstubs.hpp │ │ │ │ ├── modelstubs.hpp │ │ │ │ ├── projectstubs.hpp │ │ │ │ └── seederstubs.hpp │ │ │ └── support │ │ │ │ ├── migrationcreator.hpp │ │ │ │ ├── modelcreator.hpp │ │ │ │ ├── preparebtmoptionvalues.hpp │ │ │ │ ├── prepareforeignkeyvalues.hpp │ │ │ │ ├── seedercreator.hpp │ │ │ │ └── tableguesser.hpp │ │ ├── migrations │ │ │ ├── freshcommand.hpp │ │ │ ├── installcommand.hpp │ │ │ ├── migratecommand.hpp │ │ │ ├── refreshcommand.hpp │ │ │ ├── resetcommand.hpp │ │ │ ├── rollbackcommand.hpp │ │ │ ├── statuscommand.hpp │ │ │ └── uninstallcommand.hpp │ │ └── stubs │ │ │ └── integratestubs.hpp │ │ ├── concerns │ │ ├── callscommands.hpp │ │ ├── confirmable.hpp │ │ ├── guesscommandname.hpp │ │ ├── interactswithio.hpp │ │ ├── pretendable.hpp │ │ ├── printsoptions.hpp │ │ └── usingconnection.hpp │ │ ├── config.hpp │ │ ├── exceptions │ │ ├── invalidargumenterror.hpp │ │ ├── invalidtemplateargumenterror.hpp │ │ ├── logicerror.hpp │ │ ├── runtimeerror.hpp │ │ └── tomerror.hpp │ │ ├── migration.hpp │ │ ├── migrationrepository.hpp │ │ ├── migrator.hpp │ │ ├── seeder.hpp │ │ ├── terminal.hpp │ │ ├── tomconstants.hpp │ │ ├── tomconstants_extern.hpp │ │ ├── tomconstants_inline.hpp │ │ ├── tomtypes.hpp │ │ ├── tomutils.hpp │ │ ├── types │ │ └── commandlineoption.hpp │ │ └── version.hpp ├── resources │ ├── tom.exe.manifest │ └── tom.rc.in └── src │ ├── src.pri │ └── tom │ ├── application.cpp │ ├── commands │ ├── aboutcommand.cpp │ ├── command.cpp │ ├── completecommand.cpp │ ├── database │ │ ├── seedcommand.cpp │ │ └── wipecommand.cpp │ ├── environmentcommand.cpp │ ├── helpcommand.cpp │ ├── inspirecommand.cpp │ ├── integratecommand.cpp │ ├── listcommand.cpp │ ├── make │ │ ├── concerns │ │ │ └── prepareoptionvalues.cpp │ │ ├── makecommand.cpp │ │ ├── migrationcommand.cpp │ │ ├── modelcommand.cpp │ │ ├── projectcommand.cpp │ │ ├── seedercommand.cpp │ │ └── support │ │ │ ├── migrationcreator.cpp │ │ │ ├── modelcreator.cpp │ │ │ ├── prepareforeignkeyvalues.cpp │ │ │ ├── seedercreator.cpp │ │ │ └── tableguesser.cpp │ └── migrations │ │ ├── freshcommand.cpp │ │ ├── installcommand.cpp │ │ ├── migratecommand.cpp │ │ ├── refreshcommand.cpp │ │ ├── resetcommand.cpp │ │ ├── rollbackcommand.cpp │ │ ├── statuscommand.cpp │ │ └── uninstallcommand.cpp │ ├── concerns │ ├── callscommands.cpp │ ├── confirmable.cpp │ ├── guesscommandname.cpp │ ├── interactswithio.cpp │ ├── pretendable.cpp │ ├── printsoptions.cpp │ └── usingconnection.cpp │ ├── exceptions │ ├── tomlogicerror.cpp │ └── tomruntimeerror.cpp │ ├── migrationrepository.cpp │ ├── migrator.cpp │ ├── seeder.cpp │ ├── terminal.cpp │ ├── tomconstants_extern.cpp │ └── tomutils.cpp ├── tools ├── Add-FolderOnPath.ps1 ├── Find-Exports.ps1 ├── Find-TinyORMTodos.ps1 ├── Find-Todos.ps1 ├── Get-GitHubActions.ps1 ├── Get-TextCasesDuration.ps1 ├── Get-VcpkgHash.ps1 ├── Invoke-Tests.ps1 ├── Lint-TinyORM.ps1 ├── README.md ├── completions │ ├── tom.bash │ └── tom.zsh ├── configs │ └── UBSan.supp ├── deploy.ps1 ├── distributions │ └── gentoo │ │ ├── etc │ │ └── portage │ │ │ ├── README.md │ │ │ ├── env │ │ │ ├── ccache │ │ │ ├── debugsyms │ │ │ ├── installsources │ │ │ └── lto │ │ │ ├── package.accept_keywords │ │ │ ├── ccache │ │ │ ├── clang │ │ │ ├── cmake │ │ │ ├── eselect-pwsh │ │ │ ├── gcc │ │ │ ├── gcc-config │ │ │ ├── mariadb-connector-c │ │ │ ├── mold │ │ │ ├── mysql-connector-c │ │ │ ├── postgresql │ │ │ ├── pwsh-bin │ │ │ ├── tinyorm │ │ │ └── vscode │ │ │ ├── package.env │ │ │ ├── glibc │ │ │ └── tinyorm │ │ │ ├── package.use │ │ │ ├── binutils │ │ │ ├── ccache │ │ │ ├── clang │ │ │ ├── mysql │ │ │ ├── mysql-connector-c │ │ │ ├── postgresql │ │ │ ├── qtbase │ │ │ ├── qtsql │ │ │ └── tinyorm │ │ │ ├── profile │ │ │ └── package.use.mask │ │ │ └── repos.conf │ │ │ └── crystal-repo.conf │ │ └── var │ │ └── db │ │ └── repos │ │ ├── README.md │ │ └── crystal │ │ ├── .editorconfig │ │ ├── .mailmap │ │ ├── dev-cpp │ │ ├── metadata.xml │ │ └── tabulate │ │ │ ├── Manifest │ │ │ ├── metadata.xml │ │ │ ├── tabulate-1.5.ebuild │ │ │ └── tabulate-9999.ebuild │ │ ├── dev-db │ │ ├── metadata.xml │ │ └── tinyorm │ │ │ ├── Manifest │ │ │ ├── metadata.xml │ │ │ ├── tinyorm-0.37.3.ebuild │ │ │ ├── tinyorm-0.38.1.ebuild │ │ │ └── tinyorm-9999.ebuild │ │ ├── metadata │ │ ├── AUTHORS │ │ └── layout.conf │ │ └── profiles │ │ ├── eapi │ │ └── repo_name ├── msys2.cmd ├── private │ ├── Common-Deploy.ps1 │ ├── Common-Host.ps1 │ ├── Common-Linting.ps1 │ ├── Common-Path.ps1 │ └── Edit-FetchContentGitTag.ps1 ├── qa-lint-tinyorm-qt6.ps1.example ├── qft.ps1 ├── qsdb-deploy-cmake.ps1 ├── qsdb-deploy-qmake.ps1 ├── qsdb-deploy.ps1 ├── qsdb-deploy.ps1.example ├── qtbuild-qmysql-driver.ps1 ├── qtenv6.ps1.example ├── qvcpkg-hash.ps1 ├── run-clang-tidy.ps1.example ├── run-clazy-standalone.ps1.example ├── run-clazy-standalone.py ├── std.ps1 ├── stdm6.ps1.example ├── stpm6.ps1.example ├── str.ps1 ├── strm6.ps1.example ├── svcpkg_tinyorm_port_qt6_testing.ps1.example ├── vcvars32.ps1 └── vcvars64.ps1 └── vcpkg.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 4 11 | trim_trailing_whitespace = true 12 | guidelines = 90, 100, 110 1px solid 636363, 120 1px solid 715a5a 13 | guidelines_style = 1px solid 3f3f3f 14 | 15 | [*.{md,mdx}] 16 | trim_trailing_whitespace = false 17 | 18 | [*.{json,yaml,yml}] 19 | indent_size = 2 20 | -------------------------------------------------------------------------------- /.env.mingw.example: -------------------------------------------------------------------------------- 1 | # Enable ccache wrapper 2 | #CONFIG *= ccache 3 | 4 | # Use alternative linker (for both GCC and Clang) 5 | # CONFIG *= use_lld_linker does not work on MinGW 6 | #QMAKE_LFLAGS *= -fuse-ld=lld 7 | 8 | # vcpkg - range-v3 and tabulate 9 | TINY_VCPKG_ROOT = $$quote(C:/msys64/home/xyz/Code/vcpkg/) 10 | TINY_VCPKG_TRIPLET = x64-mingw-dynamic 11 | -------------------------------------------------------------------------------- /.env.unix.example: -------------------------------------------------------------------------------- 1 | # Enable ccache wrapper and PCH 2 | #CONFIG *= ccache precompile_header 3 | 4 | # Use LLD linker for Clang 5 | clang: CONFIG *= use_lld_linker 6 | else: CONFIG *= use_gold_linker 7 | 8 | # Or use the mold linker 9 | #QMAKE_LFLAGS *= -fuse-ld=mold 10 | 11 | # vcpkg - range-v3 and tabulate 12 | TINY_VCPKG_ROOT = $$quote(/home/xyz/Code/c/vcpkg/) 13 | TINY_VCPKG_TRIPLET = x64-linux 14 | -------------------------------------------------------------------------------- /.env.win32.example: -------------------------------------------------------------------------------- 1 | # Enable ccache wrapper 2 | #CONFIG *= ccache 3 | 4 | # vcpkg - range-v3 and tabulate 5 | TINY_VCPKG_ROOT = $$quote(E:/xyz/vcpkg/) 6 | TINY_VCPKG_TRIPLET = x64-windows 7 | 8 | # MySQL C library (default installation path is auto-detected) 9 | #TINY_MYSQL_ROOT = $$quote($$(ProgramFiles)/MySQL/MySQL Server 9.0/) 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | core.eol=lf 2 | * text eol=lf 3 | *.zip binary 4 | *.png binary 5 | *.ico binary 6 | *.qm binary 7 | *.icns binary 8 | *.dll binary 9 | *.pdb binary 10 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | You're able to report vulnerabilities on the GitHub issue tracker or email me directly. 6 | 7 | Security vulnerabilities have the highest priority and will be fixed immediately. 8 | 9 | -------------------------------------------------------------------------------- /.github/resources/linux/crystal_client.template.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | # Common 3 | host={MYSQL_HOST} 4 | default-character-set=utf8mb4 5 | 6 | [mysql] 7 | no-beep 8 | -------------------------------------------------------------------------------- /.github/resources/linux/crystal_client_ssl.template.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | # Common 3 | host={MYSQL_HOST} 4 | default-character-set=utf8mb4 5 | 6 | # Strict TLS connection (as secure as possible to test it) 7 | ssl-ca="{SSL_CERTIFICATES_PATH}/ca.pem" 8 | ssl-cert="{SSL_CERTIFICATES_PATH}/client-cert.pem" 9 | ssl-key="{SSL_CERTIFICATES_PATH}/client-key.pem" 10 | ssl-mode=VERIFY_IDENTITY 11 | 12 | tls-version=TLSv1.3 13 | 14 | [mysql] 15 | no-beep 16 | -------------------------------------------------------------------------------- /.github/resources/linux/crystal_mysqld.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | mysqlx=off 3 | 4 | # The TCP/IP addresses the MySQL Server will listen on 5 | bind_address="127.0.0.1,::1" 6 | mysqlx_bind_address="127.0.0.1,::1" 7 | 8 | # All TLS-related confgurations leave at defaults to test it how it behaves if we don't use TLS 9 | 10 | # The default authentication plugin to be used when connecting to the server 11 | default_authentication_plugin=caching_sha2_password 12 | 13 | # General logging 14 | general-log=off 15 | 16 | # Slow queries logging 17 | slow-query-log=off 18 | long-query-time=10 19 | 20 | # Binary log 21 | # I don't need bin log, is primarily used for replication and after restore from backup 22 | disable-log-bin=on 23 | -------------------------------------------------------------------------------- /.github/resources/linux/crystal_mysqld_ssl.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | mysqlx=off 3 | 4 | # The TCP/IP addresses the MySQL Server will listen on 5 | bind_address="127.0.0.1,::1" 6 | mysqlx_bind_address="127.0.0.1,::1" 7 | 8 | # My custom configurations (as secure as possible to test it) 9 | require_secure_transport=on 10 | 11 | tls_version=TLSv1.3 12 | admin_tls_version=TLSv1.3 13 | 14 | # The default authentication plugin to be used when connecting to the server 15 | default_authentication_plugin=caching_sha2_password 16 | 17 | # General logging 18 | general-log=off 19 | 20 | # Slow queries logging 21 | slow-query-log=off 22 | long-query-time=10 23 | 24 | # Binary log 25 | # I don't need bin log, is primarily used for replication and after restore from backup 26 | disable-log-bin=on 27 | 28 | [mysqld-8.1] 29 | # Ensure that the location of each required SSL certificate file is present in the data directory 30 | tls_certificates_enforced_validation=on 31 | -------------------------------------------------------------------------------- /.github/resources/openssl/usr_cert.cnf: -------------------------------------------------------------------------------- 1 | [default] 2 | 3 | # These extensions are added when 'ca' signs a request. 4 | 5 | subjectAltName=$ENV::OPENSSL_SAN 6 | 7 | # This goes against PKIX guidelines but some CAs do it and some software 8 | # requires this to avoid interpreting an end user certificate as a CA. 9 | 10 | basicConstraints=CA:FALSE 11 | 12 | # This is typical in keyUsage for a client certificate. 13 | # keyUsage = nonRepudiation, digitalSignature, keyEncipherment 14 | 15 | # PKIX recommendations harmless if included in all certificates. 16 | subjectKeyIdentifier=hash 17 | authorityKeyIdentifier=keyid,issuer 18 | 19 | -------------------------------------------------------------------------------- /.github/resources/postgresql/conf.d/90-crystal.conf: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # CONNECTIONS AND AUTHENTICATION 3 | #------------------------------------------------------------------------------ 4 | 5 | # - Connection Settings - 6 | 7 | listen_addresses = '127.0.0.1, ::1' 8 | 9 | # - Authentication - 10 | 11 | password_encryption = scram-sha-256 12 | 13 | # - SSL - 14 | 15 | ssl = on 16 | ssl_ca_file = 'root.crt' 17 | -------------------------------------------------------------------------------- /.github/resources/windows/my_5.template.ini: -------------------------------------------------------------------------------- 1 | [client] 2 | # Common 3 | host={MYSQL_HOST} 4 | default-character-set=utf8mb4 5 | 6 | [mysql] 7 | no-beep 8 | 9 | [mysqld] 10 | # The TCP/IP addresses the MySQL Server will listen on 11 | bind_address="127.0.0.1" 12 | 13 | # All TLS-related confgurations leave at defaults to test it how it behaves if we don't use TLS 14 | 15 | # Path to the database root 16 | datadir="{MYSQL_DATADIR}" 17 | 18 | # General logging 19 | log-output=FILE 20 | 21 | general-log=off 22 | general-log-file="merydeye-tinyorm.log" 23 | 24 | # Slow queries logging 25 | slow-query-log=off 26 | slow-query-log-file="merydeye-tinyorm-slow.log" 27 | long-query-time=10 28 | 29 | # Error Logging 30 | log-error="merydeye-tinyorm.err" 31 | 32 | # Binary log 33 | # I don't need bin log, is primarily used for replication and after restore from backup 34 | disable-log-bin=on 35 | -------------------------------------------------------------------------------- /.github/resources/windows/my_8.template.ini: -------------------------------------------------------------------------------- 1 | [client] 2 | # Common 3 | host={MYSQL_HOST} 4 | default-character-set=utf8mb4 5 | 6 | [mysql] 7 | no-beep 8 | 9 | [mysqld] 10 | mysqlx=off 11 | 12 | # The TCP/IP addresses the MySQL Server will listen on 13 | bind_address="127.0.0.1,::1" 14 | mysqlx_bind_address="127.0.0.1,::1" 15 | 16 | # All TLS-related confgurations leave at defaults to test it how it behaves if we don't use TLS 17 | 18 | # The default authentication plugin to be used when connecting to the server 19 | default_authentication_plugin=caching_sha2_password 20 | 21 | # Path to the database root 22 | datadir="{MYSQL_DATADIR}" 23 | 24 | # General logging 25 | log-output=FILE 26 | 27 | general-log=off 28 | general-log-file="merydeye-tinyorm.log" 29 | 30 | # Slow queries logging 31 | slow-query-log=off 32 | slow-query-log-file="merydeye-tinyorm-slow.log" 33 | long-query-time=10 34 | 35 | # Error Logging 36 | log-error="merydeye-tinyorm.err" 37 | 38 | # Binary log 39 | # I don't need bin log, is primarily used for replication and after restore from backup 40 | disable-log-bin=on 41 | -------------------------------------------------------------------------------- /.qmake.conf: -------------------------------------------------------------------------------- 1 | # To find .env and .env.$$QMAKE_PLATFORM files 2 | TINY_DOTENV_ROOT = $$PWD 3 | TINYORM_SOURCE_TREE = $$PWD 4 | TINYORM_BUILD_TREE = $$shadowed($$PWD) 5 | 6 | # To find .prf files, needed by eg. CONFIG += tiny_system_headers inline/extern_constants 7 | QMAKEFEATURES *= $$quote($$PWD/qmake/features) 8 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Written by Silver Zachara Copyright (©) 2019-2024 2 | 3 | Contributions by: 4 | Alonso Schaich 5 | 6 | Thanks for bug reports 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (©) 2019 - 2024 Silver Zachara 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /cmake/CommonModules/TinyMsvcParallel.cmake: -------------------------------------------------------------------------------- 1 | # Allow per-translation-unit parallel builds when using MSVC 2 | function(tiny_msvc_parallel desc) 3 | 4 | if(CMAKE_GENERATOR MATCHES "Visual Studio" AND 5 | (CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel" OR 6 | CMAKE_CXX_COMPILER_ID MATCHES "MSVC|Intel") 7 | ) 8 | set(MSVC_PARALLEL ON CACHE STRING "${desc}") 9 | 10 | if(MSVC_PARALLEL) 11 | if(MSVC_PARALLEL GREATER 0) 12 | string(APPEND CMAKE_C_FLAGS " /MP${CMake_MSVC_PARALLEL}") 13 | string(APPEND CMAKE_CXX_FLAGS " /MP${CMake_MSVC_PARALLEL}") 14 | else() 15 | string(APPEND CMAKE_C_FLAGS " /MP") 16 | string(APPEND CMAKE_CXX_FLAGS " /MP") 17 | endif() 18 | endif() 19 | endif() 20 | 21 | endfunction() 22 | 23 | # TODO so this doesn't work, anyway it has to be refactored, use target_compile_options() instead of string(APPEND CMAKE_C_FLAGS silverqx 24 | # TODO make it dependend on cmake_disable_precompile_headers and MSVC; after long time - I don't understand why it needs to depend on the cmake_disable_precompile_headers but it has to have a reason if I wrote or noted it this way silverqx 25 | -------------------------------------------------------------------------------- /cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | libdir=${prefix}/@_INSTALL_LIBDIR@ 3 | 4 | Name: @_PROJECT_NAME@ 5 | Description: @_PROJECT_DESCRIPTION@ 6 | Version: @_PROJECT_VERSION@ 7 | Libs: -L${libdir} -l@_TARGET_OUTPUT_NAME@ @_interface_link_libraries@ 8 | Cflags: @_interface_compile_options@ @_interface_include_dirs@ @_interface_definitions@ 9 | -------------------------------------------------------------------------------- /cmake/Modules/GeneratePkgConfig/target-compile-settings.cmake.in: -------------------------------------------------------------------------------- 1 | set(_TARGET_INTERFACE_LINK_LIBRARIES "@_interface_link_libraries@") 2 | set(_TARGET_INTERFACE_COMPILE_OPTIONS "@_interface_compile_options@") 3 | set(_TARGET_INTERFACE_INCLUDE_DIRS "@_interface_include_dirs@") 4 | set(_TARGET_INTERFACE_DEFINITIONS "@_interface_definitions@") 5 | set(_TARGET_OUTPUT_NAME "@_output_name@") 6 | 7 | set(_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@") 8 | set(_INSTALL_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@") 9 | set(_SHARED_LIBRARY_PREFIX "@CMAKE_SHARED_LIBRARY_PREFIX@") 10 | 11 | set(_PROJECT_NAME "@PROJECT_NAME@") 12 | set(_PROJECT_DESCRIPTION "@PROJECT_DESCRIPTION@") 13 | set(_PROJECT_VERSION "@PROJECT_VERSION@") 14 | -------------------------------------------------------------------------------- /cmake/vcpkg/triplets/x64-linux-dynamic.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | set(VCPKG_LIBRARY_LINKAGE dynamic) 4 | 5 | set(VCPKG_CMAKE_SYSTEM_NAME Linux) 6 | -------------------------------------------------------------------------------- /cmake/vcpkg/usage.in: -------------------------------------------------------------------------------- 1 | The @TINY_PORT@ port provides the following CMake targets: 2 | 3 | find_package(@TinyOrm_ns@ @tinyOrmPackageVersion@ CONFIG REQUIRED) 4 | target_link_libraries(main PRIVATE @TinyOrm_ns@::@TinyOrm_target@) 5 | -------------------------------------------------------------------------------- /docs/assets/img/features-summary/tinyorm-passed_all_unit_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/assets/img/features-summary/tinyorm-passed_all_unit_tests.png -------------------------------------------------------------------------------- /docs/assets/img/features-summary/tinyormplayground-multi-threaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/assets/img/features-summary/tinyormplayground-multi-threaded.png -------------------------------------------------------------------------------- /docs/assets/img/features-summary/tinyormplayground-single-threaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/assets/img/features-summary/tinyormplayground-single-threaded.png -------------------------------------------------------------------------------- /docs/building/README.md: -------------------------------------------------------------------------------- 1 | # Building 2 | 3 | The build systems supported out of the box are CMake and qmake. 4 | 5 | - [TinyORM](tinyorm.mdx#building-tinyorm) 6 | - [Hello world](hello-world.mdx#building-hello-world) 7 | - [Migrations](migrations.mdx#building-migrations) 8 | -------------------------------------------------------------------------------- /docs/building/_category_.yml: -------------------------------------------------------------------------------- 1 | position: 6 2 | label: '🚧 Building' 3 | -------------------------------------------------------------------------------- /docs/building/assets/img/hello-world/qmake-build_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/hello-world/qmake-build_settings.png -------------------------------------------------------------------------------- /docs/building/assets/img/hello-world/qmake-configure_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/hello-world/qmake-configure_project.png -------------------------------------------------------------------------------- /docs/building/assets/img/migrations/qmake-build_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/migrations/qmake-build_settings.png -------------------------------------------------------------------------------- /docs/building/assets/img/migrations/qmake-configure_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/migrations/qmake-configure_project.png -------------------------------------------------------------------------------- /docs/building/assets/img/migrations/tom_file_properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/migrations/tom_file_properties.png -------------------------------------------------------------------------------- /docs/building/assets/img/migrations/tom_migrate_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/migrations/tom_migrate_status.png -------------------------------------------------------------------------------- /docs/building/assets/img/tinyorm/qmake-additional_arguments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/tinyorm/qmake-additional_arguments.png -------------------------------------------------------------------------------- /docs/building/assets/img/tinyorm/qmake-build_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/tinyorm/qmake-build_settings.png -------------------------------------------------------------------------------- /docs/building/assets/img/tinyorm/qmake-configure_project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/building/assets/img/tinyorm/qmake-configure_project.png -------------------------------------------------------------------------------- /docs/database/README.md: -------------------------------------------------------------------------------- 1 | # Database 2 | 3 | Almost every modern application interacts with a database. TinyORM makes interacting with a database extremely simple using raw SQL, a [fluent query builder](query-builder.mdx#database-query-builder), and the [TinyORM](../tinyorm/getting-started.mdx#tinyorm-getting-started). 4 | 5 | - [Getting Started](getting-started.mdx#database-getting-started) 6 | - [Query Builder](query-builder.mdx#database-query-builder) 7 | - [Migrations](migrations.mdx#database-migrations) 8 | - [Seeding](database/seeding.mdx#database-seeding) 9 | -------------------------------------------------------------------------------- /docs/database/_category_.yml: -------------------------------------------------------------------------------- 1 | position: 3 2 | label: '✨ Database' 3 | -------------------------------------------------------------------------------- /docs/database/assets/img/migrations/tom_cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/docs/database/assets/img/migrations/tom_cli.png -------------------------------------------------------------------------------- /docs/donations.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 9 3 | sidebar_label: 🪙 Donations 4 | hide_table_of_contents: true 5 | description: How to donate, sponsor, and support the TinyORM project. 6 | keywords: [c++ orm, tinyorm, support, sponsors, donations, sponsorship, fund, funding] 7 | --- 8 | 9 | import APITable from '@theme/APITable' 10 | 11 | # Donations 12 | 13 | I would like to continue developing and enhancing this project and I will as long as I can. But the future is unclear. 14 | 15 |
16 | 17 | 18 | | Service | Address | 19 | | --------------- | ---------------------------------- | 20 | | Bitcoin address | 1NiF2cTvYxUj8FTZJnGn1ycN4yisWfo1vJ | 21 | | PayPal | [https://paypal.me/silverzachara](https://paypal.me/silverzachara) | 22 | 23 | 24 |
25 | -------------------------------------------------------------------------------- /docs/stability.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | sidebar_label: 🚩 Stability 4 | hide_table_of_contents: true 5 | description: Describes and summarizes Stability Indexes for TinyORM library. 6 | keywords: [c++ orm, tinyorm, features, modules, stability] 7 | --- 8 | 9 | # Stability 10 | 11 | - [Stability Indexes](#stability-indexes) 12 | 13 | ## Stability Indexes 14 | 15 |
16 | __Stability: 0 - Experimental__ : The feature is still under development.
17 | Currently, no module/feature is in this Stability Category. 18 |
19 | 20 |
21 | __Stability: 1 - Preview__ : The feature is almost done, but still can contain some glitches.
22 | Currently, only [TinyORM: Relationships](tinyorm/relationships.mdx) module is in this Stability Category, the reason why is described on its page. 23 |
24 | 25 |
26 | __Stability: 2 - Stable__ : The feature is ready for __Production__ use, everything works as was intended.
27 | All other `TinyORM` modules are considered Stable. 28 |
29 | -------------------------------------------------------------------------------- /docs/tinydrivers/README.md: -------------------------------------------------------------------------------- 1 | # TinyDrivers 2 | 3 | The `TinyDrivers` library is an underlying SQL database layer for `TinyORM`. It can be used instead of the `QtSql` module, can be __swapped__ at compile time, and has __1:1__ API as the `QtSql` module. 😮 Swapping is controlled by the `qmake` and `CMake` build system options. 4 | 5 | It was designed to drop the `QtSql` dependency while maintaining backward compatibility and without the need for any code changes after the swap. 6 | 7 | - [Getting Started](getting-started.mdx#tinydrivers-getting-started) 8 | -------------------------------------------------------------------------------- /docs/tinydrivers/_category_.yml: -------------------------------------------------------------------------------- 1 | position: 5 2 | label: '🧬 TinyDrivers' 3 | -------------------------------------------------------------------------------- /docs/tinyorm/README.md: -------------------------------------------------------------------------------- 1 | # TinyORM 2 | 3 | TinyORM is an object-relational mapper (ORM) that makes it enjoyable to interact with your database. When using TinyORM, each database table has a corresponding "Model" that is used to interact with that table. In addition to retrieving records from the database table, TinyORM models allow you to insert, update, and delete records from the table as well. 4 | 5 | - [Getting Started](getting-started.mdx#tinyorm-getting-started) 6 | - [Relationships](relationships.mdx#tinyorm-relationships) 7 | - [Collections](collections.mdx#tinyorm-collections) 8 | - [Casts](casts.mdx#tinyorm-casting) 9 | - [Serialization](serialization.mdx#tinyorm-serialization) 10 | -------------------------------------------------------------------------------- /docs/tinyorm/_category_.yml: -------------------------------------------------------------------------------- 1 | position: 4 2 | label: '🎉 TinyORM' 3 | -------------------------------------------------------------------------------- /drivers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # TinyDrivers database drivers 2 | # --- 3 | 4 | add_subdirectory(common) 5 | 6 | if(TINY_BUILD_LOADABLE_DRIVERS AND BUILD_MYSQL_DRIVER) 7 | add_subdirectory(mysql) 8 | endif() 9 | -------------------------------------------------------------------------------- /drivers/common/include/include.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | headersList = \ 4 | $$PWD/orm/drivers/concerns/selectsallcolumnswithlimit0.hpp \ 5 | $$PWD/orm/drivers/driverstypes.hpp \ 6 | $$PWD/orm/drivers/dummysqlerror.hpp \ 7 | $$PWD/orm/drivers/exceptions/driverserror.hpp \ 8 | $$PWD/orm/drivers/exceptions/invalidargumenterror.hpp \ 9 | $$PWD/orm/drivers/exceptions/logicerror.hpp \ 10 | $$PWD/orm/drivers/exceptions/outofrangeerror.hpp \ 11 | $$PWD/orm/drivers/exceptions/queryerror.hpp \ 12 | $$PWD/orm/drivers/exceptions/runtimeerror.hpp \ 13 | $$PWD/orm/drivers/exceptions/sqlerror.hpp \ 14 | $$PWD/orm/drivers/exceptions/sqltransactionerror.hpp \ 15 | $$PWD/orm/drivers/libraryinfo.hpp \ 16 | $$PWD/orm/drivers/macros/export.hpp \ 17 | $$PWD/orm/drivers/sqldatabase.hpp \ 18 | $$PWD/orm/drivers/sqldatabasemanager.hpp \ 19 | $$PWD/orm/drivers/sqldriver.hpp \ 20 | $$PWD/orm/drivers/sqlfield.hpp \ 21 | $$PWD/orm/drivers/sqlquery.hpp \ 22 | $$PWD/orm/drivers/sqlrecord.hpp \ 23 | $$PWD/orm/drivers/sqlresult.hpp \ 24 | $$PWD/orm/drivers/utils/notnull.hpp \ 25 | $$PWD/orm/drivers/version.hpp \ 26 | 27 | HEADERS += $$sorted(headersList) 28 | 29 | unset(headersList) 30 | -------------------------------------------------------------------------------- /drivers/common/include/orm/drivers/exceptions/driverserror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_EXCEPTIONS_DRIVERSERROR_HPP 3 | #define ORM_DRIVERS_EXCEPTIONS_DRIVERSERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Drivers::Exceptions 13 | { 14 | 15 | /*! TinyDrivers exceptions tag, all TinyDrivers exceptions are derived from this 16 | class. */ 17 | class DriversError // NOLINT(cppcoreguidelines-special-member-functions) clazy:exclude=copyable-polymorphic 18 | { 19 | public: 20 | /*! Pure virtual destructor. */ 21 | inline virtual ~DriversError() = 0; 22 | }; 23 | 24 | /* public */ 25 | 26 | DriversError::~DriversError() = default; 27 | 28 | } // namespace Orm::Drivers::Exceptions 29 | 30 | TINYORM_END_COMMON_NAMESPACE 31 | 32 | #endif // ORM_DRIVERS_EXCEPTIONS_DRIVERSERROR_HPP 33 | -------------------------------------------------------------------------------- /drivers/common/include/orm/drivers/exceptions/invalidargumenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 3 | #define ORM_DRIVERS_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/drivers/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Drivers::Exceptions 13 | { 14 | 15 | /*! TinyDrivers invalid argument exception. */ 16 | class InvalidArgumentError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Drivers::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_DRIVERS_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /drivers/common/include/orm/drivers/exceptions/outofrangeerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_EXCEPTIONS_OUTOFRANGEERROR_HPP 3 | #define ORM_DRIVERS_EXCEPTIONS_OUTOFRANGEERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/drivers/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Drivers::Exceptions 13 | { 14 | 15 | /*! TinyDrivers out of range exception. */ 16 | class OutOfRangeError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Drivers::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_DRIVERS_EXCEPTIONS_OUTOFRANGEERROR_HPP 27 | -------------------------------------------------------------------------------- /drivers/common/include/orm/drivers/exceptions/sqltransactionerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 3 | #define ORM_DRIVERS_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/drivers/exceptions/sqlerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Drivers::Exceptions 13 | { 14 | 15 | /*! TinyDrivers Sql transaction exception. */ 16 | class SqlTransactionError : public SqlError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using SqlError::SqlError; // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) 20 | }; 21 | 22 | } // namespace Orm::Drivers::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_DRIVERS_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 27 | -------------------------------------------------------------------------------- /drivers/common/include/orm/drivers/macros/export.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_MACROS_EXPORT_HPP 3 | #define ORM_DRIVERS_MACROS_EXPORT_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | #ifdef TINYDRIVERS_BUILDING_SHARED 11 | # define TINYDRIVERS_EXPORT TINY_DECL_EXPORT 12 | #elif defined(TINYDRIVERS_LINKING_SHARED) 13 | # define TINYDRIVERS_EXPORT TINY_DECL_IMPORT 14 | #endif 15 | 16 | // Building library archive (static) 17 | #ifndef TINYDRIVERS_EXPORT 18 | # define TINYDRIVERS_EXPORT 19 | #endif 20 | 21 | #endif // ORM_DRIVERS_MACROS_EXPORT_HPP 22 | -------------------------------------------------------------------------------- /drivers/common/include/pch.h: -------------------------------------------------------------------------------- 1 | /* This file can't be included in the project, it's for a precompiled header. */ 2 | 3 | /* Add C includes here */ 4 | 5 | #ifdef __cplusplus 6 | /* Add C++ includes here */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifndef QT_NO_DEBUG_STREAM 17 | # include 18 | #endif 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #ifdef __linux__ 25 | # include 26 | #endif 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #endif 37 | -------------------------------------------------------------------------------- /drivers/common/include/pch.pri: -------------------------------------------------------------------------------- 1 | # Use Precompiled headers (PCH) 2 | # --- 3 | 4 | PRECOMPILED_HEADER = $$quote($$PWD/pch.h) 5 | HEADERS += $$PRECOMPILED_HEADER 6 | 7 | precompile_header: \ 8 | DEFINES *= TINYDRIVERS_USING_PCH 9 | -------------------------------------------------------------------------------- /drivers/common/include_private/include_private.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | headersList = 4 | 5 | extern_constants: \ 6 | headersList += $$PWD/orm/drivers/constants_extern_p.hpp 7 | else: \ 8 | headersList += $$PWD/orm/drivers/constants_inline_p.hpp 9 | 10 | build_loadable_drivers: \ 11 | headersList += $$PWD/orm/drivers/utils/fs_p.hpp 12 | 13 | headersList += \ 14 | $$PWD/orm/drivers/constants_p.hpp \ 15 | $$PWD/orm/drivers/macros/declaresqldriverprivate_p.hpp \ 16 | $$PWD/orm/drivers/sqldatabase_p.hpp \ 17 | $$PWD/orm/drivers/sqldriver_p.hpp \ 18 | $$PWD/orm/drivers/sqlresult_p.hpp \ 19 | $$PWD/orm/drivers/support/connectionshash_p.hpp \ 20 | $$PWD/orm/drivers/support/sqldriverfactory_p.hpp \ 21 | $$PWD/orm/drivers/support/sqlrecordcache_p.hpp \ 22 | $$PWD/orm/drivers/utils/type_p.hpp \ 23 | 24 | HEADERS += $$sorted(headersList) 25 | 26 | unset(headersList) 27 | -------------------------------------------------------------------------------- /drivers/common/include_private/orm/drivers/constants_extern_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_CONSTANTS_EXTERN_P_HPP 3 | #define ORM_DRIVERS_CONSTANTS_EXTERN_P_HPP 4 | 5 | #include 6 | 7 | #include 8 | 9 | TINYORM_BEGIN_COMMON_NAMESPACE 10 | 11 | /*! Namespace contains common chars and strings used in the TinyDrivers project. */ 12 | namespace Orm::Drivers::Constants 13 | { 14 | 15 | // Common chars 16 | extern const QChar SPACE; 17 | extern const QChar DOT; 18 | extern const QChar QUOTE; 19 | 20 | // Common strings 21 | extern const QString NEWLINE; 22 | extern const QString COMMA; 23 | extern const QString null_; 24 | 25 | // Database related 26 | extern const QString QMYSQL; 27 | // extern const QString QPSQL; 28 | // extern const QString QSQLITE; 29 | 30 | // Others 31 | extern const QString NotImplemented; 32 | 33 | } // namespace Orm::Drivers::Constants 34 | 35 | TINYORM_END_COMMON_NAMESPACE 36 | 37 | #endif // ORM_DRIVERS_CONSTANTS_EXTERN_P_HPP 38 | -------------------------------------------------------------------------------- /drivers/common/include_private/orm/drivers/constants_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_CONSTANTS_P_HPP 3 | #define ORM_DRIVERS_CONSTANTS_P_HPP 4 | 5 | #include "orm/drivers/config_p.hpp" // IWYU pragma: keep 6 | 7 | #ifdef TINYDRIVERS_EXTERN_CONSTANTS 8 | # include "orm/drivers/constants_extern_p.hpp" // IWYU pragma: export 9 | #else 10 | # include "orm/drivers/constants_inline_p.hpp" // IWYU pragma: export 11 | #endif 12 | 13 | #endif // ORM_DRIVERS_CONSTANTS_P_HPP 14 | -------------------------------------------------------------------------------- /drivers/common/src/orm/drivers/constants_extern_p.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/constants_extern_p.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | using namespace Qt::StringLiterals; // NOLINT(google-build-using-namespace) 6 | 7 | namespace Orm::Drivers::Constants 8 | { 9 | 10 | // Common chars 11 | const QChar SPACE = ' '_L1; 12 | const QChar DOT = '.'_L1; 13 | const QChar QUOTE = '"'_L1; 14 | 15 | // Common strings 16 | const QString NEWLINE = u"\n"_s; 17 | const QString COMMA = u", "_s; 18 | const QString null_ = u"null"_s; 19 | 20 | // Database related 21 | const QString QMYSQL = u"QMYSQL"_s; 22 | // const QString QPSQL = u"QPSQL"_s; 23 | // const QString QSQLITE = u"QSQLITE"_s; 24 | 25 | // Others 26 | const QString NotImplemented = u"Not implemented :/."_s; 27 | 28 | } // namespace Orm::Drivers::Constants 29 | 30 | TINYORM_END_COMMON_NAMESPACE 31 | -------------------------------------------------------------------------------- /drivers/common/src/orm/drivers/dummysqlerror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/dummysqlerror.hpp" 2 | 3 | #ifndef QT_NO_DEBUG_STREAM 4 | # include 5 | #endif 6 | 7 | #ifndef QT_NO_DEBUG_STREAM 8 | QDebug 9 | operator<<(QDebug debug, 10 | const TINYORM_PREPEND_NAMESPACE(Orm::Drivers::DummySqlError) &/*unused*/) 11 | { 12 | debug << "DummySqlError(errorType: NoError)"; 13 | return debug; 14 | } 15 | #endif 16 | -------------------------------------------------------------------------------- /drivers/common/src/orm/drivers/exceptions/logicerror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/exceptions/logicerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Orm::Drivers::Exceptions 6 | { 7 | 8 | /* public */ 9 | 10 | LogicError::LogicError(const char *message) 11 | : std::logic_error(message) 12 | {} 13 | 14 | LogicError::LogicError(const QString &message) 15 | : std::logic_error(message.toUtf8().constData()) 16 | {} 17 | 18 | LogicError::LogicError(const std::string &message) 19 | : std::logic_error(message) 20 | {} 21 | 22 | } // namespace Orm::Drivers::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | -------------------------------------------------------------------------------- /drivers/common/src/orm/drivers/exceptions/runtimeerror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/exceptions/runtimeerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Orm::Drivers::Exceptions 6 | { 7 | 8 | /* public */ 9 | 10 | RuntimeError::RuntimeError(const char *message) 11 | : std::runtime_error(message) 12 | {} 13 | 14 | RuntimeError::RuntimeError(const QString &message) 15 | : std::runtime_error(message.toUtf8().constData()) 16 | {} 17 | 18 | RuntimeError::RuntimeError(const std::string &message) 19 | : std::runtime_error(message) 20 | {} 21 | 22 | } // namespace Orm::Drivers::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | -------------------------------------------------------------------------------- /drivers/common/src/src.pri: -------------------------------------------------------------------------------- 1 | sourcesList = 2 | 3 | extern_constants: \ 4 | sourcesList += $$PWD/orm/drivers/constants_extern_p.cpp 5 | 6 | build_loadable_drivers: \ 7 | sourcesList += $$PWD/orm/drivers/utils/fs_p.cpp 8 | 9 | sourcesList += \ 10 | $$PWD/orm/drivers/concerns/selectsallcolumnswithlimit0.cpp \ 11 | $$PWD/orm/drivers/dummysqlerror.cpp \ 12 | $$PWD/orm/drivers/exceptions/logicerror.cpp \ 13 | $$PWD/orm/drivers/exceptions/queryerror.cpp \ 14 | $$PWD/orm/drivers/exceptions/runtimeerror.cpp \ 15 | $$PWD/orm/drivers/exceptions/sqlerror.cpp \ 16 | $$PWD/orm/drivers/libraryinfo.cpp \ 17 | $$PWD/orm/drivers/sqldatabase.cpp \ 18 | $$PWD/orm/drivers/sqldatabase_p.cpp \ 19 | $$PWD/orm/drivers/sqldatabasemanager.cpp \ 20 | $$PWD/orm/drivers/sqldriver.cpp \ 21 | $$PWD/orm/drivers/sqlfield.cpp \ 22 | $$PWD/orm/drivers/sqlquery.cpp \ 23 | $$PWD/orm/drivers/sqlrecord.cpp \ 24 | $$PWD/orm/drivers/sqlresult.cpp \ 25 | $$PWD/orm/drivers/sqlresult_p.cpp \ 26 | $$PWD/orm/drivers/support/sqldriverfactory_p.cpp \ 27 | $$PWD/orm/drivers/utils/type_p.cpp \ 28 | 29 | SOURCES += $$sorted(sourcesList) 30 | 31 | unset(sourcesList) 32 | -------------------------------------------------------------------------------- /drivers/drivers.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | load(private/tiny_drivers) 4 | 5 | SUBDIRS = common 6 | 7 | build_loadable_drivers: \ 8 | tiny_is_building_driver(mysql) { 9 | SUBDIRS += mysql 10 | mysql.depends = common 11 | } 12 | -------------------------------------------------------------------------------- /drivers/mysql/include/include.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | headersList = \ 4 | $$PWD/orm/drivers/mysql/mysqldriver.hpp \ 5 | $$PWD/orm/drivers/mysql/mysqlresult.hpp \ 6 | $$PWD/orm/drivers/mysql/version.hpp \ 7 | 8 | HEADERS += $$sorted(headersList) 9 | 10 | unset(headersList) 11 | -------------------------------------------------------------------------------- /drivers/mysql/include/pch.h: -------------------------------------------------------------------------------- 1 | /* This file can't be included in the project, it's for a precompiled header. */ 2 | 3 | /* Add C includes here */ 4 | 5 | #ifdef __cplusplus 6 | /* Add C++ includes here */ 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /drivers/mysql/include/pch.pri: -------------------------------------------------------------------------------- 1 | # Use Precompiled headers (PCH) 2 | # --- 3 | 4 | PRECOMPILED_HEADER = $$quote($$PWD/pch.h) 5 | HEADERS += $$PRECOMPILED_HEADER 6 | 7 | precompile_header: \ 8 | DEFINES *= TINYMYSQL_USING_PCH 9 | -------------------------------------------------------------------------------- /drivers/mysql/include_private/include_private.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | headersList = 4 | 5 | extern_constants: \ 6 | headersList += $$PWD/orm/drivers/mysql/mysqlconstants_extern_p.hpp 7 | else: \ 8 | headersList += $$PWD/orm/drivers/mysql/mysqlconstants_inline_p.hpp 9 | 10 | headersList += \ 11 | $$PWD/orm/drivers/mysql/concerns/populatesfielddefaultvalues_p.hpp \ 12 | $$PWD/orm/drivers/mysql/macros/includemysqlh_p.hpp \ 13 | $$PWD/orm/drivers/mysql/mysqlconstants_p.hpp \ 14 | $$PWD/orm/drivers/mysql/mysqldriver_p.hpp \ 15 | $$PWD/orm/drivers/mysql/mysqlresult_p.hpp \ 16 | $$PWD/orm/drivers/mysql/mysqltypes_p.hpp \ 17 | $$PWD/orm/drivers/mysql/mysqlutils_p.hpp \ 18 | 19 | HEADERS += $$sorted(headersList) 20 | 21 | unset(headersList) 22 | -------------------------------------------------------------------------------- /drivers/mysql/include_private/orm/drivers/mysql/macros/includemysqlh_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_MYSQL_MACROS_INCLUDEMYSQLH_P_HPP 3 | #define ORM_DRIVERS_MYSQL_MACROS_INCLUDEMYSQLH_P_HPP 4 | 5 | #if __has_include() 6 | # include // IWYU pragma: export 7 | #elif __has_include() 8 | # include // IWYU pragma: export 9 | #else 10 | # error Can not find the header file, please install the MySQL C client \ 11 | library. 12 | #endif 13 | 14 | #endif // ORM_DRIVERS_MYSQL_MACROS_INCLUDEMYSQLH_P_HPP 15 | -------------------------------------------------------------------------------- /drivers/mysql/include_private/orm/drivers/mysql/mysqlconstants_extern_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_EXTERN_P_HPP 3 | #define ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_EXTERN_P_HPP 4 | 5 | #include 6 | 7 | #include 8 | 9 | TINYORM_BEGIN_COMMON_NAMESPACE 10 | 11 | /*! Namespace contains common chars and strings used in the TinyMySql project. */ 12 | namespace Orm::Drivers::MySql::Constants 13 | { 14 | 15 | // Common chars 16 | extern const QChar DOT; 17 | extern const QChar SEMICOLON; 18 | extern const QChar COLON; 19 | extern const QChar DASH; 20 | extern const QChar EQ_C; 21 | extern const QChar BACKTICK; 22 | 23 | // Common strings 24 | extern const QString EMPTY; 25 | extern const QString COMMA; 26 | 27 | // Database related 28 | extern const QString QMYSQL; 29 | // extern const QString QPSQL; 30 | // extern const QString QSQLITE; 31 | 32 | } // namespace Orm::Drivers::MySql::Constants 33 | 34 | TINYORM_END_COMMON_NAMESPACE 35 | 36 | #endif // ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_EXTERN_P_HPP 37 | -------------------------------------------------------------------------------- /drivers/mysql/include_private/orm/drivers/mysql/mysqlconstants_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_P_HPP 3 | #define ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_P_HPP 4 | 5 | /* Currently, there is no need to create a separate config.hpp file for the TinyMySql 6 | project because it uses the same constants as the TinyDrivers project. 7 | I will not support separate constants for the TinyMySql/SQLite/Postgres projects. 8 | Everything will be configured using a single set of constants, although projects may 9 | end up as separate shared libraries (dll-s), it has no effect on it. */ 10 | #include "orm/drivers/config_p.hpp" // IWYU pragma: keep 11 | 12 | #ifdef TINYDRIVERS_EXTERN_CONSTANTS 13 | # include "orm/drivers/mysql/mysqlconstants_extern_p.hpp" // IWYU pragma: export 14 | #else 15 | # include "orm/drivers/mysql/mysqlconstants_inline_p.hpp" // IWYU pragma: export 16 | #endif 17 | 18 | #endif // ORM_DRIVERS_MYSQL_MYSQLCONSTANTS_P_HPP 19 | -------------------------------------------------------------------------------- /drivers/mysql/include_private/orm/drivers/mysql/mysqltypes_p.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_DRIVERS_MYSQL_MYSQLTYPES_P_HPP 3 | #define ORM_DRIVERS_MYSQL_MYSQLTYPES_P_HPP 4 | 5 | #include "orm/drivers/mysql/macros/includemysqlh_p.hpp" // IWYU pragma: export 6 | 7 | /* MySQL >=8.0.1 removed the my_bool typedef while MariaDB kept it, so it's still needed 8 | for MariaDB because my_bool == char and compilation fails with the bool type. 9 | MySQL replaced it with bool type and MariaDB uses char type and that's a problem. 10 | See https://bugs.mysql.com/bug.php?id=85131 */ 11 | #if defined(MARIADB_VERSION_ID) || MYSQL_VERSION_ID < 80001 12 | using my_bool = decltype (mysql_stmt_bind_result(nullptr, nullptr)); 13 | #else 14 | using my_bool = bool; 15 | #endif 16 | 17 | #endif // ORM_DRIVERS_MYSQL_MYSQLTYPES_P_HPP 18 | -------------------------------------------------------------------------------- /drivers/mysql/src/orm/drivers/mysql/main.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/mysql/mysqldriver.hpp" 2 | 3 | using TINYORM_PREPEND_NAMESPACE(Orm::Drivers::SqlDriver); 4 | using TINYORM_PREPEND_NAMESPACE(Orm::Drivers::MySql::MySqlDriver); 5 | 6 | /* There is no way to return anything other than a raw pointer as the extern "C" is used. 7 | Also, don't use the static local variable to cache the driver, it causes weird bugs. 8 | The SqlDatabase will be responsible for destroying the MySqlDriver instance during 9 | the destruction or the removeDatabase() call inside the invalidateDatabase() method. */ 10 | 11 | /*! Factory method to create the MySqlDriver instance. */ 12 | extern "C" Q_DECL_EXPORT SqlDriver *TinyDriverInstance() 13 | { 14 | return new MySqlDriver(); // NOLINT(cppcoreguidelines-owning-memory) 15 | } 16 | -------------------------------------------------------------------------------- /drivers/mysql/src/orm/drivers/mysql/mysqlconstants_extern_p.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/drivers/mysql/mysqlconstants_extern_p.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | using namespace Qt::StringLiterals; // NOLINT(google-build-using-namespace) 6 | 7 | namespace Orm::Drivers::MySql::Constants 8 | { 9 | 10 | // Common chars 11 | const QChar DOT = '.'_L1; 12 | const QChar SEMICOLON = ';'_L1; 13 | const QChar COLON = ':'_L1; 14 | const QChar DASH = '-'_L1; 15 | const QChar EQ_C = '='_L1; 16 | const QChar BACKTICK = '`'_L1; 17 | 18 | // Common strings 19 | const QString EMPTY = ""_L1; 20 | const QString COMMA = u", "_s; 21 | 22 | // Database related 23 | const QString QMYSQL = u"QMYSQL"_s; 24 | // const QString QPSQL = u"QPSQL"_s; 25 | // const QString QSQLITE = u"QSQLITE"_s; 26 | 27 | } // namespace Orm::Drivers::MySql::Constants 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | -------------------------------------------------------------------------------- /drivers/mysql/src/src.pri: -------------------------------------------------------------------------------- 1 | sourcesList = 2 | 3 | extern_constants: \ 4 | sourcesList += $$PWD/orm/drivers/mysql/mysqlconstants_extern_p.cpp 5 | 6 | build_loadable_drivers: \ 7 | sourcesList += $$PWD/orm/drivers/mysql/main.cpp 8 | 9 | sourcesList += \ 10 | $$PWD/orm/drivers/mysql/concerns/populatesfielddefaultvalues_p.cpp \ 11 | $$PWD/orm/drivers/mysql/mysqldriver.cpp \ 12 | $$PWD/orm/drivers/mysql/mysqldriver_p.cpp \ 13 | $$PWD/orm/drivers/mysql/mysqlresult.cpp \ 14 | $$PWD/orm/drivers/mysql/mysqlresult_p.cpp \ 15 | $$PWD/orm/drivers/mysql/mysqlutils_p.cpp \ 16 | 17 | SOURCES += $$sorted(sourcesList) 18 | 19 | unset(sourcesList) 20 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(TOM_EXAMPLE) 2 | add_subdirectory(tom) 3 | endif() 4 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | tom_example:!disable_tom { 4 | SUBDIRS += tom 5 | 6 | !build_pass: message("Build the tom example.") 7 | } 8 | -------------------------------------------------------------------------------- /examples/tom/tom.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | TEMPLATE = app 4 | TARGET = tom 5 | 6 | # Common for all executables 7 | # --- 8 | 9 | include($$TINYORM_SOURCE_TREE/qmake/common/executables.pri) 10 | 11 | # Link against TinyORM library for Tom application (also adds defines and include headers) 12 | # --- 13 | 14 | include($$TINYORM_SOURCE_TREE/qmake/tom.pri) 15 | 16 | # TinyTom example application specific configuration 17 | # --- 18 | 19 | CONFIG *= cmdline 20 | 21 | # TinyTom example application defines 22 | # --- 23 | 24 | DEFINES *= PROJECT_TOM_EXAMPLE 25 | 26 | # TinyTom example application header and source files 27 | # --- 28 | 29 | SOURCES += $$PWD/main.cpp 30 | 31 | # Deployment 32 | # --- 33 | 34 | win32-msvc:CONFIG(debug, debug|release) { 35 | win32-msvc: target.path = C:/optx64/$${TARGET} 36 | # else: unix:!android: target.path = /opt/$${TARGET}/bin 37 | !isEmpty(target.path): INSTALLS += target 38 | } 39 | 40 | # User Configuration 41 | # --- 42 | 43 | exists($$PWD/conf.pri): \ 44 | include($$PWD/conf.pri) 45 | 46 | else:disable_autoconf: \ 47 | error( "'conf.pri' for '$${TARGET}' example project does not exist.\ 48 | See an example configuration in 'examples/tom/conf.pri.example'." ) 49 | -------------------------------------------------------------------------------- /include/orm/concerns/hasconnectionresolver.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_CONCERNS_HASCONNECTIONRESOLVER_HPP 3 | #define ORM_CONCERNS_HASCONNECTIONRESOLVER_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/macros/commonnamespace.hpp" 9 | #include "orm/macros/export.hpp" 10 | 11 | TINYORM_BEGIN_COMMON_NAMESPACE 12 | 13 | namespace Orm 14 | { 15 | class ConnectionResolverInterface; 16 | 17 | namespace Concerns 18 | { 19 | 20 | /*! Connection resolver. */ 21 | class TINYORM_EXPORT HasConnectionResolver 22 | { 23 | public: 24 | /*! Get the connection resolver instance. */ 25 | static ConnectionResolverInterface *getConnectionResolver() noexcept; 26 | 27 | /*! Set the connection resolver instance. */ 28 | static void setConnectionResolver(ConnectionResolverInterface *resolver) noexcept; 29 | 30 | /*! Unset the connection resolver for models. */ 31 | static void unsetConnectionResolver() noexcept; 32 | }; 33 | 34 | } // namespace Concerns 35 | } // namespace Orm 36 | 37 | TINYORM_END_COMMON_NAMESPACE 38 | 39 | #endif // ORM_CONCERNS_HASCONNECTIONRESOLVER_HPP 40 | -------------------------------------------------------------------------------- /include/orm/connectors/connectorinterface.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_CONNCECTORS_CONNECTORINTERFACE_HPP 3 | #define ORM_CONNCECTORS_CONNECTORINTERFACE_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | #include "orm/macros/commonnamespace.hpp" 11 | 12 | TINYORM_BEGIN_COMMON_NAMESPACE 13 | 14 | namespace Orm::Connectors 15 | { 16 | /*! Type for the Connection name (QString). */ 17 | using ConnectionName = QString; 18 | 19 | /*! Connectors interface class. */ 20 | class ConnectorInterface 21 | { 22 | Q_DISABLE_COPY_MOVE(ConnectorInterface) 23 | 24 | public: 25 | /*! Default constructor. */ 26 | ConnectorInterface() = default; 27 | /*! Pure virtual destructor. */ 28 | inline virtual ~ConnectorInterface() = 0; 29 | 30 | /*! Establish a database connection. */ 31 | virtual ConnectionName connect(const QVariantHash &config) const = 0; 32 | }; 33 | 34 | /* public */ 35 | 36 | ConnectorInterface::~ConnectorInterface() = default; 37 | 38 | } // namespace Orm::Connectors 39 | 40 | TINYORM_END_COMMON_NAMESPACE 41 | 42 | #endif // ORM_CONNCECTORS_CONNECTORINTERFACE_HPP 43 | -------------------------------------------------------------------------------- /include/orm/constants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_CONSTANTS_HPP 3 | #define ORM_CONSTANTS_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/config.hpp" // IWYU pragma: keep 9 | 10 | #ifdef TINYORM_EXTERN_CONSTANTS 11 | # include "orm/constants_extern.hpp" // IWYU pragma: export 12 | #else 13 | # include "orm/constants_inline.hpp" // IWYU pragma: export 14 | #endif 15 | 16 | #endif // ORM_CONSTANTS_HPP 17 | -------------------------------------------------------------------------------- /include/orm/exceptions/domainerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_DOMAINERROR_HPP 3 | #define ORM_EXCEPTIONS_DOMAINERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM Domain exception. */ 16 | class DomainError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_DOMAINERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/invalidargumenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 3 | #define ORM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM invalid argument exception. */ 16 | class InvalidArgumentError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/invalidformaterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_INVALIDFORMATERROR_HPP 3 | #define ORM_EXCEPTIONS_INVALIDFORMATERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM invalid format exception. */ 16 | class InvalidFormatError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_INVALIDFORMATERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/invalidtemplateargumenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 3 | #define ORM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/invalidargumenterror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM invalid template argument exception. */ 16 | class InvalidTemplateArgumentError : public InvalidArgumentError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using InvalidArgumentError::InvalidArgumentError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/lostconnectionerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_LOSTCONNECTIONERROR_HPP 3 | #define ORM_EXCEPTIONS_LOSTCONNECTIONERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM lost connection exception. */ 16 | class LostConnectionError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_LOSTCONNECTIONERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/ormerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_ORMERROR_HPP 3 | #define ORM_EXCEPTIONS_ORMERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/macros/commonnamespace.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM exceptions tag, all TinyORM exceptions are derived from this class. */ 16 | class OrmError // NOLINT(cppcoreguidelines-special-member-functions) clazy:exclude=copyable-polymorphic 17 | { 18 | public: 19 | /*! Pure virtual destructor. */ 20 | inline virtual ~OrmError() = 0; 21 | }; 22 | 23 | /* public */ 24 | 25 | OrmError::~OrmError() = default; 26 | 27 | } // namespace Orm::Exceptions 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | 31 | #endif // ORM_EXCEPTIONS_ORMERROR_HPP 32 | -------------------------------------------------------------------------------- /include/orm/exceptions/outofrangeerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_OUTOFRANGEERROR_HPP 3 | #define ORM_EXCEPTIONS_OUTOFRANGEERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyDrivers out of range exception. */ 16 | class OutOfRangeError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_OUTOFRANGEERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/recordsnotfounderror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_RECORDSNOTFOUNDERROR_HPP 3 | #define ORM_EXCEPTIONS_RECORDSNOTFOUNDERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/runtimeerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! Found zero records (used by Builder::sole()). */ 16 | class RecordsNotFoundError : public RuntimeError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using RuntimeError::RuntimeError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_RECORDSNOTFOUNDERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/searchpathemptyerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_SEARCHPATHEMPTYERROR_HPP 3 | #define ORM_EXCEPTIONS_SEARCHPATHEMPTYERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/invalidargumenterror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! The PostgreSQL 'search_path' is empty exception (TinyORM). */ 16 | class SearchPathEmptyError : public InvalidArgumentError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using InvalidArgumentError::InvalidArgumentError; 20 | }; 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_EXCEPTIONS_SEARCHPATHEMPTYERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/exceptions/sqltransactionerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 3 | #define ORM_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/sqlerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Exceptions 13 | { 14 | 15 | /*! TinyORM Sql transaction exception. TinyOrm library compiled against 16 | the TinyDrivers doesn't use this exception class. */ 17 | class SqlTransactionError : public SqlError // clazy:exclude=copyable-polymorphic 18 | { 19 | /*! Inherit constructors. */ 20 | using SqlError::SqlError; // NOLINT(cppcoreguidelines-rvalue-reference-param-not-moved) 21 | }; 22 | 23 | } // namespace Orm::Exceptions 24 | 25 | TINYORM_END_COMMON_NAMESPACE 26 | 27 | #endif // ORM_EXCEPTIONS_SQLTRANSACTIONERROR_HPP 28 | -------------------------------------------------------------------------------- /include/orm/macros/commonnamespace.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_COMMONNAMESPACE_HPP 3 | #define ORM_MACROS_COMMONNAMESPACE_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | // User defined namespace 9 | #ifdef TINYORM_COMMON_NAMESPACE 10 | # define TINYORM_BEGIN_COMMON_NAMESPACE namespace TINYORM_COMMON_NAMESPACE { 11 | # define TINYORM_END_COMMON_NAMESPACE } 12 | # define TINYORM_PREPEND_NAMESPACE(name) TINYORM_COMMON_NAMESPACE::name 13 | // User namespace is not defined 14 | #else 15 | # define TINYORM_BEGIN_COMMON_NAMESPACE 16 | # define TINYORM_END_COMMON_NAMESPACE 17 | # define TINYORM_PREPEND_NAMESPACE(name) name 18 | #endif 19 | 20 | #endif // ORM_MACROS_COMMONNAMESPACE_HPP 21 | -------------------------------------------------------------------------------- /include/orm/macros/export.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_EXPORT_HPP 3 | #define ORM_MACROS_EXPORT_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/macros/export_common.hpp" 9 | 10 | #ifdef TINYORM_BUILDING_SHARED 11 | # define TINYORM_EXPORT TINY_DECL_EXPORT 12 | #elif defined(TINYORM_LINKING_SHARED) 13 | # define TINYORM_EXPORT TINY_DECL_IMPORT 14 | #endif 15 | 16 | // Building library archive (static) 17 | #ifndef TINYORM_EXPORT 18 | # define TINYORM_EXPORT 19 | #endif 20 | 21 | #endif // ORM_MACROS_EXPORT_HPP 22 | -------------------------------------------------------------------------------- /include/orm/macros/export_common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_EXPORT_COMMON_HPP 3 | #define ORM_MACROS_EXPORT_COMMON_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #if defined(_MSC_VER) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) \ 9 | || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \ 10 | || defined(__NT__) 11 | # define TINY_DECL_EXPORT __declspec(dllexport) 12 | # define TINY_DECL_IMPORT __declspec(dllimport) 13 | #elif __GNUG__ >= 4 14 | # define TINY_DECL_EXPORT __attribute__((visibility("default"))) 15 | # define TINY_DECL_IMPORT __attribute__((visibility("default"))) 16 | # define TINY_DECL_HIDDEN __attribute__((visibility("hidden"))) 17 | #else 18 | # define TINY_DECL_EXPORT 19 | # define TINY_DECL_IMPORT 20 | #endif 21 | 22 | #ifndef TINY_DECL_HIDDEN 23 | # define TINY_DECL_HIDDEN 24 | #endif 25 | 26 | #endif // ORM_MACROS_EXPORT_COMMON_HPP 27 | -------------------------------------------------------------------------------- /include/orm/macros/likely.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_LIKELY_HPP 3 | #define ORM_MACROS_LIKELY_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #ifndef __has_cpp_attribute 9 | # define T_LIKELY 10 | #elif __has_cpp_attribute(likely) >= 201803L 11 | # define T_LIKELY [[likely]] 12 | #else 13 | # define T_LIKELY 14 | #endif 15 | 16 | #ifndef __has_cpp_attribute 17 | # define T_UNLIKELY 18 | #elif __has_cpp_attribute(unlikely) >= 201803L 19 | # define T_UNLIKELY [[unlikely]] 20 | #else 21 | # define T_UNLIKELY 22 | #endif 23 | 24 | #endif // ORM_MACROS_LIKELY_HPP 25 | -------------------------------------------------------------------------------- /include/orm/macros/logexecutedquery.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_LOGEXECUTEDQUERY_HPP 3 | #define ORM_MACROS_LOGEXECUTEDQUERY_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/config.hpp" // IWYU pragma: keep 9 | 10 | #include "orm/macros/commonnamespace.hpp" 11 | 12 | #if !defined(LOG_EXECUTED_QUERY) && !defined(TINYORM_NO_DEBUG) 13 | # include "orm/utils/query.hpp" 14 | #endif 15 | 16 | TINYORM_BEGIN_COMMON_NAMESPACE 17 | 18 | #ifndef LOG_EXECUTED_QUERY 19 | # ifndef TINYORM_NO_DEBUG 20 | # define LOG_EXECUTED_QUERY(query) Orm::Utils::Query::logExecutedQuery(query) 21 | # else 22 | # define LOG_EXECUTED_QUERY(query) qt_noop() 23 | # endif 24 | #endif 25 | 26 | TINYORM_END_COMMON_NAMESPACE 27 | 28 | #endif // ORM_MACROS_LOGEXECUTEDQUERY_HPP 29 | -------------------------------------------------------------------------------- /include/orm/macros/stringify.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_STRINGIFY_HPP 3 | #define ORM_MACROS_STRINGIFY_HPP 4 | 5 | // Excluded for the Resource compiler 6 | #ifndef RC_INVOKED 7 | # include "orm/macros/systemheader.hpp" 8 | TINY_SYSTEM_HEADER 9 | #endif 10 | 11 | #ifndef TINY_STRINGIFY 12 | // NOLINTNEXTLINE(bugprone-reserved-identifier) 13 | # define TINY__STRINGIFY(x) #x // clazy:exclude=ifndef-define-typo 14 | # define TINY_STRINGIFY(x) TINY__STRINGIFY(x) 15 | #endif 16 | 17 | #endif // ORM_MACROS_STRINGIFY_HPP 18 | -------------------------------------------------------------------------------- /include/orm/macros/systemheader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_MACROS_SYSTEMHEADER_HPP 3 | #define ORM_MACROS_SYSTEMHEADER_HPP 4 | 5 | /* The system_header pragma is and must be disabled for all our libraries and executables. 6 | Which means that every library/executable must define the private C macro 7 | TINYORM_PRAGMA_SYSTEM_HEADER_OFF, if this is not the case, all warnings will be 8 | suppressed, so this needs a special care if a new library/executable is added 9 | to the TinyORM project. */ 10 | #ifndef TINYORM_PRAGMA_SYSTEM_HEADER_OFF 11 | // Clang masquerades as GCC 4.2.0 so it has to be first 12 | # ifdef __clang__ 13 | # define TINY_SYSTEM_HEADER _Pragma("clang system_header") 14 | # elif __GNUC__ * 100 + __GNUC_MINOR__ > 301 15 | # define TINY_SYSTEM_HEADER _Pragma("GCC system_header") 16 | # elif defined(_MSC_VER) 17 | # define TINY_SYSTEM_HEADER _Pragma("system_header") 18 | # endif 19 | #endif 20 | 21 | #ifndef TINY_SYSTEM_HEADER 22 | # define TINY_SYSTEM_HEADER 23 | #endif 24 | 25 | TINY_SYSTEM_HEADER 26 | 27 | #endif // ORM_MACROS_SYSTEMHEADER_HPP 28 | -------------------------------------------------------------------------------- /include/orm/query/processors/mysqlprocessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_QUERY_PROCESSORS_MYSQLPROCESSOR_HPP 3 | #define ORM_QUERY_PROCESSORS_MYSQLPROCESSOR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/query/processors/processor.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Query::Processors 13 | { 14 | 15 | /*! MySQL processor, process SQL results. */ 16 | class MySqlProcessor final : public Processor 17 | { 18 | Q_DISABLE_COPY_MOVE(MySqlProcessor) 19 | 20 | public: 21 | /*! Default constructor. */ 22 | MySqlProcessor() = default; 23 | /*! Virtual destructor. */ 24 | ~MySqlProcessor() final = default; 25 | }; 26 | 27 | } // namespace Orm::Query::Processors 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | 31 | #endif // ORM_QUERY_PROCESSORS_MYSQLPROCESSOR_HPP 32 | -------------------------------------------------------------------------------- /include/orm/query/processors/postgresprocessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_QUERY_PROCESSORS_POSTGRESPROCESSOR_HPP 3 | #define ORM_QUERY_PROCESSORS_POSTGRESPROCESSOR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/query/processors/processor.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Query::Processors 13 | { 14 | 15 | /*! PostgreSQL processor, process SQL results. */ 16 | class PostgresProcessor final : public Processor 17 | { 18 | Q_DISABLE_COPY_MOVE(PostgresProcessor) 19 | 20 | public: 21 | /*! Default constructor. */ 22 | PostgresProcessor() = default; 23 | /*! Virtual destructor. */ 24 | ~PostgresProcessor() final = default; 25 | }; 26 | 27 | } // namespace Orm::Query::Processors 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | 31 | #endif // ORM_QUERY_PROCESSORS_POSTGRESPROCESSOR_HPP 32 | -------------------------------------------------------------------------------- /include/orm/query/processors/sqliteprocessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_QUERY_PROCESSORS_SQLITEPROCESSOR_HPP 3 | #define ORM_QUERY_PROCESSORS_SQLITEPROCESSOR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/query/processors/processor.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Query::Processors 13 | { 14 | 15 | /*! SQLite processor, process SQL results. */ 16 | class TINYORM_EXPORT SQLiteProcessor final : public Processor 17 | { 18 | Q_DISABLE_COPY_MOVE(SQLiteProcessor) 19 | 20 | /*! Alias for the SqlQuery. */ 21 | using SqlQuery = Orm::Types::SqlQuery; 22 | 23 | public: 24 | /*! Default constructor. */ 25 | SQLiteProcessor() = default; 26 | /*! Virtual destructor. */ 27 | ~SQLiteProcessor() final = default; 28 | 29 | /*! Process the results of a column listing query. */ 30 | QStringList processColumnListing(SqlQuery &query) const final; 31 | }; 32 | 33 | } // namespace Orm::Query::Processors 34 | 35 | TINYORM_END_COMMON_NAMESPACE 36 | 37 | #endif // ORM_QUERY_PROCESSORS_SQLITEPROCESSOR_HPP 38 | -------------------------------------------------------------------------------- /include/orm/schema/schemaconstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_SCHEMA_SCHEMACONSTANTS_HPP 3 | #define ORM_SCHEMA_SCHEMACONSTANTS_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/config.hpp" // IWYU pragma: keep 9 | 10 | #ifdef TINYORM_EXTERN_CONSTANTS 11 | # include "orm/schema/schemaconstants_extern.hpp" // IWYU pragma: export 12 | #else 13 | # include "orm/schema/schemaconstants_inline.hpp" // IWYU pragma: export 14 | #endif 15 | 16 | #endif // ORM_SCHEMA_SCHEMACONSTANTS_HPP 17 | -------------------------------------------------------------------------------- /include/orm/tiny/concerns/guardedmodel.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_TINY_CONCERNS_GUARDEDMODEL_HPP 3 | #define ORM_TINY_CONCERNS_GUARDEDMODEL_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | #include "orm/macros/commonnamespace.hpp" 11 | #include "orm/macros/export.hpp" 12 | 13 | TINYORM_BEGIN_COMMON_NAMESPACE 14 | 15 | namespace Orm::Tiny::Concerns 16 | { 17 | 18 | /*! Manages mass assignment restrictions for the entire Model class. */ 19 | class TINYORM_EXPORT GuardedModel 20 | { 21 | public: 22 | /*! Run the given callable while being unguarded. */ 23 | static void unguarded(const std::function &callback); 24 | 25 | /*! Disable all mass assignable restrictions. */ 26 | static void unguard(bool state = true) noexcept; 27 | /*! Enable the mass assignment restrictions. */ 28 | static void reguard() noexcept; 29 | 30 | /*! Determine if the current state is "unguarded". */ 31 | static bool isUnguarded() noexcept; 32 | }; 33 | 34 | } // namespace Orm::Tiny::Concerns 35 | 36 | TINYORM_END_COMMON_NAMESPACE 37 | 38 | #endif // ORM_TINY_CONCERNS_GUARDEDMODEL_HPP 39 | -------------------------------------------------------------------------------- /include/orm/tiny/exceptions/massassignmenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_TINY_EXCEPTIONS_MASSASSIGNMENTERROR_HPP 3 | #define ORM_TINY_EXCEPTIONS_MASSASSIGNMENTERROR_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/exceptions/runtimeerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm::Tiny::Exceptions 13 | { 14 | 15 | /*! Mass assignment exception. */ 16 | class MassAssignmentError : public Orm::Exceptions::RuntimeError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using Orm::Exceptions::RuntimeError::RuntimeError; 20 | }; 21 | 22 | } // namespace Orm::Tiny::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // ORM_TINY_EXCEPTIONS_MASSASSIGNMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /include/orm/types/statementscounter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_TYPES_STATEMENTSCOUNTER_HPP 3 | #define ORM_TYPES_STATEMENTSCOUNTER_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "orm/macros/commonnamespace.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Orm 13 | { 14 | namespace Types 15 | { 16 | 17 | /*! Executed statements counter. */ 18 | struct StatementsCounter 19 | { 20 | // CUR qint64 silverqx 21 | /*! Normal select statements. */ 22 | int normal = -1; 23 | /*! Affecting statements (UPDATE, INSERT, DELETE). */ 24 | int affecting = -1; 25 | /*! Transactional statements (START TRANSACTION, ROLLBACK, COMMIT, SAVEPOINT). */ 26 | int transactional = -1; 27 | }; 28 | 29 | } // namespace Types 30 | 31 | /*! Alias for the Types::StatementsCounter, shortcut alias. */ 32 | using Types::StatementsCounter; // NOLINT(misc-unused-using-decls) 33 | 34 | } // namespace Orm 35 | 36 | TINYORM_END_COMMON_NAMESPACE 37 | 38 | #endif // ORM_TYPES_STATEMENTSCOUNTER_HPP 39 | -------------------------------------------------------------------------------- /include/orm/utils/fs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef ORM_UTILS_FS_HPP 3 | #define ORM_UTILS_FS_HPP 4 | 5 | #include "orm/macros/systemheader.hpp" 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | #include "orm/macros/commonnamespace.hpp" 11 | #include "orm/macros/export.hpp" 12 | 13 | TINYORM_BEGIN_COMMON_NAMESPACE 14 | 15 | namespace Orm::Utils 16 | { 17 | 18 | /*! Filesystem library class. */ 19 | class TINYORM_EXPORT Fs 20 | { 21 | Q_DISABLE_COPY_MOVE(Fs) 22 | 23 | public: 24 | /*! Deleted default constructor, this is a pure library class. */ 25 | Fs() = delete; 26 | /*! Deleted destructor. */ 27 | ~Fs() = delete; 28 | 29 | /*! Resolve ~ home prefix to the full filepath. */ 30 | [[maybe_unused]] 31 | static QString resolveHome(QString filepath); 32 | }; 33 | 34 | } // namespace Orm::Utils 35 | 36 | TINYORM_END_COMMON_NAMESPACE 37 | 38 | #endif // ORM_UTILS_FS_HPP 39 | -------------------------------------------------------------------------------- /include/pch.h: -------------------------------------------------------------------------------- 1 | /* This file can't be included in the project, it's for a precompiled header. */ 2 | 3 | /* Add C includes here */ 4 | 5 | #ifdef __cplusplus 6 | /* Add C++ includes here */ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifndef QT_NO_DEBUG_STREAM 21 | # include 22 | #endif 23 | 24 | #ifdef TINYORM_USING_QTSQLDRIVERS 25 | # include 26 | # include 27 | # include 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #ifdef __GNUG__ 38 | # include 39 | #endif 40 | #if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) 41 | # include 42 | #endif 43 | #endif 44 | -------------------------------------------------------------------------------- /include/pch.pri: -------------------------------------------------------------------------------- 1 | # Use Precompiled headers (PCH) 2 | # --- 3 | 4 | PRECOMPILED_HEADER = $$quote($$PWD/pch.h) 5 | HEADERS += $$PRECOMPILED_HEADER 6 | 7 | precompile_header: \ 8 | DEFINES *= TINYORM_USING_PCH 9 | -------------------------------------------------------------------------------- /qmake/common/executables.pri: -------------------------------------------------------------------------------- 1 | # Common defines for executables 2 | # --- 3 | 4 | # To disable #pragma system_header if compiling TinyORM project itself 5 | DEFINES *= TINYORM_PRAGMA_SYSTEM_HEADER_OFF 6 | -------------------------------------------------------------------------------- /qmake/common/libraries.pri: -------------------------------------------------------------------------------- 1 | # Common for static/shared libraries (don't use for loadable modules libraries) 2 | # --- 3 | 4 | CONFIG *= create_prl create_pc create_libtool 5 | 6 | # Common for static libraries 7 | # --- 8 | 9 | win32: \ 10 | if(CONFIG(static, dll|shared|static|staticlib) | \ 11 | CONFIG(staticlib, dll|shared|static|staticlib)): \ 12 | CONFIG -= embed_manifest_dll 13 | 14 | # Common defines for static/shared libraries 15 | # --- 16 | 17 | # To disable #pragma system_header if compiling TinyORM project itself 18 | DEFINES *= TINYORM_PRAGMA_SYSTEM_HEADER_OFF 19 | -------------------------------------------------------------------------------- /qmake/common/macxconf.pri: -------------------------------------------------------------------------------- 1 | error( "The macOS is not supported." ) 2 | -------------------------------------------------------------------------------- /qmake/features/ccache.prf: -------------------------------------------------------------------------------- 1 | # Allows to enable ccache using "CONFIG+=ccache" on both OS-es. 2 | # The load(ccache) have to be called explicitly otherwise it will not be loaded, 3 | # qmake doesn't call this ccache.prf first and then the mkspecs\features\unix\ccache.prf 4 | # afterwards automatically. 5 | win32: \ 6 | load(tiny_ccache_win32) 7 | 8 | unix:!macx: \ 9 | load(ccache) 10 | -------------------------------------------------------------------------------- /qmake/features/disable_orm.prf: -------------------------------------------------------------------------------- 1 | load(private/tiny_drivers) 2 | 3 | # Nothing to do, TinyDrivers doesn't use this CONFIG option 4 | tiny_is_drivers_target(): \ 5 | return() 6 | 7 | CONFIG *= disable_orm 8 | DEFINES *= TINYORM_DISABLE_ORM 9 | -------------------------------------------------------------------------------- /qmake/features/disable_thread_local.prf: -------------------------------------------------------------------------------- 1 | CONFIG *= disable_thread_local 2 | DEFINES *= TINYORM_DISABLE_THREAD_LOCAL 3 | -------------------------------------------------------------------------------- /qmake/features/disable_tom.prf: -------------------------------------------------------------------------------- 1 | load(private/tiny_drivers) 2 | 3 | # Nothing to do, TinyDrivers doesn't use this CONFIG option 4 | tiny_is_drivers_target(): \ 5 | return() 6 | 7 | CONFIG *= disable_tom 8 | DEFINES *= TINYORM_DISABLE_TOM 9 | -------------------------------------------------------------------------------- /qmake/features/extern_constants.prf: -------------------------------------------------------------------------------- 1 | # Fixed in Clang v18 2 | !build_pass:win32-clang-msvc:versionAtMost(TINY_COMPILER_VERSION, 17): \ 3 | error( "extern constants (extern_constants CONFIG option) cause crashes with\ 4 | the shared library on Clang-cl MSVC <18, please use\ 5 | \"CONFIG += inline_constants\" instead or leave it undefined." ) 6 | 7 | CONFIG -= inline_constants 8 | CONFIG *= extern_constants 9 | 10 | # The TinyDrivers sub-project has its own DEFINES for global constants 11 | equals(TARGET, "TinyDrivers") { 12 | DEFINES -= TINYDRIVERS_INLINE_CONSTANTS 13 | DEFINES *= TINYDRIVERS_EXTERN_CONSTANTS 14 | } 15 | else { 16 | DEFINES -= TINYORM_INLINE_CONSTANTS 17 | DEFINES *= TINYORM_EXTERN_CONSTANTS 18 | } 19 | -------------------------------------------------------------------------------- /qmake/features/inline_constants.prf: -------------------------------------------------------------------------------- 1 | # MinGW Clang shared build crashes with inline constants (fixed in Clang v18) 2 | # Related issue: https://github.com/llvm/llvm-project/issues/55938 3 | !build_pass:win32-clang-g++:versionAtMost(TINY_COMPILER_VERSION, 17): \ 4 | if(CONFIG(dll, dll|shared|static|staticlib) | \ 5 | CONFIG(shared, dll|shared|static|staticlib)): \ 6 | error( "inline constants (inline_constants CONFIG option) cause crashes with\ 7 | the shared library on MinGW Clang <18, please use\ 8 | \"CONFIG += extern_constants\" instead or leave it undefined." ) 9 | 10 | CONFIG -= extern_constants 11 | CONFIG *= inline_constants 12 | 13 | # The TinyDrivers sub-project has its own DEFINES for global constants 14 | equals(TARGET, "TinyDrivers") { 15 | DEFINES -= TINYDRIVERS_EXTERN_CONSTANTS 16 | DEFINES *= TINYDRIVERS_INLINE_CONSTANTS 17 | } 18 | else { 19 | DEFINES -= TINYORM_EXTERN_CONSTANTS 20 | DEFINES *= TINYORM_INLINE_CONSTANTS 21 | } 22 | -------------------------------------------------------------------------------- /qmake/features/private/tiny_dependencies_requirement.prf: -------------------------------------------------------------------------------- 1 | # Check/verify all dependency libraries requirements, throws error() on any problem 2 | 3 | !build_pass: \ 4 | !versionAtLeast(QT_VERSION, $$tinyMinReqQt): \ 5 | error( "Minimum required Qt Framework version was not satisfied, required\ 6 | version >=$${tinyMinReqQt}, your version is $${QT_VERSION}, upgrade\ 7 | Qt Framework.") 8 | -------------------------------------------------------------------------------- /qmake/features/private/tiny_staticlib_check.prf: -------------------------------------------------------------------------------- 1 | !build_pass: \ 2 | CONFIG(staticlib, dll|shared|static|staticlib): \ 3 | if(build_tests|tom_example|tiny_is_building_drivers()): \ 4 | error( "The 'staticlib' can't be used with executables, the build will fail because\ 5 | it will produce some executable, please use the CONFIG += static instead,\ 6 | if you want to build all libraries as static library archives and link\ 7 | against static libraries." ) 8 | -------------------------------------------------------------------------------- /qmake/features/silent.prf: -------------------------------------------------------------------------------- 1 | # Bugfix to silent the rc.exe command-line output on msvc, it overrides/extends 2 | # the original silent.prf feature. 3 | load(silent) 4 | 5 | !macx-xcode:msvc: \ 6 | QMAKE_RC = @$$QMAKE_RC 7 | -------------------------------------------------------------------------------- /qmake/features/tiny_ccache_win32.prf: -------------------------------------------------------------------------------- 1 | # Target the g++, clang++, MSVC, and Clang-cl with MSVC compilers and also MinGW 2 | if(!win32|!msvc):!mingw: return() 3 | 4 | # https://github.com/ccache/ccache/issues/1040 5 | msvc: \ 6 | for(cfFlags, \ 7 | $$list(QMAKE_CFLAGS QMAKE_CXXFLAGS \ 8 | QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_DEBUG \ 9 | QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO \ 10 | # The Release build type shouldn't contain this flag but replace it anyway 11 | QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE) \ 12 | ): \ 13 | !isEmpty($$cfFlags): \ 14 | # Replace -Zi and -ZI with the -Z7 15 | # The ~= doesn't work with \/ character 16 | $$cfFlags = $$replace($$cfFlags, "(?:-|\/)(?:Zi|ZI)", -Z7) 17 | 18 | load(private/tiny_ccache_version) 19 | 20 | # Determine whether to disable PCH based on the ccache --print-version 21 | tiny_should_disable_precompile_headers(): \ 22 | CONFIG -= precompile_header 23 | 24 | for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_LINK_C)): \ 25 | $$tool = ccache $$eval($$tool) 26 | -------------------------------------------------------------------------------- /qmake/features/tiny_system_headers.prf: -------------------------------------------------------------------------------- 1 | # Mark all Qt headers as system headers 2 | 3 | !win32-clang-msvc:!mingw:!unix: \ 4 | return() 5 | 6 | win32-clang-msvc: \ 7 | optionToken = -imsvc 8 | else: \ 9 | optionToken = -isystem 10 | 11 | # On MSYS2 with Qt6 are includes in the C:/msys64/ucrt64/include/qt6/ so tagging them 12 | # as -isystem is needed. 13 | # On Unix and also Clang-cl with MSVC it is needed to avoid warnings from system headers. 14 | QMAKE_CXXFLAGS += $$optionToken $$shell_quote($$[QT_INSTALL_HEADERS]/) 15 | 16 | for(module, QT) { 17 | equals(module, "testlib"): \ 18 | QMAKE_CXXFLAGS += $$optionToken $$shell_quote($$[QT_INSTALL_HEADERS]/QtTest/) 19 | else { 20 | # Capitalize a first letter, result: -isystem /include/QtCore/ 21 | moduleList = $$split(module, ) 22 | QMAKE_CXXFLAGS += \ 23 | $$optionToken $$shell_quote($$[QT_INSTALL_HEADERS]/Qt$$upper(\ 24 | $$take_first(moduleList))$$join(moduleList, )/) 25 | } 26 | } 27 | 28 | unset(optionToken) 29 | unset(moduleList) 30 | -------------------------------------------------------------------------------- /qmake/features/tom_example.prf: -------------------------------------------------------------------------------- 1 | load(private/tiny_drivers) 2 | 3 | # Nothing to do, TinyDrivers doesn't use this CONFIG option 4 | tiny_is_drivers_target(): \ 5 | return() 6 | 7 | CONFIG *= tom_example 8 | DEFINES *= TINYORM_TOM_EXAMPLE 9 | -------------------------------------------------------------------------------- /resources/icons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/resources/icons/favicon.ico -------------------------------------------------------------------------------- /resources/icons/logo-optim.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /resources/icons/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/resources/icons/logo.png -------------------------------------------------------------------------------- /resources/icons/tinyorm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silverqx/TinyORM/9462d12d6d5df67f11be3d4357bdd51bb708ce1f/resources/icons/tinyorm.ico -------------------------------------------------------------------------------- /src/orm/concerns/explainqueries.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/concerns/explainqueries.hpp" 2 | 3 | #include "orm/databaseconnection.hpp" 4 | #include "orm/query/querybuilder.hpp" 5 | 6 | TINYORM_BEGIN_COMMON_NAMESPACE 7 | 8 | namespace Orm::Concerns 9 | { 10 | 11 | /* public */ 12 | 13 | // BUG Qt sql driver does not support to call EXPLAIN as a prepared statement, look at enum StatementType and QSqlDriver::sqlStatement in qsqldriver.h/cpp, also don't forget to add proxies when Qt will support EXPLAIN queries silverqx 14 | TSqlQuery ExplainQueries::explain() 15 | { 16 | return builder().getConnection().select( 17 | QStringLiteral("EXPLAIN %1").arg(builder().toSql()), 18 | builder().getBindings()); 19 | } 20 | 21 | /* private */ 22 | 23 | QueryBuilder &ExplainQueries::builder() 24 | { 25 | return dynamic_cast(*this); 26 | } 27 | 28 | } // namespace Orm::Concerns 29 | 30 | TINYORM_END_COMMON_NAMESPACE 31 | -------------------------------------------------------------------------------- /src/orm/configurations/sqliteconfigurationparser.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/configurations/sqliteconfigurationparser.hpp" 2 | 3 | #include "orm/constants.hpp" 4 | 5 | TINYORM_BEGIN_COMMON_NAMESPACE 6 | 7 | using Orm::Constants::return_qdatetime; 8 | 9 | namespace Orm::Configurations 10 | { 11 | 12 | /* protected */ 13 | 14 | void SQLiteConfigurationParser::parseDriverSpecificOptions() const 15 | { 16 | if (!config().contains(return_qdatetime)) 17 | config().insert(return_qdatetime, true); 18 | } 19 | 20 | void SQLiteConfigurationParser::parseDriverSpecificOptionsOption( 21 | QVariantHash &/*unused*/) const 22 | {} 23 | 24 | } // namespace Orm::Configurations 25 | 26 | TINYORM_END_COMMON_NAMESPACE 27 | -------------------------------------------------------------------------------- /src/orm/exceptions/logicerror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/exceptions/logicerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Orm::Exceptions 6 | { 7 | 8 | /* public */ 9 | 10 | LogicError::LogicError(const char *message) 11 | : std::logic_error(message) 12 | {} 13 | 14 | LogicError::LogicError(const QString &message) 15 | : std::logic_error(message.toUtf8().constData()) 16 | {} 17 | 18 | LogicError::LogicError(const std::string &message) 19 | : std::logic_error(message) 20 | {} 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | -------------------------------------------------------------------------------- /src/orm/exceptions/runtimeerror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/exceptions/runtimeerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Orm::Exceptions 6 | { 7 | 8 | /* public */ 9 | 10 | RuntimeError::RuntimeError(const char *message) 11 | : std::runtime_error(message) 12 | {} 13 | 14 | RuntimeError::RuntimeError(const QString &message) 15 | : std::runtime_error(message.toUtf8().constData()) 16 | {} 17 | 18 | RuntimeError::RuntimeError(const std::string &message) 19 | : std::runtime_error(message) 20 | {} 21 | 22 | } // namespace Orm::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | -------------------------------------------------------------------------------- /src/orm/query/processors/processor.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/query/processors/processor.hpp" 2 | 3 | #include "orm/types/sqlquery.hpp" 4 | #include "orm/utils/query.hpp" 5 | 6 | TINYORM_BEGIN_COMMON_NAMESPACE 7 | 8 | using QueryUtils = Orm::Utils::Query; 9 | 10 | namespace Orm::Query::Processors 11 | { 12 | 13 | QStringList Processor::processColumnListing(SqlQuery &query) const 14 | { 15 | QStringList columns; 16 | columns.reserve(QueryUtils::queryResultSize(query)); 17 | 18 | while (query.next()) 19 | columns << query.value("column_name").value(); 20 | 21 | return columns; 22 | } 23 | 24 | } // namespace Orm::Query::Processors 25 | 26 | TINYORM_END_COMMON_NAMESPACE 27 | -------------------------------------------------------------------------------- /src/orm/query/processors/sqliteprocessor.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/query/processors/sqliteprocessor.hpp" 2 | 3 | #include "orm/types/sqlquery.hpp" 4 | #include "orm/utils/query.hpp" 5 | 6 | TINYORM_BEGIN_COMMON_NAMESPACE 7 | 8 | using QueryUtils = Orm::Utils::Query; 9 | 10 | namespace Orm::Query::Processors 11 | { 12 | 13 | QStringList SQLiteProcessor::processColumnListing(SqlQuery &query) const 14 | { 15 | QStringList columns; 16 | columns.reserve(QueryUtils::queryResultSize(query)); 17 | 18 | while (query.next()) 19 | columns << query.value(NAME).value(); 20 | 21 | return columns; 22 | } 23 | 24 | } // namespace Orm::Query::Processors 25 | 26 | TINYORM_END_COMMON_NAMESPACE 27 | -------------------------------------------------------------------------------- /src/orm/schema/indexdefinitionreference.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/schema/indexdefinitionreference.hpp" 2 | 3 | #include "orm/schema/columndefinition.hpp" 4 | 5 | TINYORM_BEGIN_COMMON_NAMESPACE 6 | 7 | namespace Orm::SchemaNs 8 | { 9 | 10 | /* public */ 11 | 12 | IndexDefinitionReference::IndexDefinitionReference(IndexCommand &indexCommand) 13 | : m_indexCommand(indexCommand) 14 | {} 15 | 16 | IndexDefinitionReference & 17 | IndexDefinitionReference::algorithm(const QString &algorithm) 18 | { 19 | m_indexCommand.get().algorithm = algorithm; 20 | 21 | return *this; 22 | } 23 | 24 | IndexDefinitionReference & 25 | IndexDefinitionReference::language(const QString &language) 26 | { 27 | m_indexCommand.get().language = language; 28 | 29 | return *this; 30 | } 31 | 32 | } // namespace Orm::SchemaNs 33 | 34 | TINYORM_END_COMMON_NAMESPACE 35 | -------------------------------------------------------------------------------- /src/orm/tiny/exceptions/relationnotloadederror.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/tiny/exceptions/relationnotloadederror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Orm::Tiny::Exceptions 6 | { 7 | 8 | /* public */ 9 | 10 | RelationNotLoadedError::RelationNotLoadedError(const QString &model, 11 | const QString &relation) 12 | : RuntimeError(formatMessage(model, relation)) 13 | , m_model(model) 14 | , m_relation(relation) 15 | {} 16 | 17 | /* private */ 18 | 19 | QString RelationNotLoadedError::formatMessage(const QString &model, 20 | const QString &relation) 21 | { 22 | return QStringLiteral("Undefined relation '%1' (in the m_relation data memeber) " 23 | "on model '%2', the relation was not loaded.") 24 | .arg(relation, model); 25 | } 26 | 27 | } // namespace Orm::Tiny::Exceptions 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | -------------------------------------------------------------------------------- /src/orm/utils/fs.cpp: -------------------------------------------------------------------------------- 1 | #include "orm/utils/fs.hpp" 2 | 3 | #include 4 | 5 | TINYORM_BEGIN_COMMON_NAMESPACE 6 | 7 | namespace Orm::Utils 8 | { 9 | 10 | QString Fs::resolveHome(QString filepath) 11 | { 12 | if (filepath == QLatin1Char('~') || filepath.startsWith(QStringLiteral("~/"))) 13 | filepath.replace (0, 1, QDir::homePath()); 14 | 15 | return QDir::cleanPath(filepath); 16 | } 17 | 18 | } // namespace Orm::Utils 19 | 20 | TINYORM_END_COMMON_NAMESPACE 21 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(auto) 2 | add_subdirectory(TinyUtils) 3 | 4 | if(TOM) 5 | add_subdirectory(testdata_tom) 6 | endif() 7 | -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | # Qt Auto Tests 2 | 3 | ### Requirements 4 | 5 | The `tst_PostgreSQL_Connection::searchpath_Undefined_PostgreSQL()` test method hardly depends on the following PostgreSQL configuration (database server configuration, not connection configuration in the TinyUtils::Databases class): 6 | 7 | ``` 8 | search_path = "$user", public 9 | ``` 10 | 11 | The `tst_SchemaBuilder::createTable_Comment()` test method hardly depends on the following PostgreSQL connection configuration (in the TinyUtils::Databases class): 12 | 13 | ``` 14 | search_path = public (set by the env. variable DB_PGSQL_SEARCHPATH = public) 15 | ``` 16 | -------------------------------------------------------------------------------- /tests/TinyUtils/src/export.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TINYUTILS_EXPORT_HPP 3 | #define TINYUTILS_EXPORT_HPP 4 | 5 | #include "orm/macros/export_common.hpp" 6 | 7 | #ifdef TINYUTILS_BUILDING_SHARED 8 | # define TINYUTILS_EXPORT TINY_DECL_EXPORT 9 | #elif defined(TINYUTILS_LINKING_SHARED) 10 | # define TINYUTILS_EXPORT TINY_DECL_IMPORT 11 | #endif 12 | 13 | // Building library archive 14 | #ifndef TINYUTILS_EXPORT 15 | # define TINYUTILS_EXPORT 16 | #endif 17 | 18 | #endif // TINYUTILS_EXPORT_HPP 19 | -------------------------------------------------------------------------------- /tests/TinyUtils/src/fs.cpp: -------------------------------------------------------------------------------- 1 | #include "fs.hpp" 2 | 3 | #include 4 | #include 5 | 6 | namespace TestUtils 7 | { 8 | 9 | QString Fs::cleanPath(const QString &path) 10 | { 11 | auto pathTrimmed = path.trimmed(); 12 | 13 | if (pathTrimmed.isEmpty()) 14 | return pathTrimmed; 15 | 16 | return QDir::cleanPath(pathTrimmed); 17 | } 18 | 19 | QString Fs::absolutePath(const QString &path) 20 | { 21 | return QDir(cleanPath(path)).absolutePath(); 22 | } 23 | 24 | } // namespace TestUtils 25 | -------------------------------------------------------------------------------- /tests/TinyUtils/src/fs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TINYUTILS_FS_HPP 3 | #define TINYUTILS_FS_HPP 4 | 5 | #include 6 | 7 | #include "export.hpp" 8 | 9 | class QString; 10 | 11 | namespace TestUtils 12 | { 13 | 14 | /*! Utility functions related to the filesystem. */ 15 | class TINYUTILS_EXPORT Fs final 16 | { 17 | Q_DISABLE_COPY_MOVE(Fs) 18 | 19 | public: 20 | /*! Deleted default constructor, this is a pure library class. */ 21 | Fs() = delete; 22 | /*! Deleted destructor. */ 23 | ~Fs() = delete; 24 | 25 | /*! Trim and clean a path. */ 26 | static QString cleanPath(const QString &path); 27 | 28 | /*! Return cleaned absolute path. */ 29 | static QString absolutePath(const QString &path); 30 | }; 31 | 32 | } // namespace TestUtils 33 | 34 | #endif // TINYUTILS_FS_HPP 35 | -------------------------------------------------------------------------------- /tests/TinyUtils/src/macros.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TINYUTILS_MACROS_HPP 3 | #define TINYUTILS_MACROS_HPP 4 | 5 | #include 6 | 7 | #ifndef sl 8 | /*! Alias for the QStringLiteral(). */ 9 | # define sl(str) QStringLiteral(str) 10 | #endif 11 | 12 | #ifndef TVERIFY_THROWS_EXCEPTION 13 | # if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) 14 | /*! Alias for QVERIFY_THROWS_EXCEPTION() (temporary workaround for Qt v6.8). */ 15 | # define TVERIFY_THROWS_EXCEPTION(exceptiontype, ...) \ 16 | QVERIFY_THROWS_EXCEPTION(exceptiontype, __VA_ARGS__) 17 | # else 18 | /*! Alias for QVERIFY_EXCEPTION_THROWN(). */ 19 | # define TVERIFY_THROWS_EXCEPTION(exceptiontype, expression) \ 20 | QVERIFY_EXCEPTION_THROWN(expression, exceptiontype) 21 | # endif 22 | #endif 23 | 24 | #endif // TINYUTILS_MACROS_HPP 25 | -------------------------------------------------------------------------------- /tests/TinyUtils/src/src.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/common/collection.hpp \ 5 | $$PWD/databases.hpp \ 6 | $$PWD/export.hpp \ 7 | $$PWD/fs.hpp \ 8 | $$PWD/macros.hpp \ 9 | $$PWD/version.hpp \ 10 | 11 | SOURCES += \ 12 | $$PWD/databases.cpp \ 13 | $$PWD/fs.cpp \ 14 | -------------------------------------------------------------------------------- /tests/auto/.clang-tidy: -------------------------------------------------------------------------------- 1 | # Optimized for Clang-Tidy v18 2 | --- 3 | InheritParentConfig: true 4 | Checks: 5 | - -bugprone-unchecked-optional-access 6 | - -cppcoreguidelines-pro-type-const-cast 7 | - -cppcoreguidelines-pro-type-reinterpret-cast 8 | - -misc-const-correctness 9 | - -readability-function-cognitive-complexity 10 | CheckOptions: 11 | - key: misc-header-include-cycle.IgnoredFilesList 12 | value: '[\\\/]+tests[\\\/]+models[\\\/]+models[\\\/]+.+\.hpp$' 13 | -------------------------------------------------------------------------------- /tests/auto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(functional) 2 | add_subdirectory(unit) 3 | -------------------------------------------------------------------------------- /tests/auto/auto.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | functional \ 5 | unit \ 6 | -------------------------------------------------------------------------------- /tests/auto/functional/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(orm) 2 | add_subdirectory(others) 3 | 4 | if(BUILD_DRIVERS) 5 | add_subdirectory(drivers) 6 | endif() 7 | 8 | if(TOM) 9 | add_subdirectory(tom) 10 | endif() 11 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(sqldatabase) 2 | add_subdirectory(sqldatabasemanager) 3 | add_subdirectory(sqlquery_normal) 4 | add_subdirectory(sqlquery_prepared) 5 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/drivers.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | sqldatabase \ 5 | sqldatabasemanager \ 6 | sqlquery_normal \ 7 | sqlquery_prepared \ 8 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqldatabase/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqldatabase 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqldatabase 6 | tst_sqldatabase.cpp 7 | ) 8 | 9 | add_test(NAME sqldatabase COMMAND sqldatabase) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqldatabase) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqldatabase/sqldatabase.pro: -------------------------------------------------------------------------------- 1 | # Add the TinyDrivers include path as a non-system include path 2 | TINY_DRIVERS_INCLUDE_NONSYSTEM = true 3 | 4 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 5 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 6 | 7 | SOURCES += tst_sqldatabase.cpp 8 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqldatabasemanager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqldatabasemanager 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqldatabasemanager 6 | tst_sqldatabasemanager.cpp 7 | ) 8 | 9 | add_test(NAME sqldatabasemanager COMMAND sqldatabasemanager) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqldatabasemanager RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqldatabasemanager/sqldatabasemanager.pro: -------------------------------------------------------------------------------- 1 | # Add the TinyDrivers include path as a non-system include path 2 | TINY_DRIVERS_INCLUDE_NONSYSTEM = true 3 | 4 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 5 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 6 | 7 | SOURCES += tst_sqldatabasemanager.cpp 8 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqlquery_normal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqlquery_normal 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqlquery_normal 6 | tst_sqlquery_normal.cpp 7 | ) 8 | 9 | add_test(NAME sqlquery_normal COMMAND sqlquery_normal) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqlquery_normal RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqlquery_normal/sqlquery_normal.pro: -------------------------------------------------------------------------------- 1 | # Add the TinyDrivers include path as a non-system include path 2 | TINY_DRIVERS_INCLUDE_NONSYSTEM = true 3 | 4 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 5 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 6 | 7 | SOURCES += tst_sqlquery_normal.cpp 8 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqlquery_prepared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqlquery_prepared 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqlquery_prepared 6 | tst_sqlquery_prepared.cpp 7 | ) 8 | 9 | add_test(NAME sqlquery_prepared COMMAND sqlquery_prepared) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqlquery_prepared RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/drivers/sqlquery_prepared/sqlquery_prepared.pro: -------------------------------------------------------------------------------- 1 | # Add the TinyDrivers include path as a non-system include path 2 | TINY_DRIVERS_INCLUDE_NONSYSTEM = true 3 | 4 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 5 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 6 | 7 | SOURCES += tst_sqlquery_prepared.cpp 8 | -------------------------------------------------------------------------------- /tests/auto/functional/functional.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | load(private/tiny_drivers) 4 | 5 | subdirsList = \ 6 | orm \ 7 | others \ 8 | 9 | tiny_is_building_drivers(): \ 10 | subdirsList += drivers 11 | 12 | !disable_tom: \ 13 | subdirsList += tom 14 | 15 | SUBDIRS = $$sorted(subdirsList) 16 | 17 | unset(subdirsList) 18 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(databasemanager) 2 | add_subdirectory(postgresql_connection) 3 | add_subdirectory(query) 4 | add_subdirectory(schema) 5 | 6 | if(ORM) 7 | add_subdirectory(tiny) 8 | endif() 9 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/databasemanager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(databasemanager 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(databasemanager 6 | tst_databasemanager.cpp 7 | ) 8 | 9 | add_test(NAME databasemanager COMMAND databasemanager) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(databasemanager DEPENDS_ON_UNITTESTS PROVIDES_PCH) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/databasemanager/databasemanager.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_databasemanager.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/orm.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | subdirsList = \ 4 | databasemanager \ 5 | postgresql_connection \ 6 | query \ 7 | schema \ 8 | 9 | !disable_orm: \ 10 | subdirsList += tiny 11 | 12 | SUBDIRS = $$sorted(subdirsList) 13 | 14 | unset(subdirsList) 15 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/postgresql_connection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(postgresql_connection 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(postgresql_connection 6 | tst_postgresql_connection.cpp 7 | ) 8 | 9 | add_test(NAME postgresql_connection COMMAND postgresql_connection) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(postgresql_connection DEPENDS_ON_UNITTESTS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/postgresql_connection/postgresql_connection.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_postgresql_connection.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(blobs) 2 | add_subdirectory(mysql_qdatetime) 3 | add_subdirectory(postgresql_qdatetime) 4 | add_subdirectory(querybuilder) 5 | add_subdirectory(sqlite_qdatetime) 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/blobs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(blobs 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(blobs 6 | tst_blobs.cpp 7 | ) 8 | 9 | add_test(NAME blobs COMMAND blobs) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(blobs DEPENDS_ON_UNITTESTS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/blobs/blobs.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_blobs.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/mysql_qdatetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(mysql_qdatetime 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(mysql_qdatetime 6 | tst_mysql_qdatetime.cpp 7 | ) 8 | 9 | add_test(NAME mysql_qdatetime COMMAND mysql_qdatetime) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(mysql_qdatetime DEPENDS_ON_UNITTESTS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/mysql_qdatetime/mysql_qdatetime.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_mysql_qdatetime.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/postgresql_qdatetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(postgresql_qdatetime 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(postgresql_qdatetime 6 | tst_postgresql_qdatetime.cpp 7 | ) 8 | 9 | add_test(NAME postgresql_qdatetime COMMAND postgresql_qdatetime) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(postgresql_qdatetime DEPENDS_ON_UNITTESTS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/postgresql_qdatetime/postgresql_qdatetime.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_postgresql_qdatetime.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/query.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | blobs \ 5 | mysql_qdatetime \ 6 | postgresql_qdatetime \ 7 | querybuilder \ 8 | sqlite_qdatetime \ 9 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/querybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(querybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(querybuilder 6 | tst_querybuilder.cpp 7 | ) 8 | 9 | add_test(NAME querybuilder COMMAND querybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(querybuilder DEPENDS_ON_UNITTESTS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/querybuilder/querybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_querybuilder.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/sqlite_qdatetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqlite_qdatetime 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqlite_qdatetime 6 | tst_sqlite_qdatetime.cpp 7 | ) 8 | 9 | add_test(NAME sqlite_qdatetime COMMAND sqlite_qdatetime) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqlite_qdatetime DEPENDS_ON_UNITTESTS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/query/sqlite_qdatetime/sqlite_qdatetime.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_sqlite_qdatetime.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(psql_schemabuilder_f) 2 | add_subdirectory(schemabuilder) 3 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/psql_schemabuilder_f/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(postgresql_schemabuilder_f 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(psql_schemabuilder_f 6 | tst_postgresql_schemabuilder_f.cpp 7 | ) 8 | 9 | add_test(NAME psql_schemabuilder_f COMMAND psql_schemabuilder_f) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(psql_schemabuilder_f DEPENDS_ON_UNITTESTS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/psql_schemabuilder_f/psql_schemabuilder_f.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_postgresql_schemabuilder_f.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/schema.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | psql_schemabuilder_f \ 5 | schemabuilder \ 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/schemabuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(schemabuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(schemabuilder 6 | tst_schemabuilder.cpp 7 | ) 8 | 9 | add_test(NAME schemabuilder COMMAND schemabuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(schemabuilder DEPENDS_ON_UNITTESTS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/schema/schemabuilder/schemabuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_schemabuilder.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(castattributes) 2 | add_subdirectory(collection_models) 3 | add_subdirectory(collection_relations) 4 | add_subdirectory(model) 5 | add_subdirectory(model_appends) 6 | add_subdirectory(model_conn_indep) 7 | add_subdirectory(model_hidesattributes) 8 | add_subdirectory(model_qdatetime) 9 | add_subdirectory(model_relations) 10 | add_subdirectory(model_return_relation) 11 | add_subdirectory(model_serialization) 12 | add_subdirectory(queriesrelationships) 13 | add_subdirectory(relations_buildsqueries) 14 | add_subdirectory(relations_conn_indep) 15 | add_subdirectory(relations_insrt_updt) 16 | add_subdirectory(softdeletes) 17 | add_subdirectory(tinybuilder) 18 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/castattributes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(castattributes 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(castattributes 6 | tst_castattributes.cpp 7 | ) 8 | 9 | add_test(NAME castattributes COMMAND castattributes) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(castattributes DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/castattributes/castattributes.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES = tst_castattributes.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/collection_models/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(collection_models 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(collection_models 6 | tst_collection_models.cpp 7 | ) 8 | 9 | add_test(NAME collection_models COMMAND collection_models) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(collection_models DEPENDS_ON_UNITTESTS INCLUDE_MODELS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/collection_models/collection_models.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_collection_models.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/collection_relations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(collection_relations 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(collection_relations 6 | tst_collection_relations.cpp 7 | ) 8 | 9 | add_test(NAME collection_relations COMMAND collection_relations) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(collection_relations DEPENDS_ON_UNITTESTS INCLUDE_MODELS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/collection_relations/collection_relations.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_collection_relations.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model 6 | tst_model.cpp 7 | ) 8 | 9 | add_test(NAME model COMMAND model) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model/model.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_appends/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_appends 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_appends 6 | tst_model_appends.cpp 7 | ) 8 | 9 | add_test(NAME model_appends COMMAND model_appends) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_appends DEPENDS_ON_UNITTESTS INCLUDE_MODELS) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_appends/model_appends.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_appends.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_conn_indep/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_connection_independent 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_conn_indep 6 | tst_model_connection_independent.cpp 7 | ) 8 | 9 | add_test(NAME model_conn_indep COMMAND model_conn_indep) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_conn_indep DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_conn_indep/model_conn_indep.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_connection_independent.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_hidesattributes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_hidesattributes 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_hidesattributes 6 | tst_model_hidesattributes.cpp 7 | ) 8 | 9 | add_test(NAME model_hidesattributes COMMAND model_hidesattributes) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_hidesattributes DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_hidesattributes/model_hidesattributes.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_hidesattributes.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_qdatetime/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_qdatetime 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_qdatetime 6 | tst_model_qdatetime.cpp 7 | ) 8 | 9 | add_test(NAME model_qdatetime COMMAND model_qdatetime) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_qdatetime DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_qdatetime/model_qdatetime.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_qdatetime.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_relations/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_relations 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_relations 6 | tst_model_relations.cpp 7 | ) 8 | 9 | add_test(NAME model_relations COMMAND model_relations) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_relations DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_relations/model_relations.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_relations.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_return_relation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_return_relation 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_return_relation 6 | tst_model_return_relation.cpp 7 | ) 8 | 9 | add_test(NAME model_return_relation COMMAND model_return_relation) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_return_relation DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_return_relation/model_return_relation.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_return_relation.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_serialization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(model_serialization 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(model_serialization 6 | tst_model_serialization.cpp 7 | ) 8 | 9 | add_test(NAME model_serialization COMMAND model_serialization) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(model_serialization DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/model_serialization/model_serialization.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_model_serialization.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/queriesrelationships/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(queriesrelationships 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(queriesrelationships 6 | tst_queriesrelationships.cpp 7 | ) 8 | 9 | add_test(NAME queriesrelationships COMMAND queriesrelationships) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(queriesrelationships DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/queriesrelationships/queriesrelationships.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_queriesrelationships.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_buildsqueries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(relations_buildsqueries 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(relations_buildsqueries 6 | tst_relations_buildsqueries.cpp 7 | ) 8 | 9 | add_test(NAME relations_buildsqueries COMMAND relations_buildsqueries) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(relations_buildsqueries DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_buildsqueries/relations_buildsqueries.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_relations_buildsqueries.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_conn_indep/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(relations_connection_independent 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(relations_conn_indep 6 | tst_relations_connection_independent.cpp 7 | ) 8 | 9 | add_test(NAME relations_conn_indep COMMAND relations_conn_indep) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(relations_conn_indep DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_conn_indep/relations_conn_indep.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_relations_connection_independent.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_insrt_updt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(relations_inserting_updating 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(relations_insrt_updt 6 | tst_relations_inserting_updating.cpp 7 | ) 8 | 9 | add_test(NAME relations_insrt_updt COMMAND relations_insrt_updt) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(relations_insrt_updt DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/relations_insrt_updt/relations_insrt_updt.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_relations_inserting_updating.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/softdeletes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(softdeletes 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(softdeletes 6 | tst_softdeletes.cpp 7 | ) 8 | 9 | add_test(NAME softdeletes COMMAND softdeletes) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(softdeletes DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/softdeletes/softdeletes.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_softdeletes.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/tiny.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | castattributes \ 5 | collection_models \ 6 | collection_relations \ 7 | model \ 8 | model_appends \ 9 | model_conn_indep \ 10 | model_hidesattributes \ 11 | model_qdatetime \ 12 | model_relations \ 13 | model_return_relation \ 14 | model_serialization \ 15 | queriesrelationships \ 16 | relations_buildsqueries \ 17 | relations_conn_indep \ 18 | relations_insrt_updt \ 19 | softdeletes \ 20 | tinybuilder \ 21 | 22 | model_hidesattributes.depends = model_serialization 23 | model_appends.depends = model_serialization model_hidesattributes 24 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/tinybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(tinybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(tinybuilder 6 | tst_tinybuilder.cpp 7 | ) 8 | 9 | add_test(NAME tinybuilder COMMAND tinybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(tinybuilder DEPENDS_ON_UNITTESTS INCLUDE_MODELS RUN_SERIAL) 13 | -------------------------------------------------------------------------------- /tests/auto/functional/orm/tiny/tinybuilder/tinybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES += tst_tinybuilder.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/others/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(versions) 2 | -------------------------------------------------------------------------------- /tests/auto/functional/others/others.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | versions \ 5 | -------------------------------------------------------------------------------- /tests/auto/functional/others/versions/include/versionsdebug_cmake.hpp.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TINYTESTS_VERSIONS_VERSIONSDEBUG_CMAKE_HPP 3 | #define TINYTESTS_VERSIONS_VERSIONSDEBUG_CMAKE_HPP 4 | 5 | #define TINYTEST_VERSIONS_TINYDRIVERS_PATH "$<$:$>" 6 | #define TINYTEST_VERSIONS_TINYMYSQL_PATH "$<$:$>" 7 | #define TINYTEST_VERSIONS_TINYORM_PATH "$" 8 | #define TINYTEST_VERSIONS_TINYUTILS_PATH "$" 9 | #define TINYTEST_VERSIONS_TOMEXAMPLE_PATH "$<$:$>" 10 | 11 | #endif // TINYTESTS_VERSIONS_VERSIONSDEBUG_CMAKE_HPP 12 | -------------------------------------------------------------------------------- /tests/auto/functional/others/versions/include/versionsdebug_qmake.hpp.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TINYTEST_VERSIONS_VERSIONSDEBUG_QMAKE_HPP 3 | #define TINYTEST_VERSIONS_VERSIONSDEBUG_QMAKE_HPP 4 | 5 | #define TINYTEST_VERSIONS_TINYDRIVERS_PATH \"$${TINYTEST_VERSIONS_TINYDRIVERS_PATH}\" 6 | #define TINYTEST_VERSIONS_TINYMYSQL_PATH \"$${TINYTEST_VERSIONS_TINYMYSQL_PATH}\" 7 | #define TINYTEST_VERSIONS_TINYORM_PATH \"$${TINYTEST_VERSIONS_TINYORM_PATH}\" 8 | #define TINYTEST_VERSIONS_TINYUTILS_PATH \"$${TINYTEST_VERSIONS_TINYUTILS_PATH}\" 9 | #define TINYTEST_VERSIONS_TOMEXAMPLE_PATH \"$${TINYTEST_VERSIONS_TOMEXAMPLE_PATH}\" 10 | 11 | #endif // TINYTEST_VERSIONS_VERSIONSDEBUG_QMAKE_HPP 12 | -------------------------------------------------------------------------------- /tests/auto/functional/tom/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(migrate) 2 | -------------------------------------------------------------------------------- /tests/auto/functional/tom/migrate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # migrate auto test 2 | # --- 3 | 4 | set(migrate_ns migrate) 5 | set(migrate_target ${migrate_ns}) 6 | 7 | project(${migrate_ns} 8 | LANGUAGES CXX 9 | ) 10 | 11 | add_executable(${migrate_target} 12 | tst_migrate.cpp 13 | ) 14 | 15 | add_test(NAME ${migrate_target} COMMAND ${migrate_target}) 16 | 17 | include(TinyTestCommon) 18 | tiny_configure_test(${migrate_target} DEPENDS_ON_UNITTESTS INCLUDE_MIGRATIONS) 19 | -------------------------------------------------------------------------------- /tests/auto/functional/tom/migrate/migrate.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/database/migrations.pri) 4 | 5 | SOURCES += tst_migrate.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/functional/tom/tom.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | migrate \ 5 | -------------------------------------------------------------------------------- /tests/auto/unit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(orm) 2 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(databaseconnection) 2 | add_subdirectory(query) 3 | add_subdirectory(schema) 4 | 5 | if(ORM) 6 | add_subdirectory(tiny) 7 | endif() 8 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/databaseconnection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(databaseconnection 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(databaseconnection 6 | tst_databaseconnection.cpp 7 | ) 8 | 9 | add_test(NAME databaseconnection COMMAND databaseconnection) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(databaseconnection) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/databaseconnection/databaseconnection.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_databaseconnection.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/orm.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | subdirsList = \ 4 | databaseconnection \ 5 | query \ 6 | schema \ 7 | 8 | !disable_orm: \ 9 | subdirsList += tiny 10 | 11 | SUBDIRS = $$sorted(subdirsList) 12 | 13 | unset(subdirsList) 14 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(mysql_querybuilder) 2 | add_subdirectory(postgresql_querybuilder) 3 | add_subdirectory(sqlite_querybuilder) 4 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/mysql_querybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(mysql_querybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(mysql_querybuilder 6 | tst_mysql_querybuilder.cpp 7 | ) 8 | 9 | add_test(NAME mysql_querybuilder COMMAND mysql_querybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(mysql_querybuilder) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/mysql_querybuilder/mysql_querybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_mysql_querybuilder.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/postgresql_querybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(postgresql_querybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(postgresql_querybuilder 6 | tst_postgresql_querybuilder.cpp 7 | ) 8 | 9 | add_test(NAME postgresql_querybuilder COMMAND postgresql_querybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(postgresql_querybuilder) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/postgresql_querybuilder/postgresql_querybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_postgresql_querybuilder.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/query.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | mysql_querybuilder \ 5 | postgresql_querybuilder \ 6 | sqlite_querybuilder \ 7 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/sqlite_querybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqlite_querybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqlite_querybuilder 6 | tst_sqlite_querybuilder.cpp 7 | ) 8 | 9 | add_test(NAME sqlite_querybuilder COMMAND sqlite_querybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(sqlite_querybuilder) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/query/sqlite_querybuilder/sqlite_querybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_sqlite_querybuilder.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(blueprint) 2 | add_subdirectory(mysql_schemabuilder) 3 | add_subdirectory(postgresql_schemabuilder) 4 | add_subdirectory(sqlite_schemabuilder) 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/blueprint/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(blueprint 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(blueprint 6 | tst_blueprint.cpp 7 | ) 8 | 9 | add_test(NAME blueprint COMMAND blueprint) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(blueprint) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/blueprint/blueprint.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | 4 | SOURCES = tst_blueprint.cpp 5 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/mysql_schemabuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(mysql_schemabuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(mysql_schemabuilder 6 | tst_mysql_schemabuilder.cpp 7 | ) 8 | 9 | add_test(NAME mysql_schemabuilder COMMAND mysql_schemabuilder) 10 | 11 | include(TinyTestCommon) 12 | if(ORM) 13 | tiny_configure_test(mysql_schemabuilder INCLUDE_MODELS) 14 | else() 15 | tiny_configure_test(mysql_schemabuilder) 16 | endif() 17 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/mysql_schemabuilder/mysql_schemabuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | !disable_orm: \ 4 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 5 | 6 | SOURCES = tst_mysql_schemabuilder.cpp 7 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/postgresql_schemabuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(postgresql_schemabuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(postgresql_schemabuilder 6 | tst_postgresql_schemabuilder.cpp 7 | ) 8 | 9 | add_test(NAME postgresql_schemabuilder COMMAND postgresql_schemabuilder) 10 | 11 | include(TinyTestCommon) 12 | if(ORM) 13 | tiny_configure_test(postgresql_schemabuilder INCLUDE_MODELS) 14 | else() 15 | tiny_configure_test(postgresql_schemabuilder) 16 | endif() 17 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/postgresql_schemabuilder/postgresql_schemabuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | !disable_orm: \ 4 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 5 | 6 | SOURCES = tst_postgresql_schemabuilder.cpp 7 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/schema.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | blueprint \ 5 | mysql_schemabuilder \ 6 | postgresql_schemabuilder \ 7 | sqlite_schemabuilder \ 8 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/sqlite_schemabuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(sqlite_schemabuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(sqlite_schemabuilder 6 | tst_sqlite_schemabuilder.cpp 7 | ) 8 | 9 | add_test(NAME sqlite_schemabuilder COMMAND sqlite_schemabuilder) 10 | 11 | include(TinyTestCommon) 12 | if(ORM) 13 | tiny_configure_test(sqlite_schemabuilder INCLUDE_MODELS) 14 | else() 15 | tiny_configure_test(sqlite_schemabuilder) 16 | endif() 17 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/schema/sqlite_schemabuilder/sqlite_schemabuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | !disable_orm: \ 4 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 5 | 6 | SOURCES = tst_sqlite_schemabuilder.cpp 7 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/tiny/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(mysql_tinybuilder) 2 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/tiny/mysql_tinybuilder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(mysql_tinybuilder 2 | LANGUAGES CXX 3 | ) 4 | 5 | add_executable(mysql_tinybuilder 6 | tst_mysql_tinybuilder.cpp 7 | ) 8 | 9 | add_test(NAME mysql_tinybuilder COMMAND mysql_tinybuilder) 10 | 11 | include(TinyTestCommon) 12 | tiny_configure_test(mysql_tinybuilder INCLUDE_MODELS) 13 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/tiny/mysql_tinybuilder/mysql_tinybuilder.pro: -------------------------------------------------------------------------------- 1 | include($$TINYORM_SOURCE_TREE/tests/qmake/common.pri) 2 | include($$TINYORM_SOURCE_TREE/tests/qmake/TinyUtils.pri) 3 | include($$TINYORM_SOURCE_TREE/tests/models/models.pri) 4 | 5 | SOURCES = tst_mysql_tinybuilder.cpp 6 | -------------------------------------------------------------------------------- /tests/auto/unit/orm/tiny/tiny.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | mysql_tinybuilder \ 5 | -------------------------------------------------------------------------------- /tests/auto/unit/unit.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | orm \ 5 | -------------------------------------------------------------------------------- /tests/database/migrations.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/migrations/2014_10_12_000000_create_posts_table.hpp \ 5 | $$PWD/migrations/2014_10_12_100000_add_factor_column_to_posts_table.hpp \ 6 | $$PWD/migrations/2014_10_12_200000_create_properties_table.hpp \ 7 | $$PWD/migrations/2014_10_12_300000_create_phones_table.hpp \ 8 | -------------------------------------------------------------------------------- /tests/database/migrations/2014_10_12_100000_add_factor_column_to_posts_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct AddFactorColumnToPostsTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::table("posts", [](Blueprint &table) 16 | { 17 | table.integer("factor"); 18 | }); 19 | } 20 | 21 | /*! Reverse the migrations. */ 22 | void down() const override 23 | { 24 | Schema::table("posts", [](Blueprint &table) 25 | { 26 | table.dropColumn("factor"); 27 | }); 28 | } 29 | }; 30 | 31 | } // namespace Migrations 32 | -------------------------------------------------------------------------------- /tests/database/migrations/2014_10_12_200000_create_properties_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreatePropertiesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("properties", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME); 20 | table.timestamps(); 21 | }); 22 | } 23 | 24 | /*! Reverse the migrations. */ 25 | void down() const override 26 | { 27 | Schema::dropIfExists("properties"); 28 | } 29 | }; 30 | 31 | } // namespace Migrations 32 | -------------------------------------------------------------------------------- /tests/database/migrations/2014_10_12_300000_create_phones_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreatePhonesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("phones", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME); 20 | table.timestamps(); 21 | }); 22 | } 23 | 24 | /*! Reverse the migrations. */ 25 | void down() const override 26 | { 27 | Schema::dropIfExists("phones"); 28 | } 29 | }; 30 | 31 | } // namespace Migrations 32 | -------------------------------------------------------------------------------- /tests/database/seeders.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/seeders/databaseseeder.hpp \ 5 | $$PWD/seeders/phoneseeder.hpp \ 6 | $$PWD/seeders/propertyseeder.hpp \ 7 | -------------------------------------------------------------------------------- /tests/database/seeders/databaseseeder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "seeders/phoneseeder.hpp" 6 | #include "seeders/propertyseeder.hpp" 7 | 8 | /* This class serves as a showcase, so all possible features are defined / used. */ 9 | 10 | namespace Seeders 11 | { 12 | 13 | /*! Main database seeder. */ 14 | struct DatabaseSeeder : Seeder 15 | { 16 | /*! Run the database seeders. */ 17 | void run() override 18 | { 19 | DB::table("posts")->insert({ 20 | {{NAME, "1. post"}, {"factor", 10}}, 21 | {{NAME, "2. post"}, {"factor", 20}}, 22 | }); 23 | 24 | call(); 25 | 26 | // You can also pass arguments to the call() related methods 27 | // callWith(shouldSeedPassword); 28 | } 29 | }; 30 | 31 | } // namespace Seeders 32 | -------------------------------------------------------------------------------- /tests/database/seeders/phoneseeder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef TINYORM_DISABLE_ORM 4 | # include 5 | #endif 6 | 7 | #include 8 | 9 | #ifndef TINYORM_DISABLE_ORM 10 | namespace Models 11 | { 12 | class Phone final : public Orm::Tiny::Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | using Model::Model; 15 | }; 16 | } // namespace Models 17 | #endif 18 | 19 | namespace Seeders 20 | { 21 | 22 | struct PhoneSeeder : Seeder 23 | { 24 | /*! Run the database seeders. */ 25 | void run() override 26 | { 27 | #ifdef TINYORM_DISABLE_ORM 28 | DB::table("phones")->insert({ 29 | {{NAME, "1. phone"}}, 30 | {{NAME, "2. phone"}}, 31 | }); 32 | #else 33 | // This tests GuardedModel::unguarded() 34 | Models::Phone::create({{NAME, QDateTime::currentDateTime()}}); 35 | #endif 36 | } 37 | }; 38 | 39 | } // namespace Seeders 40 | -------------------------------------------------------------------------------- /tests/database/seeders/propertyseeder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Seeders 6 | { 7 | 8 | struct PropertySeeder : Seeder 9 | { 10 | /*! Run the database seeders. */ 11 | void run() override 12 | { 13 | DB::table("properties")->insert({ 14 | {{NAME, "1. property"}}, 15 | {{NAME, "2. property"}}, 16 | }); 17 | } 18 | }; 19 | 20 | } // namespace Seeders 21 | -------------------------------------------------------------------------------- /tests/models/.clang-tidy: -------------------------------------------------------------------------------- 1 | # Optimized for Clang-Tidy v18 2 | --- 3 | InheritParentConfig: true 4 | CheckOptions: 5 | - key: misc-header-include-cycle.IgnoredFilesList 6 | value: '[\\\/]+models[\\\/]+.+\.hpp$' 7 | -------------------------------------------------------------------------------- /tests/models/models/phone.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_PHONE_HPP 3 | #define MODELS_PHONE_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | #include "models/user.hpp" 8 | 9 | namespace Models 10 | { 11 | 12 | using Orm::Tiny::Model; 13 | 14 | class User; 15 | 16 | class Phone final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 17 | { 18 | friend Model; 19 | using Model::Model; 20 | 21 | public: 22 | /*! Get a user that owns the phone. */ 23 | std::unique_ptr> 24 | user() 25 | { 26 | return belongsTo(); 27 | } 28 | 29 | private: 30 | /*! The table associated with the model. */ 31 | QString u_table {"user_phones"}; 32 | 33 | /*! Map of relation names to methods. */ 34 | QHash u_relations { 35 | {"user", [](auto &v) { v(&Phone::user); }}, 36 | }; 37 | 38 | /*! Indicates whether the model should be timestamped. */ 39 | bool u_timestamps = false; 40 | }; 41 | 42 | } // namespace Models 43 | 44 | #endif // MODELS_PHONE_HPP 45 | -------------------------------------------------------------------------------- /tests/models/models/roleuser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_ROLEUSER_HPP 3 | #define MODELS_ROLEUSER_HPP 4 | 5 | #include "orm/tiny/relations/basepivot.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Relations::BasePivot; 11 | 12 | class RoleUser final : public BasePivot // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | friend BasePivot; 16 | 17 | using BasePivot::BasePivot; 18 | 19 | /*! Indicates whether the model should be timestamped. */ 20 | bool u_timestamps = false; 21 | 22 | /*! The attributes that should be cast. */ 23 | inline static std::unordered_map u_casts { 24 | {"active", CastType::Boolean}, 25 | }; 26 | }; 27 | 28 | } // namespace Models 29 | 30 | #endif // MODELS_ROLEUSER_HPP 31 | -------------------------------------------------------------------------------- /tests/models/models/setting.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_SETTING_HPP 3 | #define MODELS_SETTING_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class Setting final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | using Model::Model; 16 | 17 | private: 18 | /*! The table associated with the model. */ 19 | QString u_table {"settings"}; 20 | 21 | /*! Indicates if the model's ID is auto-incrementing. */ 22 | bool u_incrementing = false; 23 | }; 24 | 25 | } // namespace Models 26 | 27 | #endif // MODELS_SETTING_HPP 28 | -------------------------------------------------------------------------------- /tests/models/models/tag_returnrelation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TAG_RETURNRELATION_HPP 3 | #define MODELS_TAG_RETURNRELATION_HPP 4 | 5 | #include "orm/tiny/relations/pivot.hpp" 6 | 7 | #include "models/torrent_returnrelation.hpp" 8 | 9 | namespace Models 10 | { 11 | 12 | using Orm::Tiny::Model; 13 | using Orm::Tiny::Relations::Pivot; 14 | 15 | class Torrent_ReturnRelation; 16 | 17 | class Tag_ReturnRelation final : public Model 19 | { 20 | friend Model; 21 | using Model::Model; 22 | 23 | /*! The table associated with the model. */ 24 | QString u_table {"torrent_tags"}; 25 | }; 26 | 27 | } // namespace Models 28 | 29 | #endif // MODELS_TAG_RETURNRELATION_HPP 30 | -------------------------------------------------------------------------------- /tests/models/models/tagproperty.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TAGPROPERTY_HPP 3 | #define MODELS_TAGPROPERTY_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class TagProperty final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | using Model::Model; 16 | 17 | /*! The table associated with the model. */ 18 | QString u_table {"tag_properties"}; 19 | }; 20 | 21 | } // namespace Models 22 | 23 | #endif // MODELS_TAGPROPERTY_HPP 24 | -------------------------------------------------------------------------------- /tests/models/models/torrenteager_withdefault.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TORRENTEAGER_WITHDEFAULT_HPP 3 | #define MODELS_TORRENTEAGER_WITHDEFAULT_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class TorrentEager_WithDefault final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | using Model::Model; 16 | 17 | /*! The table associated with the model. */ 18 | QString u_table {"torrents"}; 19 | 20 | /*! The attributes that should be mutated to dates. */ 21 | inline static const QStringList u_dates {"added_on"}; 22 | }; 23 | 24 | } // namespace Models 25 | 26 | #endif // MODELS_TORRENTEAGER_WITHDEFAULT_HPP 27 | -------------------------------------------------------------------------------- /tests/models/models/torrentpeereager_norelations.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TORRENTPEEREAGER_NORELATIONS_HPP 3 | #define MODELS_TORRENTPEEREAGER_NORELATIONS_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class TorrentPeerEager_NoRelations final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | using Model::Model; 16 | 17 | /*! The table associated with the model. */ 18 | QString u_table {"torrent_peers"}; 19 | }; 20 | 21 | } // namespace Models 22 | 23 | #endif // MODELS_TORRENTPEEREAGER_NORELATIONS_HPP 24 | -------------------------------------------------------------------------------- /tests/models/models/torrentpreviewablefilepropertyeager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TORRENTPREVIEWABLEFILEPROPERTYEAGER_HPP 3 | #define MODELS_TORRENTPREVIEWABLEFILEPROPERTYEAGER_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class TorrentPreviewableFilePropertyEager final : // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | public Model 14 | { 15 | friend Model; 16 | using Model::Model; 17 | 18 | /*! The table associated with the model. */ 19 | QString u_table {"torrent_previewable_file_properties"}; 20 | 21 | /*! Indicates whether the model should be timestamped. */ 22 | bool u_timestamps = false; 23 | }; 24 | 25 | } // namespace Models 26 | 27 | #endif // MODELS_TORRENTPREVIEWABLEFILEPROPERTYEAGER_HPP 28 | -------------------------------------------------------------------------------- /tests/models/models/torrentstate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TORRENTSTATE_HPP 3 | #define MODELS_TORRENTSTATE_HPP 4 | 5 | #include "orm/tiny/relations/pivot.hpp" 6 | 7 | #include "models/torrent.hpp" 8 | 9 | namespace Models 10 | { 11 | 12 | using Orm::Constants::NAME; 13 | 14 | using Orm::Tiny::Model; 15 | using Orm::Tiny::Relations::Pivot; 16 | 17 | class Torrent; 18 | 19 | class TorrentState final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 20 | { 21 | friend Model; 22 | using Model::Model; 23 | 24 | private: 25 | /*! The attributes that are mass assignable. */ 26 | inline static const QStringList u_fillable { // NOLINT(cppcoreguidelines-interfaces-global-init) 27 | NAME, 28 | }; 29 | 30 | /*! Indicates whether the model should be timestamped. */ 31 | bool u_timestamps = false; 32 | }; 33 | 34 | } // namespace Models 35 | 36 | #endif // MODELS_TORRENTSTATE_HPP 37 | -------------------------------------------------------------------------------- /tests/models/models/type.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef MODELS_TYPE_HPP 3 | #define MODELS_TYPE_HPP 4 | 5 | #include "orm/tiny/model.hpp" 6 | 7 | namespace Models 8 | { 9 | 10 | using Orm::Tiny::Model; 11 | 12 | class Type final : public Model // NOLINT(bugprone-exception-escape, misc-no-recursion) 13 | { 14 | friend Model; 15 | using Model::Model; 16 | 17 | /*! The table associated with the model. */ 18 | QString u_table {"types"}; 19 | 20 | /*! Indicates whether the model should be timestamped. */ 21 | bool u_timestamps = false; 22 | 23 | /*! The attributes that should be cast. */ 24 | inline static std::unordered_map u_casts {}; 25 | 26 | public: 27 | /*! The attributes that should be mutated to dates. */ 28 | inline static QStringList u_dates {}; 29 | }; 30 | 31 | } // namespace Models 32 | 33 | #endif // MODELS_TYPE_HPP 34 | -------------------------------------------------------------------------------- /tests/qmake/TinyUtils.pri: -------------------------------------------------------------------------------- 1 | # TinyUtils library defines 2 | # --- 3 | 4 | CONFIG(shared, dll|shared|static|staticlib) | \ 5 | CONFIG(dll, dll|shared|static|staticlib): \ 6 | DEFINES *= TINYUTILS_LINKING_SHARED 7 | 8 | # TinyUtils library headers include path 9 | # --- 10 | 11 | INCLUDEPATH += $$quote($$TINYORM_SOURCE_TREE/tests/TinyUtils/src/) 12 | 13 | # Link against tests's TinyUtils library 14 | # --- 15 | 16 | LIBS += $$quote(-L$$TINYORM_BUILD_TREE/tests/TinyUtils$$TINY_BUILD_SUBFOLDER/) 17 | LIBS += -lTinyUtils 18 | -------------------------------------------------------------------------------- /tests/testdata/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "silverqx/tinyorm-testdata", 3 | "type": "project", 4 | "description": "Create and seed databases for TinyORM tests.", 5 | "keywords": [ 6 | "database", 7 | "seed", 8 | "tinyorm" 9 | ], 10 | "license": "MIT", 11 | "require": { 12 | "php": "^8.0", 13 | "ext-pdo": "^8.0", 14 | "ext-pdo_mysql": "^8.0", 15 | "ext-pdo_pgsql": "^8.0", 16 | "ext-pdo_sqlite": "^8.0", 17 | 18 | "illuminate/database": "^8.33" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/testdata/dotenv.ps1.example: -------------------------------------------------------------------------------- 1 | # MySQL 2 | $Env:DB_MYSQL_HOST = "127.0.0.1" 3 | $Env:DB_MYSQL_PORT = "3306" 4 | $Env:DB_MYSQL_DATABASE = "" 5 | $Env:DB_MYSQL_USERNAME = "" 6 | $Env:DB_MYSQL_PASSWORD = "" 7 | $Env:DB_MYSQL_CHARSET = "utf8mb4" 8 | $Env:DB_MYSQL_COLLATION = "utf8mb4_0900_ai_ci" 9 | 10 | # SQLite 11 | $Env:DB_SQLITE_DATABASE = "" 12 | 13 | # PostgreSQL 14 | $Env:DB_PGSQL_HOST = "127.0.0.1" 15 | $Env:DB_PGSQL_PORT = "5432" 16 | $Env:DB_PGSQL_DATABASE = "" 17 | $Env:DB_PGSQL_SCHEMA = "public" 18 | $Env:DB_PGSQL_USERNAME = "" 19 | $Env:DB_PGSQL_PASSWORD = "" 20 | $Env:DB_PGSQL_CHARSET = "utf8" 21 | 22 | # Tom related 23 | $Env:TOM_EXAMPLE_ENV = "local" 24 | $Env:TOM_TESTS_ENV = "local" 25 | -------------------------------------------------------------------------------- /tests/testdata/dotenv.sh.example: -------------------------------------------------------------------------------- 1 | # MySQL 2 | export DB_MYSQL_HOST="127.0.0.1" 3 | export DB_MYSQL_PORT="3306" 4 | export DB_MYSQL_DATABASE="" 5 | export DB_MYSQL_USERNAME="" 6 | export DB_MYSQL_PASSWORD="" 7 | export DB_MYSQL_CHARSET="utf8mb4" 8 | export DB_MYSQL_COLLATION="utf8mb4_0900_ai_ci" 9 | 10 | # SQLite 11 | export DB_SQLITE_DATABASE="" 12 | 13 | # PostgreSQL 14 | export DB_PGSQL_HOST="127.0.0.1" 15 | export DB_PGSQL_PORT="5432" 16 | export DB_PGSQL_DATABASE="" 17 | export DB_PGSQL_SCHEMA="public" 18 | export DB_PGSQL_USERNAME="" 19 | export DB_PGSQL_PASSWORD="" 20 | export DB_PGSQL_CHARSET="utf8" 21 | 22 | # Tom related 23 | export TOM_EXAMPLE_ENV="local" 24 | export TOM_TESTS_ENV="local" 25 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170000_create_users_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateUsersTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("users", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME).unique(); 20 | table.boolean("is_banned").defaultValue(false); 21 | table.string(NOTE).nullable(); 22 | 23 | table.timestamps(); 24 | table.softDeletes(); 25 | }); 26 | } 27 | 28 | /*! Reverse the migrations. */ 29 | void down() const override 30 | { 31 | Schema::dropIfExists("users"); 32 | } 33 | }; 34 | 35 | } // namespace Migrations 36 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170100_create_roles_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateRolesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("roles", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME).unique(); 20 | 21 | // To test Unix timestamps, u_dateFormat = 'U' 22 | table.bigInteger("added_on").nullable() 23 | .comment("To test Unix timestamps, u_dateFormat = 'U'"); 24 | }); 25 | } 26 | 27 | /*! Reverse the migrations. */ 28 | void down() const override 29 | { 30 | Schema::dropIfExists("roles"); 31 | } 32 | }; 33 | 34 | } // namespace Migrations 35 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170200_create_role_user_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateRoleUserTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("role_user", [](Blueprint &table) 16 | { 17 | table.foreignId("role_id").constrained().cascadeOnDelete().cascadeOnUpdate(); 18 | table.foreignId("user_id").constrained().cascadeOnDelete().cascadeOnUpdate(); 19 | 20 | table.boolean("active").defaultValue(true); 21 | 22 | // Indexes 23 | table.primary({"role_id", "user_id"}); 24 | }); 25 | } 26 | 27 | /*! Reverse the migrations. */ 28 | void down() const override 29 | { 30 | Schema::dropIfExists("role_user"); 31 | } 32 | }; 33 | 34 | } // namespace Migrations 35 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170300_create_user_phones_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateUserPhonesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("user_phones", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.foreignId("user_id").constrained().cascadeOnDelete().cascadeOnUpdate(); 20 | 21 | table.string("number").unique(); 22 | }); 23 | } 24 | 25 | /*! Reverse the migrations. */ 26 | void down() const override 27 | { 28 | Schema::dropIfExists("user_phones"); 29 | } 30 | }; 31 | 32 | } // namespace Migrations 33 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170400_create_settings_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateSettingsTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("settings", [](Blueprint &table) 16 | { 17 | table.string(NAME).defaultValue("").unique(); 18 | table.string("value").defaultValue(""); 19 | 20 | table.timestamps(); 21 | }); 22 | } 23 | 24 | /*! Reverse the migrations. */ 25 | void down() const override 26 | { 27 | Schema::dropIfExists("settings"); 28 | } 29 | }; 30 | 31 | } // namespace Migrations 32 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_170600_create_torrent_peers_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateTorrentPeersTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("torrent_peers", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.foreignId("torrent_id").nullable().constrained() 20 | .cascadeOnDelete().cascadeOnUpdate(); 21 | 22 | table.integer("seeds").nullable(); 23 | table.integer("total_seeds").nullable(); 24 | 25 | table.integer("leechers"); 26 | table.integer("total_leechers"); 27 | 28 | table.timestamps(); 29 | }); 30 | } 31 | 32 | /*! Reverse the migrations. */ 33 | void down() const override 34 | { 35 | Schema::dropIfExists("torrent_peers"); 36 | } 37 | }; 38 | 39 | } // namespace Migrations 40 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171000_create_torrent_tags_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateTorrentTagsTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("torrent_tags", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME).unique(); 20 | table.string(NOTE).nullable(); 21 | 22 | table.timestamps(); 23 | }); 24 | } 25 | 26 | /*! Reverse the migrations. */ 27 | void down() const override 28 | { 29 | Schema::dropIfExists("torrent_tags"); 30 | } 31 | }; 32 | 33 | } // namespace Migrations 34 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171200_create_tag_properties_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateTagPropertiesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("tag_properties", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.unsignedBigInteger("tag_id"); 20 | 21 | table.string("color"); 22 | table.unsignedInteger("position").unique(); 23 | 24 | table.timestamps(); 25 | 26 | // Indexes 27 | table.foreign("tag_id") 28 | .references(ID).on("torrent_tags") 29 | .cascadeOnDelete().cascadeOnUpdate(); 30 | }); 31 | } 32 | 33 | /*! Reverse the migrations. */ 34 | void down() const override 35 | { 36 | Schema::dropIfExists("tag_properties"); 37 | } 38 | }; 39 | 40 | } // namespace Migrations 41 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171400_create_datetimes_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateDatetimeTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("datetimes", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.datetime("datetime").nullable(); 20 | table.datetimeTz("datetime_tz").nullable(); 21 | 22 | table.timestamp("timestamp").nullable(); 23 | table.timestampTz("timestamp_tz").nullable(); 24 | 25 | table.date("date").nullable(); 26 | table.time("time").nullable(); 27 | table.time("time_ms", 3).nullable(); 28 | }); 29 | } 30 | 31 | /*! Reverse the migrations. */ 32 | void down() const override 33 | { 34 | Schema::dropIfExists("datetimes"); 35 | } 36 | }; 37 | 38 | } // namespace Migrations 39 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171500_create_albums_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateAlbumsTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("albums", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME).unique(); 20 | table.string(NOTE).nullable(); 21 | 22 | table.timestamps(); 23 | }); 24 | } 25 | 26 | /*! Reverse the migrations. */ 27 | void down() const override 28 | { 29 | Schema::dropIfExists("albums"); 30 | } 31 | }; 32 | 33 | } // namespace Migrations 34 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171600_create_album_images_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateAlbumImagesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("album_images", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.foreignId("album_id").nullable() 20 | .constrained().cascadeOnDelete().cascadeOnUpdate(); 21 | 22 | table.string(NAME).unique(); 23 | table.string("ext"); 24 | table.unsignedBigInteger(SIZE_); 25 | 26 | table.timestamps(); 27 | }); 28 | } 29 | 30 | /*! Reverse the migrations. */ 31 | void down() const override 32 | { 33 | Schema::dropIfExists("album_images"); 34 | } 35 | }; 36 | 37 | } // namespace Migrations 38 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171700_create_torrent_states_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateTorrentStatesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("torrent_states", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.string(NAME).unique(); 20 | }); 21 | } 22 | 23 | /*! Reverse the migrations. */ 24 | void down() const override 25 | { 26 | Schema::dropIfExists("torrent_states"); 27 | } 28 | }; 29 | 30 | } // namespace Migrations 31 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_171900_create_role_tag_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateRoleTagTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("role_tag", [](Blueprint &table) 16 | { 17 | table.foreignId("tag_id").constrained("torrent_tags") 18 | .cascadeOnDelete().cascadeOnUpdate(); 19 | table.foreignId("role_id").constrained() 20 | .cascadeOnDelete().cascadeOnUpdate(); 21 | 22 | table.boolean("active").defaultValue(false); 23 | 24 | // Indexes 25 | table.primary({"tag_id", "role_id"}); 26 | }); 27 | } 28 | 29 | /*! Reverse the migrations. */ 30 | void down() const override 31 | { 32 | Schema::dropIfExists("role_tag"); 33 | } 34 | }; 35 | 36 | } // namespace Migrations 37 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/migrations/2022_05_11_172000_create_empty_with_default_values_table.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace Migrations 6 | { 7 | 8 | struct CreateEmptyWithDefaultValuesTable : Migration 9 | { 10 | T_MIGRATION 11 | 12 | /*! Run the migrations. */ 13 | void up() const override 14 | { 15 | Schema::create("empty_with_default_values", [](Blueprint &table) 16 | { 17 | table.id(); 18 | 19 | table.foreignId("user_id").nullable() 20 | .constrained().cascadeOnDelete().cascadeOnUpdate(); 21 | 22 | table.unsignedBigInteger(SIZE_).defaultValue("0"); 23 | table.decimal("decimal").defaultValue("100.12").nullable(); 24 | table.datetime("added_on").useCurrent(); 25 | table.string(NOTE).nullable(); 26 | }); 27 | } 28 | 29 | /*! Reverse the migrations. */ 30 | void down() const override 31 | { 32 | Schema::dropIfExists("empty_with_default_values"); 33 | } 34 | }; 35 | 36 | } // namespace Migrations 37 | -------------------------------------------------------------------------------- /tests/testdata_tom/database/seeders.pri: -------------------------------------------------------------------------------- 1 | INCLUDEPATH *= $$PWD 2 | 3 | HEADERS += \ 4 | $$PWD/seeders/databaseseeder.hpp \ 5 | -------------------------------------------------------------------------------- /tests/tests.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS = \ 4 | auto \ 5 | TinyUtils \ 6 | 7 | !disable_tom: \ 8 | SUBDIRS += testdata_tom 9 | 10 | auto.depends = TinyUtils 11 | -------------------------------------------------------------------------------- /tom/include/tom/commands/make/modelcommandconcepts.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_COMMANDS_MAKE_MODELCOMMANDCONCEPTS_HPP 3 | #define TOM_COMMANDS_MAKE_MODELCOMMANDCONCEPTS_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | 14 | TINYORM_BEGIN_COMMON_NAMESPACE 15 | 16 | namespace Tom::Commands::Make 17 | { 18 | 19 | /*! Concept for the btm relation prepared values (result). */ 20 | template 21 | concept BtmPreparedValuesConcept = std::convertible_to || 22 | std::convertible_to> || 23 | std::convertible_to>; 24 | 25 | /*! Concept for the btm relation values to prepare. */ 26 | template 27 | concept BtmValuesConcept = std::convertible_to || 28 | std::convertible_to>; 29 | 30 | } // namespace Tom::Commands::Make 31 | 32 | TINYORM_END_COMMON_NAMESPACE 33 | 34 | #endif // TOM_COMMANDS_MAKE_MODELCOMMANDCONCEPTS_HPP 35 | -------------------------------------------------------------------------------- /tom/include/tom/commands/make/stubs/projectstubs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_COMMANDS_MAKE_STUBS_PROJECTSTUBS_HPP 3 | #define TOM_COMMANDS_MAKE_STUBS_PROJECTSTUBS_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Tom::Commands::Make::Stubs 13 | { 14 | 15 | inline const auto *const XyzStub = R"(#pragma once 16 | )"; 17 | 18 | } // namespace Tom::Commands::Make::Stubs 19 | 20 | TINYORM_END_COMMON_NAMESPACE 21 | 22 | #endif // TOM_COMMANDS_MAKE_STUBS_PROJECTSTUBS_HPP 23 | -------------------------------------------------------------------------------- /tom/include/tom/commands/make/stubs/seederstubs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_COMMANDS_MAKE_STUBS_SEEDERSTUBS_HPP 3 | #define TOM_COMMANDS_MAKE_STUBS_SEEDERSTUBS_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Tom::Commands::Make::Stubs 13 | { 14 | 15 | /*! Seeder stub. */ 16 | inline const auto *const SeederStub = R"(#pragma once 17 | 18 | #include 19 | 20 | namespace Seeders 21 | { 22 | 23 | struct {{ class }} : Seeder 24 | { 25 | /*! Run the database seeders. */ 26 | void run() override 27 | { 28 | // DB::table("{{ table }}")->insert(); 29 | } 30 | }; 31 | 32 | } // namespace Seeders 33 | )"; 34 | 35 | } // namespace Tom::Commands::Make::Stubs 36 | 37 | TINYORM_END_COMMON_NAMESPACE 38 | 39 | #endif // TOM_COMMANDS_MAKE_STUBS_SEEDERSTUBS_HPP 40 | -------------------------------------------------------------------------------- /tom/include/tom/exceptions/invalidargumenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 3 | #define TOM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "tom/exceptions/logicerror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Tom::Exceptions 13 | { 14 | 15 | /*! Tom Invalid argument exception. */ 16 | class InvalidArgumentError : public LogicError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using LogicError::LogicError; 20 | }; 21 | 22 | } // namespace Tom::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // TOM_EXCEPTIONS_INVALIDARGUMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /tom/include/tom/exceptions/invalidtemplateargumenterror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 3 | #define TOM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include "tom/exceptions/invalidargumenterror.hpp" 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Tom::Exceptions 13 | { 14 | 15 | /*! Tom invalid template argument exception. */ 16 | class InvalidTemplateArgumentError : public InvalidArgumentError // clazy:exclude=copyable-polymorphic 17 | { 18 | /*! Inherit constructors. */ 19 | using InvalidArgumentError::InvalidArgumentError; 20 | }; 21 | 22 | } // namespace Tom::Exceptions 23 | 24 | TINYORM_END_COMMON_NAMESPACE 25 | 26 | #endif // TOM_EXCEPTIONS_INVALIDTEMPLATEARGUMENTERROR_HPP 27 | -------------------------------------------------------------------------------- /tom/include/tom/exceptions/tomerror.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_EXCEPTIONS_TOMERROR_HPP 3 | #define TOM_EXCEPTIONS_TOMERROR_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include 9 | 10 | TINYORM_BEGIN_COMMON_NAMESPACE 11 | 12 | namespace Tom::Exceptions 13 | { 14 | 15 | /*! Tom exceptions tag, all Tom exceptions are derived from this class. */ 16 | class TomError // NOLINT(cppcoreguidelines-special-member-functions) clazy:exclude=copyable-polymorphic 17 | { 18 | public: 19 | /*! Pure virtual destructor. */ 20 | inline virtual ~TomError() = 0; 21 | }; 22 | 23 | /* public */ 24 | 25 | TomError::~TomError() = default; 26 | 27 | } // namespace Tom::Exceptions 28 | 29 | TINYORM_END_COMMON_NAMESPACE 30 | 31 | #endif // TOM_EXCEPTIONS_TOMERROR_HPP 32 | -------------------------------------------------------------------------------- /tom/include/tom/tomconstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TOM_TOMCONSTANTS_HPP 3 | #define TOM_TOMCONSTANTS_HPP 4 | 5 | #include 6 | TINY_SYSTEM_HEADER 7 | 8 | #include // IWYU pragma: keep 9 | 10 | #ifdef TINYORM_EXTERN_CONSTANTS 11 | # include // IWYU pragma: export 12 | #else 13 | # include // IWYU pragma: export 14 | #endif 15 | 16 | #endif // TOM_TOMCONSTANTS_HPP 17 | -------------------------------------------------------------------------------- /tom/src/tom/commands/environmentcommand.cpp: -------------------------------------------------------------------------------- 1 | #include "tom/commands/environmentcommand.hpp" 2 | 3 | #include "tom/application.hpp" 4 | 5 | TINYORM_BEGIN_COMMON_NAMESPACE 6 | 7 | namespace Tom::Commands 8 | { 9 | 10 | /* public */ 11 | 12 | EnvironmentCommand::EnvironmentCommand(Application &application, 13 | QCommandLineParser &parser) 14 | : Command(application, parser) 15 | {} 16 | 17 | int EnvironmentCommand::run() 18 | { 19 | Command::run(); 20 | 21 | info(QStringLiteral("Current application environment: "), false); 22 | 23 | comment(application().environment()); 24 | 25 | return EXIT_SUCCESS; 26 | } 27 | 28 | } // namespace Tom::Commands 29 | 30 | TINYORM_END_COMMON_NAMESPACE 31 | -------------------------------------------------------------------------------- /tom/src/tom/exceptions/tomlogicerror.cpp: -------------------------------------------------------------------------------- 1 | #include "tom/exceptions/logicerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Tom::Exceptions 6 | { 7 | 8 | LogicError::LogicError(const char *message) 9 | : std::logic_error(message) 10 | {} 11 | 12 | LogicError::LogicError(const QString &message) 13 | : std::logic_error(message.toUtf8().constData()) 14 | {} 15 | 16 | LogicError::LogicError(const std::string &message) 17 | : std::logic_error(message) 18 | {} 19 | 20 | } // namespace Tom::Exceptions 21 | 22 | TINYORM_END_COMMON_NAMESPACE 23 | -------------------------------------------------------------------------------- /tom/src/tom/exceptions/tomruntimeerror.cpp: -------------------------------------------------------------------------------- 1 | #include "tom/exceptions/runtimeerror.hpp" 2 | 3 | TINYORM_BEGIN_COMMON_NAMESPACE 4 | 5 | namespace Tom::Exceptions 6 | { 7 | 8 | RuntimeError::RuntimeError(const char *message) 9 | : std::runtime_error(message) 10 | {} 11 | 12 | RuntimeError::RuntimeError(const QString &message) 13 | : std::runtime_error(message.toUtf8().constData()) 14 | {} 15 | 16 | RuntimeError::RuntimeError(const std::string &message) 17 | : std::runtime_error(message) 18 | {} 19 | 20 | } // namespace Tom::Exceptions 21 | 22 | TINYORM_END_COMMON_NAMESPACE 23 | -------------------------------------------------------------------------------- /tools/Find-TinyORMTodos.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, Mandatory, 5 | HelpMessage = 'Specifies todo tasks to find on each line. The pattern value is used '+ 6 | 'in regular expression.')] 7 | [ValidateNotNullOrEmpty()] 8 | [string] $Pattern, 9 | 10 | [Parameter(Position = 1, HelpMessage = 'Todo keywords regex pattern.')] 11 | [ValidateNotNullOrEmpty()] 12 | [string] $TodoKeywordsPattern = ' (TODO|NOTE|FIXME|BUG|WARNING|CUR|FEATURE|TEST|FUTURE|CUR1|TMP|SEC) ', 13 | 14 | [Parameter(HelpMessage = 'Specifies subfolders to search. The pattern value is used ' + 15 | 'in regular expression, eg. (drivers|examples|include|src|tests|tom).')] 16 | [AllowEmptyString()] 17 | [string] $InSubFoldersPattern = '(drivers|examples|include|src|tests|tom)' 18 | ) 19 | 20 | Set-StrictMode -Version 3.0 21 | 22 | Find-Todos.ps1 -Path 'E:\c\qMedia\TinyORM\TinyORM' -Include *.cpp, *.hpp ` @PSBoundParameters 23 | | Format-List 24 | # | Format-List -Property @{ 25 | # Name = 'Line' 26 | # Expression = { 27 | # "`e[33m$($_.Line)`e[0m" 28 | # } 29 | # }, LineNumber, Path 30 | -------------------------------------------------------------------------------- /tools/Get-GitHubActions.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | Get-Content -Path (Resolve-Path -Path $PSScriptRoot\..\.github\workflows\*.yml) 6 | | Select-String -Pattern '(?:uses: +)(?.*)$' -NoEmphasis 7 | | ForEach-Object { $_.Matches[0].Groups['action'].Value } 8 | | Sort-Object -Unique 9 | -------------------------------------------------------------------------------- /tools/Get-TextCasesDuration.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | $result = 0 6 | 7 | Get-Content .\pp.txt 8 | | Select-String -Pattern '^ ' 9 | | ForEach-Object { 10 | $_ -cmatch '' | Out-Null 11 | [float] $Matches[1] 12 | } 13 | | ForEach-Object { $result += $_ } 14 | 15 | $result / 1000 16 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | # TinyORM support tools 2 | 3 | Primarily shell scripts, mainly pwsh script eg. for linting, preparing build and runtime environment, building QtSql MySQL driver, searching for todo-s, deployment, ... 4 | 5 | All files that have __.example__ extension contain some path that must be updated based on the current file system. 6 | -------------------------------------------------------------------------------- /tools/configs/UBSan.supp: -------------------------------------------------------------------------------- 1 | implicit-integer-sign-change:qarraydata.h 2 | unsigned-integer-overflow:qhashfunctions.h 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/README.md: -------------------------------------------------------------------------------- 1 | # Portage configuration 2 | 3 | You can inspire from these configuration files, I'm using them on my development machine. 4 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/env/ccache: -------------------------------------------------------------------------------- 1 | FEATURES="ccache" 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/env/debugsyms: -------------------------------------------------------------------------------- 1 | # See https://wiki.gentoo.org/wiki/Valgrind#Troubleshooting 2 | CFLAGS="${CFLAGS} -ggdb" 3 | CXXFLAGS="${CXXFLAGS} -ggdb" 4 | FEATURES="${FEATURES} splitdebug compressdebug -nostrip" 5 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/env/installsources: -------------------------------------------------------------------------------- 1 | # See https://wiki.gentoo.org/wiki/GDB#Retain_debug_symbols 2 | FEATURES="${FEATURES} installsources" 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/env/lto: -------------------------------------------------------------------------------- 1 | LTO="-flto=auto -fno-fat-lto-objects" 2 | CFLAGS="${CFLAGS} ${LTO}" 3 | CXXFLAGS="${CXXFLAGS} ${LTO}" 4 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/ccache: -------------------------------------------------------------------------------- 1 | dev-util/ccache ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/clang: -------------------------------------------------------------------------------- 1 | # Use the latest Clang 😎 2 | sys-devel/llvm* ~amd64 3 | sys-devel/clang* ~amd64 4 | sys-libs/compiler-rt* ~amd64 5 | sys-libs/libomp ~amd64 6 | dev-debug/lldb ~amd64 7 | sys-devel/lld ~amd64 8 | sys-devel/lld-toolchain-symlinks ~amd64 9 | dev-python/lid ~amd64 10 | sys-libs/libcxx ~amd64 11 | sys-libs/libcxxabi ~amd64 12 | sys-libs/llvm-libunwind ~amd64 13 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/cmake: -------------------------------------------------------------------------------- 1 | dev-build/cmake ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/eselect-pwsh: -------------------------------------------------------------------------------- 1 | app-eselect/eselect-pwsh ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/gcc: -------------------------------------------------------------------------------- 1 | sys-devel/gcc ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/gcc-config: -------------------------------------------------------------------------------- 1 | sys-devel/gcc-config ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/mariadb-connector-c: -------------------------------------------------------------------------------- 1 | dev-db/mariadb-connector-c ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/mold: -------------------------------------------------------------------------------- 1 | sys-devel/mold ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/mysql-connector-c: -------------------------------------------------------------------------------- 1 | dev-db/mysql-connector-c ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/postgresql: -------------------------------------------------------------------------------- 1 | dev-db/postgresql ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/pwsh-bin: -------------------------------------------------------------------------------- 1 | app-shells/pwsh-bin ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/tinyorm: -------------------------------------------------------------------------------- 1 | dev-db/tinyorm ~amd64 2 | dev-cpp/tabulate ~amd64 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.accept_keywords/vscode: -------------------------------------------------------------------------------- 1 | app-editors/vscode ~amd64 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.env/glibc: -------------------------------------------------------------------------------- 1 | sys-libs/glibc debugsyms installsources 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.env/tinyorm: -------------------------------------------------------------------------------- 1 | dev-db/tinyorm ccache 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/binutils: -------------------------------------------------------------------------------- 1 | # Enable the gold linker 2 | sys-devel/binutils gold 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/ccache: -------------------------------------------------------------------------------- 1 | dev-util/ccache doc 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/clang: -------------------------------------------------------------------------------- 1 | sys-devel/clang doc 2 | # clang <15 set flags on sys-devel/clang package 3 | =sys-devel/clang-common-15 default-lld llvm-libunwind default-compiler-rt 6 | # required by sys-devel/clang-common-15.0.7-r3::gentoo[llvm-libunwind,default-compiler-rt] 7 | # required by sys-devel/clang-15.0.7-r1::gentoo 8 | # required by @selected 9 | # required by @world (argument) 10 | >=sys-libs/llvm-libunwind-15.0.7 static-libs 11 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/mysql: -------------------------------------------------------------------------------- 1 | dev-db/mysql -server -perl 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/mysql-connector-c: -------------------------------------------------------------------------------- 1 | dev-db/mysql-connector-c static-libs 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/postgresql: -------------------------------------------------------------------------------- 1 | dev-db/postgresql -server 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/qtbase: -------------------------------------------------------------------------------- 1 | dev-qt/qtbase dbus mysql postgres -cups -gtk -libinput -libproxy -nls -udev 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/qtsql: -------------------------------------------------------------------------------- 1 | dev-qt/qtsql postgres -debug 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/package.use/tinyorm: -------------------------------------------------------------------------------- 1 | dev-db/tinyorm lto mysql postgres sqlite mysql-ping tom tom-cli 2 | # The sqlite use flag is ON by default so -sqlite is needed, postgres isn't ON by default 3 | # dev-db/tinyorm build-drivers lto mysql -sqlite 4 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/profile/package.use.mask: -------------------------------------------------------------------------------- 1 | # Unmask the gold USE flag 2 | sys-devel/binutils -gold 3 | 4 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/etc/portage/repos.conf/crystal-repo.conf: -------------------------------------------------------------------------------- 1 | [crystal] 2 | location = /var/db/repos/crystal 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/README.md: -------------------------------------------------------------------------------- 1 | # Gentoo `crystal` repository 2 | 3 | Copy `crystal/` folder to the `/var/db/repos/` 4 | 5 | ```bash 6 | sudo cp -r crystal /var/db/repos 7 | cd /var/db/repos/crystal 8 | sudo chown -R root:root . 9 | ``` 10 | 11 | Enable `crystal` repository by creating the `crystal-repo.conf` at `/etc/portage/repos.conf/` 12 | 13 | ```ini 14 | [crystal] 15 | location = /var/db/repos/crystal 16 | ``` 17 | 18 | Repository also contains the [`tabulate`](https://github.com/p-ranav/tabulate) package because `gentoo` repository doesn't have one. 19 | 20 | Enable unstable `~amd64` keyword for `tinyorm` and `tabulate` packages by creating `tinyorm` file at `/etc/portage/package.accept_keywords/` 21 | 22 | ``` 23 | dev-db/tinyorm ~amd64 24 | dev-cpp/tabulate ~amd64 25 | ``` 26 | 27 | Configure `USE` flags by creating `tinyorm` file at `/etc/portage/package.use/` 28 | 29 | ``` 30 | dev-db/tinyorm mysql postgres sqlite mysql-ping tom tom-cli 31 | #dev-db/tinyorm build-drivers mysql -sqlite 32 | ``` 33 | 34 | Check `USE` flags 35 | 36 | ```bash 37 | equery uses tinyorm 38 | ``` 39 | 40 | Install `tinyorm` package 41 | 42 | ```bash 43 | sudo emerge --quiet-build -va tinyorm 44 | ``` 45 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org/ 2 | root = true 3 | 4 | [*.{ebuild,eclass}] 5 | charset = utf-8 6 | end_of_line = lf 7 | insert_final_newline = true 8 | indent_style = tab 9 | indent_size = 4 10 | trim_trailing_whitespace = true 11 | #max_line_length = 80 12 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/.mailmap: -------------------------------------------------------------------------------- 1 | # Old/new developers can be added here to map their contributions accurately 2 | # before joining and after retiring, as well as the usual uses of .mailmap. 3 | # See gitmailmap(5) for format details. 4 | # Please keep this list sorted. 5 | # Use "grep -v '^#' .mailmap | LC_ALL=en_US.utf-8 sort". 6 | Silver Zachara 7 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/dev-cpp/tabulate/Manifest: -------------------------------------------------------------------------------- 1 | DIST v1.5.tar.gz 2546549 BLAKE2B 9c2005c3b666d2643fb72c78c957fd52c6521cbc1249c441de55a2f8125d7298bfd37c47c439e37be2765b7b037ced4946edbccbee9ac307765584f0c93cbf9f SHA512 324c9f2427d4d0e568b63fcd7bd81f4eee6743d7106af5ead134f81d637f190f77122f28cc42b9e95f7782f5058492b1903eadb44e1c3061a636b32bb93d0ed2 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/dev-cpp/tabulate/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | silver.zachara@gmail.com 6 | Silver Zachara 7 | Primary package maintainer 8 | 9 | 10 | Pranav (p-ranav) 11 | Upstream developer, CC on bugs 12 | 13 | 14 | Table Maker for Modern C++ 15 | 16 | 17 | p-ranav/tabulate 18 | 19 | https://github.com/p-ranav/tabulate/issues 20 | https://github.com/p-ranav/tabulate 21 | 22 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/dev-cpp/tabulate/tabulate-1.5.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=8 5 | 6 | inherit cmake 7 | 8 | DESCRIPTION="Table Maker for Modern C++" 9 | HOMEPAGE="https://github.com/p-ranav/tabulate" 10 | LICENSE="MIT" 11 | SLOT="0" 12 | 13 | if [[ ${PV} == *9999 ]]; then 14 | inherit git-r3 15 | EGIT_REPO_URI="https://github.com/p-ranav/tabulate.git" 16 | EGIT_MIN_CLONE_TYPE="single" 17 | else 18 | SRC_URI="https://github.com/p-ranav/tabulate/archive/refs/tags/v${PV}.tar.gz" 19 | KEYWORDS="~amd64" 20 | fi 21 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/dev-cpp/tabulate/tabulate-9999.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=8 5 | 6 | inherit cmake 7 | 8 | DESCRIPTION="Table Maker for Modern C++" 9 | HOMEPAGE="https://github.com/p-ranav/tabulate" 10 | LICENSE="MIT" 11 | SLOT="0" 12 | 13 | if [[ ${PV} == *9999 ]]; then 14 | inherit git-r3 15 | EGIT_REPO_URI="https://github.com/p-ranav/tabulate.git" 16 | EGIT_MIN_CLONE_TYPE="single" 17 | else 18 | SRC_URI="https://github.com/p-ranav/tabulate/archive/refs/tags/v${PV}.tar.gz" 19 | KEYWORDS="~amd64" 20 | fi 21 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/dev-db/tinyorm/Manifest: -------------------------------------------------------------------------------- 1 | DIST tinyorm-0.37.3.tar.gz 2236948 BLAKE2B 8f7867d52b31756c29ca07db7797d5cee190f80343aca661f4b6ccf3b0bd1eb61568ad05f83d5e7b035ff485dc1089af67383fd69acc7b6065cf1f31421b7bb2 SHA512 f82702d712f845624698f799c7f5d2b30b7d2138f6c4c15e7ca50b316254b55b6606f60ce4356d7156b615b636a6b16e2d1923901825759e54ab60499c4f04cd 2 | DIST tinyorm-0.38.1.tar.gz 2291149 BLAKE2B e152ddf9aa944e9c8e2dc776efd8e8b7d8d10d14c001512ea36ee23bc5d9fe989cec7b6b36c54a7af092aaf52470b8e2431b87e764e460b80adf98c45ee6fdcf SHA512 231601df0e0b9233e6e206717c8ccbe2431ed545858d7efbbad96c7821177d6103d231941fa1bccae8fd2593b5874969bb4e26089d7502839106488d2cd614b6 3 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/metadata/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is a partial list of copyright holders for Gentoo packages. 2 | # It is opt-in and manually maintained, so it will be neither complete 3 | # nor necessarily up to date. A more exhaustive list can be obtained 4 | # by additionally extracting author information from the commit history 5 | # of the Gentoo CVS and git repositories. 6 | # 7 | # Requests to be listed below can be filed at https://bugs.gentoo.org/ 8 | # under the Gentoo Foundation product. To be considered, an entity must 9 | # have made a legally significant contribution, as determined by the 10 | # Board of Trustees. As a reference, the following guide can be used: 11 | # https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html 12 | # 13 | # Entries are single lines and contain the entity's name and an optional 14 | # e-mail address. Keep the list sorted (use "LC_ALL=en_US.utf-8 sort"). 15 | # 16 | Silver Zachara 17 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/metadata/layout.conf: -------------------------------------------------------------------------------- 1 | masters = gentoo 2 | thin-manifests = true 3 | sign-manifests = false 4 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/profiles/eapi: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /tools/distributions/gentoo/var/db/repos/crystal/profiles/repo_name: -------------------------------------------------------------------------------- 1 | crystal 2 | -------------------------------------------------------------------------------- /tools/msys2.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | rem This is a helper script for GitHub self-hosted runner to avoid using msys2_shell.cmd, 5 | rem msys2_shell.cmd is more complex and supports more features, but is also slower, 6 | rem this script is the exact opposite, it only contains what we need. 7 | 8 | IF NOT DEFINED MSYSTEM set MSYSTEM=UCRT64 9 | IF NOT DEFINED MSYS2_PATH_TYPE set MSYS2_PATH_TYPE=minimal 10 | set CHERE_INVOKING=1 11 | 12 | "%MSYS2_ROOT%\usr\bin\bash.exe" -leo pipefail %* 13 | -------------------------------------------------------------------------------- /tools/private/Common-Linting.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | # This file contains common functions for Lint-TinyORM.ps1 related scripts 6 | 7 | # Functions section 8 | # --- 9 | 10 | # Test whether the compile commands database exists 11 | function Get-CompileCommandsPath { 12 | [OutputType([string])] 13 | Param() 14 | 15 | $regEx = '-p=(?.*)' 16 | $pArgs = $args -cmatch $regEx 17 | $containsPArgs = $pArgs.Count -ge 1 18 | 19 | # Get the last -p path 20 | if ($containsPArgs) { 21 | $pArgs[$pArgs.Count - 1] -cmatch $regEx | Out-Null 22 | $compileCommandsPath = Resolve-Path -Path $Matches.path 23 | } 24 | # Use the PWD 25 | else { 26 | $compileCommandsPath = Resolve-Path -Path . 27 | } 28 | 29 | return $compileCommandsPath 30 | } 31 | -------------------------------------------------------------------------------- /tools/qft.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, Mandatory, 5 | HelpMessage = 'Specifies todo tasks to find on each line. The pattern value is used ' + 6 | 'in regular expression.')] 7 | [ValidateNotNullOrEmpty()] 8 | [string] $Pattern, 9 | 10 | [Parameter(Position = 1, HelpMessage = 'Todo keywords regex pattern.')] 11 | [ValidateNotNullOrEmpty()] 12 | [string] $TodoKeywordsPattern = ' (TODO|NOTE|FIXME|BUG|WARNING|CUR|FEATURE|TEST|FUTURE|CUR1|TMP|SEC) ', 13 | 14 | [Parameter(HelpMessage = 'Specifies subfolders to search. The pattern value is used ' + 15 | 'in regular expression, eg. (drivers|examples|include|src|tests|tom).')] 16 | [AllowEmptyString()] 17 | [string] $InSubFoldersPattern = '(drivers|examples|include|src|tests|tom)' 18 | ) 19 | 20 | Set-StrictMode -Version 3.0 21 | 22 | Find-TinyORMTodos.ps1 @PSBoundParameters 23 | -------------------------------------------------------------------------------- /tools/qtenv6.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | Write-Host 'Setting up environment for Qt 6.7.2 usage...' -ForegroundColor Magenta 6 | Write-Host 7 | 8 | $Script:QtRoot = $env:TINY_QT_ROOT ?? 'C:\Qt' 9 | 10 | $env:Path = "$Script:QtRoot\6.7.2\msvc2019_64\bin;" + $env:Path 11 | 12 | . vcvars64.ps1 13 | -------------------------------------------------------------------------------- /tools/run-clang-tidy.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | . $PSScriptRoot\private\Common-Host.ps1 6 | . $PSScriptRoot\private\Common-Linting.ps1 7 | 8 | if (-not (Test-Path -LiteralPath "$(Get-CompileCommandsPath @args)\compile_commands.json")) { 9 | Write-ExitError 'Compile database compile_commands.json doesn''t exist.' -NoNewlineBefore 10 | } 11 | 12 | $platform = $PSVersionTable.Platform 13 | 14 | switch ($platform) { 15 | 'Win32NT' { 16 | # run-clang-tidy (scoop install llvm) 17 | python.exe 'C:\Users\\scoop\apps\llvm\current\bin\run-clang-tidy' @args 18 | } 19 | 'Unix' { 20 | # Calling the run-clang-tidy only causes the recursive call to the run-clang-tidy.ps1 itself 21 | python (which run-clang-tidy) @args 22 | } 23 | Default { 24 | throw "$platform platform is not supported." 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/run-clazy-standalone.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | . $PSScriptRoot\private\Common-Host.ps1 6 | . $PSScriptRoot\private\Common-Linting.ps1 7 | 8 | if (-not (Test-Path -LiteralPath "$(Get-CompileCommandsPath @args)\compile_commands.json")) { 9 | Write-ExitError 'Compile database compile_commands.json doesn''t exist.' -NoNewlineBefore 10 | } 11 | 12 | # run-clazy-standalone.py is our own script 13 | 14 | $platform = $PSVersionTable.Platform 15 | 16 | switch ($platform) { 17 | 'Win32NT' { 18 | python.exe '\run-clazy-standalone.py' @args 19 | } 20 | 'Unix' { 21 | run-clazy-standalone.py @args 22 | } 23 | Default { 24 | throw "$platform platform is not supported." 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tools/std.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, ValueFromPipeline, ValueFromPipelinebyPropertyName, 5 | HelpMessage = 'Specifies the TinyORM debug build folder to add.')] 6 | [ValidateNotNullOrEmpty()] 7 | [string[]] $BuildPath = (Get-Location).Path 8 | ) 9 | 10 | Set-StrictMode -Version 3.0 11 | 12 | Add-FolderOnPath.ps1 -Path $BuildPath\drivers\common\debug, 13 | $BuildPath\drivers\mysql\debug, 14 | $BuildPath\src\debug, 15 | $BuildPath\examples\tom\debug, 16 | $BuildPath\tests\testdata_tom\debug 17 | -------------------------------------------------------------------------------- /tools/stdm6.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | # Initialize build environment if it's not already there 6 | if (-not (Test-Path env:WindowsSDKLibVersion)) { 7 | . qtenv6.ps1 8 | } 9 | 10 | std.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_7_2_MSVC2022_64bit-Debug' 11 | -------------------------------------------------------------------------------- /tools/stpm6.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | # Initialize build environment if it's not already there 6 | if (-not (Test-Path env:WindowsSDKLibVersion)) { 7 | . qtenv6.ps1 8 | } 9 | 10 | str.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_7_2_MSVC2022_64bit-Profile' 11 | -------------------------------------------------------------------------------- /tools/str.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, ValueFromPipeline, ValueFromPipelinebyPropertyName, 5 | HelpMessage = 'Specifies the TinyORM release build folder to add.')] 6 | [ValidateNotNullOrEmpty()] 7 | [string[]] $BuildPath = (Get-Location).Path 8 | ) 9 | 10 | Set-StrictMode -Version 3.0 11 | 12 | Add-FolderOnPath.ps1 -Path $BuildPath\drivers\common\release, 13 | $BuildPath\drivers\mysql\release, 14 | $BuildPath\src\release, 15 | $BuildPath\examples\tom\release, 16 | $BuildPath\tests\testdata_tom\release 17 | -------------------------------------------------------------------------------- /tools/strm6.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | # Initialize build environment if it's not already there 6 | if (-not (Test-Path env:WindowsSDKLibVersion)) { 7 | . qtenv6.ps1 8 | } 9 | 10 | str.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_7_2_MSVC2022_64bit-Release' 11 | -------------------------------------------------------------------------------- /tools/svcpkg_tinyorm_port_qt6_testing.ps1.example: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Set-StrictMode -Version 3.0 4 | 5 | Write-Host 'Setting up environment for vcpkg-tinyorm-port Qt6 usage...' -ForegroundColor Magenta 6 | 7 | Add-FolderOnPath.ps1 -Path '\vcpkg-tinyorm-port-qt6' 8 | Write-Host 9 | 10 | $env:VCPKG_ROOT = '\vcpkg-tinyorm-port-qt6' 11 | 12 | . vcvars64.ps1 13 | -------------------------------------------------------------------------------- /tools/vcvars32.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, HelpMessage = 'Visual Studio version.')] 5 | [ValidateNotNull()] 6 | [ValidatePattern('2019|2022')] 7 | [Int] $Version = 2022 8 | ) 9 | 10 | Set-StrictMode -Version 3.0 11 | 12 | $programFiles = $Version -gt 2019 ? 'Program Files' : 'Program Files (x86)' 13 | 14 | cmd.exe /c "call `"C:\$programFiles\Microsoft Visual Studio\$Version\Community\VC\Auxiliary\Build\vcvars32.bat`" && set > %TEMP%\vcvars32_$Version.tmp" 15 | 16 | Get-Content "$env:TEMP\vcvars32_$Version.tmp" | Foreach-Object { 17 | if ($_ -match "^(.*?)=(.*)$") { 18 | Set-Content "env:\$($matches[1])" $matches[2] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tools/vcvars64.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | Param( 4 | [Parameter(Position = 0, HelpMessage = 'Visual Studio version.')] 5 | [ValidateNotNull()] 6 | [ValidatePattern('2019|2022')] 7 | [Int] $Version = 2022 8 | ) 9 | 10 | Set-StrictMode -Version 3.0 11 | 12 | $programFiles = $Version -gt 2019 ? 'Program Files' : 'Program Files (x86)' 13 | 14 | cmd.exe /c "call `"C:\$programFiles\Microsoft Visual Studio\$Version\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %TEMP%\vcvars64_$Version.tmp" 15 | 16 | Get-Content "$env:TEMP\vcvars64_$Version.tmp" | Foreach-Object { 17 | if ($_ -match "^(.*?)=(.*)$") { 18 | Set-Content "env:\$($matches[1])" $matches[2] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "name": "tinyorm", 4 | "version-semver": "0.1.0", 5 | "description": "C++ ORM library for Qt framework", 6 | "homepage": "https://github.com/silverqx/TinyORM", 7 | "documentation": "https://www.tinyorm.org", 8 | "maintainers": "Silver Zachara ", 9 | "supports": "!(uwp | arm | android | emscripten | osx | ios | xbox | freebsd | openbsd | wasm32)", 10 | "dependencies": [ 11 | "range-v3", 12 | "tabulate" 13 | ], 14 | "features": { 15 | "mysqlping": { 16 | "description": "Install a MySQL client library to support the mysql_ping() used by MySqlConnection::pingDatabase()", 17 | "dependencies": [ 18 | "libmysql" 19 | ] 20 | } 21 | } 22 | } 23 | --------------------------------------------------------------------------------