Changeset View
Changeset View
Standalone View
Standalone View
src/KDbConnection_p.h
Show All 20 Lines | |||||
21 | #define KDB_CONNECTION_P_H | 21 | #define KDB_CONNECTION_P_H | ||
22 | 22 | | |||
23 | #include "KDbConnectionData.h" | 23 | #include "KDbConnectionData.h" | ||
24 | #include "KDbConnection.h" | 24 | #include "KDbConnection.h" | ||
25 | #include "KDbConnectionOptions.h" | 25 | #include "KDbConnectionOptions.h" | ||
26 | #include "kdb_export.h" | 26 | #include "kdb_export.h" | ||
27 | #include "KDbParser.h" | 27 | #include "KDbParser.h" | ||
28 | #include "KDbProperties.h" | 28 | #include "KDbProperties.h" | ||
29 | #include "KDbQuerySchema_p.h" | ||||
29 | #include "KDbVersionInfo.h" | 30 | #include "KDbVersionInfo.h" | ||
30 | 31 | | |||
31 | //! Interface for accessing connection's internal result, for use by drivers. | 32 | //! Interface for accessing connection's internal result, for use by drivers. | ||
32 | class KDB_EXPORT KDbConnectionInternal | 33 | class KDB_EXPORT KDbConnectionInternal | ||
33 | { | 34 | { | ||
34 | public: | 35 | public: | ||
35 | explicit KDbConnectionInternal(KDbConnection *conn); | 36 | explicit KDbConnectionInternal(KDbConnection *conn); | ||
36 | KDbConnection* const connection; | 37 | KDbConnection* const connection; | ||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 45 | public: | |||
118 | KDbTableSchema* setupTableSchema(KDbTableSchema *table) Q_REQUIRED_RESULT; | 119 | KDbTableSchema* setupTableSchema(KDbTableSchema *table) Q_REQUIRED_RESULT; | ||
119 | 120 | | |||
120 | /*! @return a full query schema for a query using 'kexi__*' system tables. | 121 | /*! @return a full query schema for a query using 'kexi__*' system tables. | ||
121 | Connection keeps ownership of the returned object. | 122 | Connection keeps ownership of the returned object. | ||
122 | Used internally by querySchema() methods. | 123 | Used internally by querySchema() methods. | ||
123 | On failure deletes @a query and returns @c nullptr. */ | 124 | On failure deletes @a query and returns @c nullptr. */ | ||
124 | KDbQuerySchema* setupQuerySchema(KDbQuerySchema *query) Q_REQUIRED_RESULT; | 125 | KDbQuerySchema* setupQuerySchema(KDbQuerySchema *query) Q_REQUIRED_RESULT; | ||
125 | 126 | | |||
127 | //! @return cached fields expanded information for @a query | ||||
128 | KDbQuerySchemaFieldsExpanded *fieldsExpanded(const KDbQuerySchema *query); | ||||
129 | | ||||
130 | //! Inserts cached fields expanded information for @a query | ||||
131 | void insertFieldsExpanded(const KDbQuerySchema *query, KDbQuerySchemaFieldsExpanded *cache); | ||||
132 | | ||||
126 | KDbConnection* const conn; //!< The @a KDbConnection instance this @a KDbConnectionPrivate belongs to. | 133 | KDbConnection* const conn; //!< The @a KDbConnection instance this @a KDbConnectionPrivate belongs to. | ||
127 | KDbConnectionData connData; //!< the @a KDbConnectionData used within that connection. | 134 | KDbConnectionData connData; //!< the @a KDbConnectionData used within that connection. | ||
128 | 135 | | |||
129 | //! True for read only connection. Used especially for file-based drivers. | 136 | //! True for read only connection. Used especially for file-based drivers. | ||
130 | KDbConnectionOptions options; | 137 | KDbConnectionOptions options; | ||
131 | 138 | | |||
132 | //!< The driver this @a KDbConnection instance uses. | 139 | //!< The driver this @a KDbConnection instance uses. | ||
133 | KDbDriver * const driver; | 140 | KDbDriver * const driver; | ||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 196 | private: | |||
190 | //! Table schemas retrieved on demand with tableSchema() | 197 | //! Table schemas retrieved on demand with tableSchema() | ||
191 | QHash<int, KDbTableSchema*> m_tables; | 198 | QHash<int, KDbTableSchema*> m_tables; | ||
192 | QHash<QString, KDbTableSchema*> m_tablesByName; | 199 | QHash<QString, KDbTableSchema*> m_tablesByName; | ||
193 | //! used just for removing system KDbTableSchema objects on db close. | 200 | //! used just for removing system KDbTableSchema objects on db close. | ||
194 | QSet<KDbInternalTableSchema*> m_internalKDbTables; | 201 | QSet<KDbInternalTableSchema*> m_internalKDbTables; | ||
195 | //! Query schemas retrieved on demand with querySchema() | 202 | //! Query schemas retrieved on demand with querySchema() | ||
196 | QHash<int, KDbQuerySchema*> m_queries; | 203 | QHash<int, KDbQuerySchema*> m_queries; | ||
197 | QHash<QString, KDbQuerySchema*> m_queriesByName; | 204 | QHash<QString, KDbQuerySchema*> m_queriesByName; | ||
205 | KDbUtils::AutodeletedHash<const KDbQuerySchema*, KDbQuerySchemaFieldsExpanded*> m_fieldsExpandedCache; | ||||
198 | Q_DISABLE_COPY(KDbConnectionPrivate) | 206 | Q_DISABLE_COPY(KDbConnectionPrivate) | ||
199 | }; | 207 | }; | ||
200 | 208 | | |||
201 | #endif | 209 | #endif |