Files
TinyORM/include/include.pri
silverqx b13728db08 refactored PostgreSQL search_path configuration
Changed from the 'schema' configuration option to the 'search_path',
the 'schema' config. option was dropped and currently throws exception
with a suggestion to use the 'search_path' instead.

The new 'search_path' config. option can be the QString or QStringList
and also supports to set an empty search_path using '' or empty QString
or QStringList.
This search_path config. option is correctly parsed and quoted.
Setting the search_path is initiated from the PostgresConnector
right after the database connection is established.

The PostgresSchemaBuilder is actively using the search_path during
practically all method calls (dropAllTables(), getColumnListing(),
hasTable(), ...). If the search_path is not defined then it queries
the database for the real search_path because the search_path can be
changed anytime and the search_path configuration option value can be
incorrect (out of sync).
It also works correctly with the empty search_path, in this case a fully
qualified table names are required. If the table name is not fully
qualified then the SearchPathEmptyError exception is thrown.
And it also works correctly with the "$user" PostgreSQL's variable, this
variable is resolved to the config["username"] during obtaining
the search_path from the database.

In the pretend mode it behaves little different, if pretending then
the 'search_path' is obtained from the connection configuration and
if the 'search_path' is not defined in the config. the 'public' will
be used as the default.

 - added many new unit and functional tests which are testing all the
   above described scenarios
   - added new functional test case tst_PostgreSQL_SchemaBuilder_f
   - added new functional test case tst_SchemaBuilder
   - added new tests for dropAllTable(), dropAllViews(), hasTable(),
     getColumnListing(), createDatabase(), dropDatabaseIfExists()
     for ALL supported databases
 - added new search_path constant
 - renamed env. variable to DB_PGSQL_SEARCHPATH (from DB_PGSQL_SCHEMA)
 - added new search_path and dont_drop configuration validations to
   check correct type (QString or QStringList)
 - added new 'schema' config. option validation
 - added new exception SearchPathEmptyError
 - started the TinyUtils::Databases refactor
2023-02-11 09:39:28 +01:00

157 lines
6.6 KiB
Plaintext

INCLUDEPATH += $$PWD
extern_constants: \
headersList += \
$$PWD/orm/constants_extern.hpp \
$$PWD/orm/schema/schemaconstants_extern.hpp
else: \
headersList += \
$$PWD/orm/constants_inline.hpp \
$$PWD/orm/schema/schemaconstants_inline.hpp
headersList += \
$$PWD/orm/basegrammar.hpp \
$$PWD/orm/concerns/countsqueries.hpp \
$$PWD/orm/concerns/detectslostconnections.hpp \
$$PWD/orm/concerns/hasconnectionresolver.hpp \
$$PWD/orm/concerns/logsqueries.hpp \
$$PWD/orm/concerns/managestransactions.hpp \
$$PWD/orm/concerns/parsessearchpath.hpp \
$$PWD/orm/config.hpp \
$$PWD/orm/configurations/configurationoptionsparser.hpp \
$$PWD/orm/configurations/configurationparser.hpp \
$$PWD/orm/configurations/configurationparserfactory.hpp \
$$PWD/orm/configurations/configurationparserinterface.hpp \
$$PWD/orm/configurations/mysqlconfigurationparser.hpp \
$$PWD/orm/configurations/postgresconfigurationparser.hpp \
$$PWD/orm/configurations/sqliteconfigurationparser.hpp \
$$PWD/orm/connectionresolverinterface.hpp \
$$PWD/orm/connectors/connectionfactory.hpp \
$$PWD/orm/connectors/connector.hpp \
$$PWD/orm/connectors/connectorinterface.hpp \
$$PWD/orm/connectors/mysqlconnector.hpp \
$$PWD/orm/connectors/postgresconnector.hpp \
$$PWD/orm/connectors/sqliteconnector.hpp \
$$PWD/orm/constants.hpp \
$$PWD/orm/databaseconnection.hpp \
$$PWD/orm/databasemanager.hpp \
$$PWD/orm/db.hpp \
$$PWD/orm/exceptions/domainerror.hpp \
$$PWD/orm/exceptions/invalidargumenterror.hpp \
$$PWD/orm/exceptions/invalidformaterror.hpp \
$$PWD/orm/exceptions/invalidtemplateargumenterror.hpp \
$$PWD/orm/exceptions/logicerror.hpp \
$$PWD/orm/exceptions/multiplerecordsfounderror.hpp \
$$PWD/orm/exceptions/ormerror.hpp \
$$PWD/orm/exceptions/queryerror.hpp \
$$PWD/orm/exceptions/recordsnotfounderror.hpp \
$$PWD/orm/exceptions/runtimeerror.hpp \
$$PWD/orm/exceptions/searchpathemptyerror.hpp \
$$PWD/orm/exceptions/sqlerror.hpp \
$$PWD/orm/exceptions/sqlitedatabasedoesnotexisterror.hpp \
$$PWD/orm/exceptions/sqltransactionerror.hpp \
$$PWD/orm/libraryinfo.hpp \
$$PWD/orm/macros/archdetect.hpp \
$$PWD/orm/macros/commonnamespace.hpp \
$$PWD/orm/macros/compilerdetect.hpp \
$$PWD/orm/macros/export.hpp \
$$PWD/orm/macros/export_common.hpp \
$$PWD/orm/macros/likely.hpp \
$$PWD/orm/macros/logexecutedquery.hpp \
$$PWD/orm/macros/systemheader.hpp \
$$PWD/orm/macros/threadlocal.hpp \
$$PWD/orm/mysqlconnection.hpp \
$$PWD/orm/ormconcepts.hpp \
$$PWD/orm/ormtypes.hpp \
$$PWD/orm/postgresconnection.hpp \
$$PWD/orm/query/concerns/buildsqueries.hpp \
$$PWD/orm/query/expression.hpp \
$$PWD/orm/query/grammars/grammar.hpp \
$$PWD/orm/query/grammars/mysqlgrammar.hpp \
$$PWD/orm/query/grammars/postgresgrammar.hpp \
$$PWD/orm/query/grammars/sqlitegrammar.hpp \
$$PWD/orm/query/joinclause.hpp \
$$PWD/orm/query/processors/mysqlprocessor.hpp \
$$PWD/orm/query/processors/postgresprocessor.hpp \
$$PWD/orm/query/processors/processor.hpp \
$$PWD/orm/query/processors/sqliteprocessor.hpp \
$$PWD/orm/query/querybuilder.hpp \
$$PWD/orm/schema.hpp \
$$PWD/orm/schema/blueprint.hpp \
$$PWD/orm/schema/columndefinition.hpp \
$$PWD/orm/schema/columndefinitionreference.hpp \
$$PWD/orm/schema/foreignidcolumndefinitionreference.hpp \
$$PWD/orm/schema/foreignkeydefinitionreference.hpp \
$$PWD/orm/schema/grammars/mysqlschemagrammar.hpp \
$$PWD/orm/schema/grammars/postgresschemagrammar.hpp \
$$PWD/orm/schema/grammars/schemagrammar.hpp \
$$PWD/orm/schema/grammars/sqliteschemagrammar.hpp \
$$PWD/orm/schema/indexdefinitionreference.hpp \
$$PWD/orm/schema/mysqlschemabuilder.hpp \
$$PWD/orm/schema/postgresschemabuilder.hpp \
$$PWD/orm/schema/schemabuilder.hpp \
$$PWD/orm/schema/schemaconstants.hpp \
$$PWD/orm/schema/schematypes.hpp \
$$PWD/orm/schema/sqliteschemabuilder.hpp \
$$PWD/orm/sqliteconnection.hpp \
$$PWD/orm/support/databaseconfiguration.hpp \
$$PWD/orm/support/databaseconnectionsmap.hpp \
$$PWD/orm/types/log.hpp \
$$PWD/orm/types/sqlquery.hpp \
$$PWD/orm/types/statementscounter.hpp \
$$PWD/orm/utils/configuration.hpp \
$$PWD/orm/utils/container.hpp \
$$PWD/orm/utils/fs.hpp \
$$PWD/orm/utils/helpers.hpp \
$$PWD/orm/utils/nullvariant.hpp \
$$PWD/orm/utils/query.hpp \
$$PWD/orm/utils/string.hpp \
$$PWD/orm/utils/thread.hpp \
$$PWD/orm/utils/type.hpp \
$$PWD/orm/version.hpp \
!disable_orm: \
headersList += \
$$PWD/orm/tiny/concerns/buildsqueries.hpp \
$$PWD/orm/tiny/concerns/buildssoftdeletes.hpp \
$$PWD/orm/tiny/concerns/guardedmodel.hpp \
$$PWD/orm/tiny/concerns/guardsattributes.hpp \
$$PWD/orm/tiny/concerns/hasattributes.hpp \
$$PWD/orm/tiny/concerns/hasrelationships.hpp \
$$PWD/orm/tiny/concerns/hasrelationstore.hpp \
$$PWD/orm/tiny/concerns/hastimestamps.hpp \
$$PWD/orm/tiny/concerns/queriesrelationships.hpp \
$$PWD/orm/tiny/exceptions/massassignmenterror.hpp \
$$PWD/orm/tiny/exceptions/modelnotfounderror.hpp \
$$PWD/orm/tiny/exceptions/relationnotfounderror.hpp \
$$PWD/orm/tiny/exceptions/relationnotloadederror.hpp \
$$PWD/orm/tiny/macros/crtpmodel.hpp \
$$PWD/orm/tiny/macros/crtpmodelwithbase.hpp \
$$PWD/orm/tiny/model.hpp \
$$PWD/orm/tiny/modelproxies.hpp \
$$PWD/orm/tiny/relations/basepivot.hpp \
$$PWD/orm/tiny/relations/belongsto.hpp \
$$PWD/orm/tiny/relations/belongstomany.hpp \
$$PWD/orm/tiny/relations/concerns/comparesrelatedmodels.hpp \
$$PWD/orm/tiny/relations/concerns/interactswithpivottable.hpp \
$$PWD/orm/tiny/relations/concerns/supportsdefaultmodels.hpp \
$$PWD/orm/tiny/relations/hasmany.hpp \
$$PWD/orm/tiny/relations/hasone.hpp \
$$PWD/orm/tiny/relations/hasoneormany.hpp \
$$PWD/orm/tiny/relations/pivot.hpp \
$$PWD/orm/tiny/relations/relation.hpp \
$$PWD/orm/tiny/relations/relationproxies.hpp \
$$PWD/orm/tiny/relations/relationtypes.hpp \
$$PWD/orm/tiny/softdeletes.hpp \
$$PWD/orm/tiny/tinybuilder.hpp \
$$PWD/orm/tiny/tinybuilderproxies.hpp \
$$PWD/orm/tiny/tinyconcepts.hpp \
$$PWD/orm/tiny/tinytypes.hpp \
$$PWD/orm/tiny/types/connectionoverride.hpp \
$$PWD/orm/tiny/types/syncchanges.hpp \
$$PWD/orm/tiny/utils/attribute.hpp \
HEADERS += $$sorted(headersList)
unset(headersList)