Get extractor rule definition file name.

@param rootDir root dir
@param databaseType database type
@return extractor rule definition file name
190863
public static String getFillerRuleDefinitionFileName(final String rootDir, final DatabaseType databaseType) {
        return Joiner.on('/').join(rootDir, databaseType.name().toLowerCase(), FILLER_DEFINITION_FILE_NAME);
    }
666225
public String extractType(XAttribute attribute) {
		XAttribute attr = attribute.getAttributes().get(KEY_TYPE);
		if (attr == null) {
			return null;
		} else {
			return ((XAttributeLiteral) attr).getValue();
		}
	}
422393
public BaseDatabase makeDatabase(int iDatabaseType)
    {
        BaseDatabase database = null;
        String strDbPrefix = this.getDatabasePrefix(iDatabaseType);

        if (strDbPrefix != null) if (strDbPrefix.indexOf('.') == -1)
            strDbPrefix = DBConstants.ROOT_PACKAGE + "base.db." + strDbPrefix.toLowerCase() + "." + strDbPrefix + "Database";
        database = (BaseDatabase)ClassServiceUtility.getClassService().makeObjectFromClassName(strDbPrefix);
        if (database == null)
            database = new BaseDatabase();  // default
        return database;
    }
700223
public static DatabaseType getDatabaseType(final String url) {
        switch (getDriverClassName(url)) {
            case "com.mysql.cj.jdbc.Driver":
            case "com.mysql.jdbc.Driver":
                return DatabaseType.MySQL;
            case "org.postgresql.Driver":
                return DatabaseType.PostgreSQL;
            case "oracle.jdbc.driver.OracleDriver":
                return DatabaseType.Oracle;
            case "com.microsoft.sqlserver.jdbc.SQLServerDriver":
                return DatabaseType.SQLServer;
            case "org.h2.Driver":
                return DatabaseType.H2;
            default:
                throw new ShardingException("Cannot resolve JDBC url `%s`", url);
        }
    }
393320
public static String fileTypeAsString( int fileType ) {

		String result;
		switch( fileType ) {
		case AGGREGATOR:
			result = "aggregator";
			break;

		case GRAPH:
			result = "graph";
			break;

		case INSTANCE:
			result = "intsnace";
			break;

		case UNDETERMINED:
			result = "undetermined";
			break;

		default:
			result = "unknown";
			break;
		}

		return result;
	}
1330056
function loadValidator (resourceName, rootDir, objectType, logger) {
  const schemaName = (objectType !== 'Resource')
    ? `${kebabCase(objectType)}-schema`
    : 'schema'

  for (const [schemaType, validatorLoader] of Object.entries(schemaTypes)) {
    const schemaFile = path.resolve(rootDir, `${schemaName}.${schemaType}`)
    if (fs.existsSync(schemaFile)) {
      try {
        return validatorLoader(schemaFile)
      } catch (err) {
        logger.error(`Couldn't load ${objectType} schema for ${resourceName}:\n  ${err.message}`)
        return null
      }
    } // if ...
  } // for ...

  return null
}
988090
private JdbcType lookupJdbcType()
    {
        JdbcType result = null;
        String columnType = getColumnType();
        // if sql type was not set in metadata we use reflection
        // to determine sql type by reflection
        if (columnType == null)
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByReflection(m_PersistentField.getType().getName());
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't automatically assign a jdbc field-type for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        else
        {
            try
            {
                result = JdbcTypesHelper.getJdbcTypeByName(columnType);
            }
            catch(Exception e)
            {
                String eol = SystemUtils.LINE_SEPARATOR;
                throw new OJBRuntimeException("Can't assign the specified jdbc field-type '"+columnType+"' for field: "
                        + eol + this.toXML() + eol + "in class: " + eol + getClassDescriptor(), e);
            }
        }
        return result;
    }
1126057
private static String getDataBasePath(String dbName) {
        if(dbName.startsWith("file://")) {
            return new File(URI.create(dbName)).getAbsolutePath();
        } else {
            return new File("target/test-resources/dbH2" + dbName).getAbsolutePath();
        }
    }
842490
public DatabaseType getDatabaseType() {
        if (lexer instanceof H2Lexer) {
            return DatabaseType.H2;
        }
        if (lexer instanceof MySQLLexer) {
            return DatabaseType.MySQL;
        }
        if (lexer instanceof OracleLexer) {
            return DatabaseType.Oracle;
        }
        if (lexer instanceof SQLServerLexer) {
            return DatabaseType.SQLServer;
        }
        if (lexer instanceof PostgreSQLLexer) {
            return DatabaseType.PostgreSQL;
        }
        throw new UnsupportedOperationException(String.format("Cannot support lexer class: %s", lexer.getClass().getCanonicalName()));
    }
1158396
@Override
	public String getType(final Uri uri) {
		final String name = getDatasetOrThrowException(uri).getClass().getName();
		final String type = String.format("vnd.android.cursor.dir/%s", name);
		return type.toLowerCase(Locale.getDefault());
	}
339865
public SemanticType extractFieldType(SemanticType.Record type, Identifier field) {
		if (type == null) {
			return null;
		} else {
			SemanticType fieldType = type.getField(field);
			if (fieldType == null) {
				// Indicates an invalid field selection
				syntaxError(field, INVALID_FIELD);
			}
			return fieldType;
		}
	}
290219
public static DatabaseStructureType getDatabaseType(WorkspaceEntry wsConfig) throws RepositoryConfigurationException
   {
      try
      {
         if (wsConfig.getContainer().getParameterBoolean("multi-db"))
         {
            return JDBCDataContainerConfig.DatabaseStructureType.MULTI;
         }
         else
         {
            return JDBCDataContainerConfig.DatabaseStructureType.SINGLE;
         }
      }
      catch (Exception e)
      {
         String dbStructureType =
            wsConfig.getContainer().getParameterValue(JDBCWorkspaceDataContainer.DB_STRUCTURE_TYPE).toUpperCase();
         return JDBCDataContainerConfig.DatabaseStructureType.valueOf(dbStructureType);
      }
   }
104497
private void extractRules(RuleSource ruleSource, Collection<?> blocks, RuleSetBuilder builder) throws RuleException {
        for (Object element : blocks) {
            if (element instanceof AbstractBlock) {
                AbstractBlock block = (AbstractBlock) element;
                if (EXECUTABLE_RULE_TYPES.contains(block.getRole())) {
                    extractExecutableRule(ruleSource, block, builder);
                } else if (GROUP.equals(block.getRole())) {
                    extractGroup(ruleSource, block, builder);
                }
                extractRules(ruleSource, block.getBlocks(), builder);
            } else if (element instanceof Collection<?>) {
                extractRules(ruleSource, (Collection<?>) element, builder);
            }
        }
    }
735102
private static DatabaseType getDatabaseType(String dbtype) {
    if (dbtype.equals("h2"))
      return DatabaseType.H2;
    else if (dbtype.equals("oracle"))
      return DatabaseType.ORACLE;
    else if (dbtype.equals("mysql"))
      return DatabaseType.MYSQL;
    else
      throw new DukeConfigException("Unknown database type: '" + dbtype + "'");
  }
500933
def GetRootFileEntry(self):
    
    path_spec = sqlite_blob_path_spec.SQLiteBlobPathSpec(
        table_name=self._path_spec.table_name,
        column_name=self._path_spec.column_name,
        parent=self._path_spec.parent)
    return self.GetFileEntryByPathSpec(path_spec)
699566
def _get_dbal_column_type(self, type_):
        
        type_ = type_.lower()

        if type_ == "enum":
            return "string"

        return super(PostgresSchemaGrammar, self)._get_dbal_column_type(type_)
226466
def _get_dbal_column_type(self, type_):
        
        type_ = type_.lower()

        if type_ == "enum":
            return "string"

        return super(SQLiteSchemaGrammar, self)._get_dbal_column_type(type_)