![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
00001 /* 00002 Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved. 00003 00004 The MySQL Connector/C++ is licensed under the terms of the GPL 00005 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most 00006 MySQL Connectors. There are special exceptions to the terms and 00007 conditions of the GPL as it is applied to this software, see the 00008 FLOSS License Exception 00009 <http://www.mysql.com/about/legal/licensing/foss-exception.html>. 00010 */ 00011 00012 #ifndef _SQL_METADATA_H_ 00013 #define _SQL_METADATA_H_ 00014 00015 #include <string> 00016 #include <list> 00017 #include "datatype.h" 00018 00019 namespace sql 00020 { 00021 class ResultSet; 00022 00023 class DatabaseMetaData 00024 { 00025 protected: 00026 virtual ~DatabaseMetaData() {} 00027 00028 public: 00029 enum 00030 { 00031 attributeNoNulls = 0, 00032 attributeNullable, 00033 attributeNullableUnknown 00034 }; 00035 enum 00036 { 00037 bestRowTemporary = 0, 00038 bestRowTransaction, 00039 bestRowSession 00040 }; 00041 enum 00042 { 00043 bestRowUnknown = 0, 00044 bestRowNotPseudo, 00045 bestRowPseudo 00046 }; 00047 enum 00048 { 00049 columnNoNulls = 0, 00050 columnNullable, 00051 columnNullableUnknown 00052 }; 00053 enum 00054 { 00055 importedKeyCascade = 0, 00056 importedKeyInitiallyDeferred, 00057 importedKeyInitiallyImmediate, 00058 importedKeyNoAction, 00059 importedKeyNotDeferrable, 00060 importedKeyRestrict, 00061 importedKeySetDefault, 00062 importedKeySetNull 00063 }; 00064 enum 00065 { 00066 procedureColumnIn = 0, 00067 procedureColumnInOut, 00068 procedureColumnOut, 00069 procedureColumnResult, 00070 procedureColumnReturn, 00071 procedureColumnUnknown, 00072 procedureNoNulls, 00073 procedureNoResult, 00074 procedureNullable, 00075 procedureNullableUnknown, 00076 procedureResultUnknown, 00077 procedureReturnsResult 00078 }; 00079 enum 00080 { 00081 sqlStateSQL99 = 0, 00082 sqlStateXOpen 00083 }; 00084 enum 00085 { 00086 tableIndexClustered = 0, 00087 tableIndexHashed, 00088 tableIndexOther, 00089 tableIndexStatistic 00090 }; 00091 enum 00092 { 00093 versionColumnUnknown = 0, 00094 versionColumnNotPseudo = 1, 00095 versionColumnPseudo = 2 00096 }; 00097 enum 00098 { 00099 typeNoNulls = 0, 00100 typeNullable = 1, 00101 typeNullableUnknown = 2 00102 }; 00103 enum 00104 { 00105 typePredNone = 0, 00106 typePredChar = 1, 00107 typePredBasic= 2, 00108 typeSearchable = 3 00109 }; 00110 00111 00112 virtual bool allProceduresAreCallable() = 0; 00113 00114 virtual bool allTablesAreSelectable() = 0; 00115 00116 virtual bool dataDefinitionCausesTransactionCommit() = 0; 00117 00118 virtual bool dataDefinitionIgnoredInTransactions() = 0; 00119 00120 virtual bool deletesAreDetected(int type) = 0; 00121 00122 virtual bool doesMaxRowSizeIncludeBlobs() = 0; 00123 00124 virtual ResultSet * getAttributes(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern, const std::string& attributeNamePattern) = 0; 00125 00126 virtual ResultSet * getBestRowIdentifier(const std::string& catalog, const std::string& schema, const std::string& table, int scope, bool nullable) = 0; 00127 00128 virtual ResultSet * getCatalogs() = 0; 00129 00130 virtual const std::string& getCatalogSeparator() = 0; 00131 00132 virtual const std::string& getCatalogTerm() = 0; 00133 00134 virtual ResultSet * getColumnPrivileges(const std::string& catalog, const std::string& schema, const std::string& table, const std::string& columnNamePattern) = 0; 00135 00136 virtual ResultSet * getColumns(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern, const std::string& columnNamePattern) = 0; 00137 00138 virtual Connection * getConnection() = 0; 00139 00140 virtual ResultSet * getCrossReference(const std::string& primaryCatalog, const std::string& primarySchema, const std::string& primaryTable, const std::string& foreignCatalog, const std::string& foreignSchema, const std::string& foreignTable) = 0; 00141 00142 virtual unsigned int getDatabaseMajorVersion() = 0; 00143 00144 virtual unsigned int getDatabaseMinorVersion() = 0; 00145 00146 virtual unsigned int getDatabasePatchVersion() = 0; 00147 00148 virtual const std::string& getDatabaseProductName() = 0; 00149 00150 virtual std::string getDatabaseProductVersion() = 0; 00151 00152 virtual int getDefaultTransactionIsolation() = 0; 00153 00154 virtual unsigned int getDriverMajorVersion() = 0; 00155 00156 virtual unsigned int getDriverMinorVersion() = 0; 00157 00158 virtual unsigned int getDriverPatchVersion() = 0; 00159 00160 virtual const std::string& getDriverName() = 0; 00161 00162 virtual const std::string& getDriverVersion() = 0; 00163 00164 virtual ResultSet * getExportedKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0; 00165 00166 virtual const std::string& getExtraNameCharacters() = 0; 00167 00168 virtual const std::string& getIdentifierQuoteString() = 0; 00169 00170 virtual ResultSet * getImportedKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0; 00171 00172 virtual ResultSet * getIndexInfo(const std::string& catalog, const std::string& schema, const std::string& table, bool unique, bool approximate) = 0; 00173 00174 virtual unsigned int getCDBCMajorVersion() = 0; 00175 00176 virtual unsigned int getCDBCMinorVersion() = 0; 00177 00178 virtual unsigned int getMaxBinaryLiteralLength() = 0; 00179 00180 virtual unsigned int getMaxCatalogNameLength() = 0; 00181 00182 virtual unsigned int getMaxCharLiteralLength() = 0; 00183 00184 virtual unsigned int getMaxColumnNameLength() = 0; 00185 00186 virtual unsigned int getMaxColumnsInGroupBy() = 0; 00187 00188 virtual unsigned int getMaxColumnsInIndex() = 0; 00189 00190 virtual unsigned int getMaxColumnsInOrderBy() = 0; 00191 00192 virtual unsigned int getMaxColumnsInSelect() = 0; 00193 00194 virtual unsigned int getMaxColumnsInTable() = 0; 00195 00196 virtual unsigned int getMaxConnections() = 0; 00197 00198 virtual unsigned int getMaxCursorNameLength() = 0; 00199 00200 virtual unsigned int getMaxIndexLength() = 0; 00201 00202 virtual unsigned int getMaxProcedureNameLength() = 0; 00203 00204 virtual unsigned int getMaxRowSize() = 0; 00205 00206 virtual unsigned int getMaxSchemaNameLength() = 0; 00207 00208 virtual unsigned int getMaxStatementLength() = 0; 00209 00210 virtual unsigned int getMaxStatements() = 0; 00211 00212 virtual unsigned int getMaxTableNameLength() = 0; 00213 00214 virtual unsigned int getMaxTablesInSelect() = 0; 00215 00216 virtual unsigned int getMaxUserNameLength() = 0; 00217 00218 virtual const std::string& getNumericFunctions() = 0; 00219 00220 virtual ResultSet * getPrimaryKeys(const std::string& catalog, const std::string& schema, const std::string& table) = 0; 00221 00222 virtual ResultSet * getProcedures(const std::string& catalog, const std::string& schemaPattern, const std::string& procedureNamePattern) = 0; 00223 00224 virtual const std::string& getProcedureTerm() = 0; 00225 00226 virtual int getResultSetHoldability() = 0; 00227 00228 virtual ResultSet * getSchemas() = 0; 00229 00230 virtual const std::string& getSchemaTerm() = 0; 00231 00232 virtual const std::string& getSearchStringEscape() = 0; 00233 00234 virtual const std::string& getSQLKeywords() = 0; 00235 00236 virtual int getSQLStateType() = 0; 00237 00238 virtual const std::string& getStringFunctions() = 0; 00239 00240 virtual ResultSet * getSuperTables(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern) = 0; 00241 00242 virtual ResultSet * getSuperTypes(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern) = 0; 00243 00244 virtual const std::string& getSystemFunctions() = 0; 00245 00246 virtual ResultSet * getTablePrivileges(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern) = 0; 00247 00248 virtual ResultSet * getTables(const std::string& catalog, const std::string& schemaPattern, const std::string& tableNamePattern, std::list<std::string> &types) = 0; 00249 00250 virtual ResultSet * getTableTypes() = 0; 00251 00252 virtual const std::string& getTimeDateFunctions() = 0; 00253 00254 virtual ResultSet * getTypeInfo() = 0; 00255 00256 virtual ResultSet * getUDTs(const std::string& catalog, const std::string& schemaPattern, const std::string& typeNamePattern, std::list<int> &types) = 0; 00257 00258 virtual std::string getUserName() = 0; 00259 00260 virtual ResultSet * getVersionColumns(const std::string& catalog, const std::string& schema, const std::string& table) = 0; 00261 00262 virtual bool insertsAreDetected(int type) = 0; 00263 00264 virtual bool isCatalogAtStart() = 0; 00265 00266 virtual bool isReadOnly() = 0; 00267 00268 virtual bool nullPlusNonNullIsNull() = 0; 00269 00270 virtual bool nullsAreSortedAtEnd() = 0; 00271 00272 virtual bool nullsAreSortedAtStart() = 0; 00273 00274 virtual bool nullsAreSortedHigh() = 0; 00275 00276 virtual bool nullsAreSortedLow() = 0; 00277 00278 virtual bool othersDeletesAreVisible(int type) = 0; 00279 00280 virtual bool othersInsertsAreVisible(int type) = 0; 00281 00282 virtual bool othersUpdatesAreVisible(int type) = 0; 00283 00284 virtual bool ownDeletesAreVisible(int type) = 0; 00285 00286 virtual bool ownInsertsAreVisible(int type) = 0; 00287 00288 virtual bool ownUpdatesAreVisible(int type) = 0; 00289 00290 virtual bool storesLowerCaseIdentifiers() = 0; 00291 00292 virtual bool storesLowerCaseQuotedIdentifiers() = 0; 00293 00294 virtual bool storesMixedCaseIdentifiers() = 0; 00295 00296 virtual bool storesMixedCaseQuotedIdentifiers() = 0; 00297 00298 virtual bool storesUpperCaseIdentifiers() = 0; 00299 00300 virtual bool storesUpperCaseQuotedIdentifiers() = 0; 00301 00302 virtual bool supportsAlterTableWithAddColumn() = 0; 00303 00304 virtual bool supportsAlterTableWithDropColumn() = 0; 00305 00306 virtual bool supportsANSI92EntryLevelSQL() = 0; 00307 00308 virtual bool supportsANSI92FullSQL() = 0; 00309 00310 virtual bool supportsANSI92IntermediateSQL() = 0; 00311 00312 virtual bool supportsBatchUpdates() = 0; 00313 00314 virtual bool supportsCatalogsInDataManipulation() = 0; 00315 00316 virtual bool supportsCatalogsInIndexDefinitions() = 0; 00317 00318 virtual bool supportsCatalogsInPrivilegeDefinitions() = 0; 00319 00320 virtual bool supportsCatalogsInProcedureCalls() = 0; 00321 00322 virtual bool supportsCatalogsInTableDefinitions() = 0; 00323 00324 virtual bool supportsColumnAliasing() = 0; 00325 00326 virtual bool supportsConvert() = 0; 00327 00328 virtual bool supportsConvert(int fromType, int toType) = 0; 00329 00330 virtual bool supportsCoreSQLGrammar() = 0; 00331 00332 virtual bool supportsCorrelatedSubqueries() = 0; 00333 00334 virtual bool supportsDataDefinitionAndDataManipulationTransactions() = 0; 00335 00336 virtual bool supportsDataManipulationTransactionsOnly() = 0; 00337 00338 virtual bool supportsDifferentTableCorrelationNames() = 0; 00339 00340 virtual bool supportsExpressionsInOrderBy() = 0; 00341 00342 virtual bool supportsExtendedSQLGrammar() = 0; 00343 00344 virtual bool supportsFullOuterJoins() = 0; 00345 00346 virtual bool supportsGetGeneratedKeys() = 0; 00347 00348 virtual bool supportsGroupBy() = 0; 00349 00350 virtual bool supportsGroupByBeyondSelect() = 0; 00351 00352 virtual bool supportsGroupByUnrelated() = 0; 00353 00354 virtual bool supportsLikeEscapeClause() = 0; 00355 00356 virtual bool supportsLimitedOuterJoins() = 0; 00357 00358 virtual bool supportsMinimumSQLGrammar() = 0; 00359 00360 virtual bool supportsMixedCaseIdentifiers() = 0; 00361 00362 virtual bool supportsMixedCaseQuotedIdentifiers() = 0; 00363 00364 virtual bool supportsMultipleOpenResults() = 0; 00365 00366 virtual bool supportsMultipleResultSets() = 0; 00367 00368 virtual bool supportsMultipleTransactions() = 0; 00369 00370 virtual bool supportsNamedParameters() = 0; 00371 00372 virtual bool supportsNonNullableColumns() = 0; 00373 00374 virtual bool supportsOpenCursorsAcrossCommit() = 0; 00375 00376 virtual bool supportsOpenCursorsAcrossRollback() = 0; 00377 00378 virtual bool supportsOpenStatementsAcrossCommit() = 0; 00379 00380 virtual bool supportsOpenStatementsAcrossRollback() = 0; 00381 00382 virtual bool supportsOrderByUnrelated() = 0; 00383 00384 virtual bool supportsOuterJoins() = 0; 00385 00386 virtual bool supportsPositionedDelete() = 0; 00387 00388 virtual bool supportsPositionedUpdate() = 0; 00389 00390 virtual bool supportsResultSetHoldability(int holdability) = 0; 00391 00392 virtual bool supportsResultSetType(int type) = 0; 00393 00394 virtual bool supportsSavepoints() = 0; 00395 00396 virtual bool supportsSchemasInDataManipulation() = 0; 00397 00398 virtual bool supportsSchemasInIndexDefinitions() = 0; 00399 00400 virtual bool supportsSchemasInPrivilegeDefinitions() = 0; 00401 00402 virtual bool supportsSchemasInProcedureCalls() = 0; 00403 00404 virtual bool supportsSchemasInTableDefinitions() = 0; 00405 00406 virtual bool supportsSelectForUpdate() = 0; 00407 00408 virtual bool supportsStatementPooling() = 0; 00409 00410 virtual bool supportsStoredProcedures() = 0; 00411 00412 virtual bool supportsSubqueriesInComparisons() = 0; 00413 00414 virtual bool supportsSubqueriesInExists() = 0; 00415 00416 virtual bool supportsSubqueriesInIns() = 0; 00417 00418 virtual bool supportsSubqueriesInQuantifieds() = 0; 00419 00420 virtual bool supportsTableCorrelationNames() = 0; 00421 00422 virtual bool supportsTransactionIsolationLevel(int level) = 0; 00423 00424 virtual bool supportsTransactions() = 0; 00425 00426 virtual bool supportsTypeConversion() = 0; /* SDBC */ 00427 00428 virtual bool supportsUnion() = 0; 00429 00430 virtual bool supportsUnionAll() = 0; 00431 00432 virtual bool updatesAreDetected(int type) = 0; 00433 00434 virtual bool usesLocalFilePerTable() = 0; 00435 00436 virtual bool usesLocalFiles() = 0; 00437 00438 virtual ResultSet *getSchemata(const std::string& catalogName = "") = 0; 00439 00440 virtual ResultSet *getSchemaObjects(const std::string& catalogName = "", 00441 const std::string& schemaName = "", 00442 const std::string& objectType = "") = 0; 00443 00444 virtual ResultSet *getSchemaObjectTypes() = 0; 00445 }; 00446 00447 00448 } /* namespace sql */ 00449 00450 #endif /* _SQL_METADATA_H_ */
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.