For DDL it appears you can quote "" column names, but in queries (like insert it errors out?)
355339
def quote_column_name(name) #:nodoc:
      name = name.to_s
      if /^(references|integer|key|group|year)$/i =~ name
        %Q{"#{name.upcase}"}
      elsif /[A-Z]/ =~ name && /[a-z]/ =~ name
        %Q{"#{name}"}
      elsif name =~ /[\s-]/
        %Q{"#{name.upcase}"}
      elsif name =~ /^[_\d]/
        %Q{"#{name.upcase}"}
      else
        name
      end
    end
736671
public String escapeColumnName(String columnName) {
		StringBuilder sb = new StringBuilder(columnName.length() + 4);
		databaseType.appendEscapedEntityName(sb, columnName);
		return sb.toString();
	}
251148
def _invalid_docstring_quote(self, quote, row, col=None):
        
        self.add_message(
            'invalid-docstring-quote',
            line=row,
            args=(quote, TRIPLE_QUOTE_OPTS.get(self.config.docstring_quote)),
            **self.get_offset(col)
        )
459583
def as_sql(self, qn, connection=None):
        
        if self.bit:
            return ("(%s.%s | %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask),
                    [])
        return ("(%s.%s & %d)" % (qn(self.table_alias), qn(self.column), self.bit.mask),
                [])
672875
private String createInsertQuery() {
        StringBuilder query = new StringBuilder();
        query.append("insert into ").append(m_tableName)
                .append("(").append(m_propertyNames[0]);
        for (int i = 1; i < m_propertyNames.length; i++) {
            query.append(",").append(m_propertyNames[i]);
        }
        query.append(") values (?");
        for (int i = 1; i < m_propertyNames.length; i++) {
            query.append(",?");
        }
        query.append(")");
        return query.toString();
    }
773515
private String generateSQLStatementForDataInTable(
			Map<String, Set<Integer>> dataSourceToUse, String tableToWrite)
	{
		StringBuffer output = new StringBuffer();
		for (Entry<String, Set<Integer>> e : dataSourceToUse.entrySet()) {

			String curTemplateName = e.getKey();

			Set<Integer> curPageIds = e.getValue();

			//FIXME Problem - we do reuse existing ids here, but we treat template names from the pages and from revisions separately - resulting in
			if (!curTemplateName.isEmpty() && !curPageIds.isEmpty()) {
				//if template name does not have an id in the tplname-id map
				String id = "LAST_INSERT_ID()";
				if (!tplNameToTplId.containsKey(curTemplateName)) {
					output.append("INSERT INTO "
							+ GeneratorConstants.TABLE_TPLID_TPLNAME
							+ " (templateName) VALUES ('" + curTemplateName
							+ "');");
					output.append("\r\n");
				}
				else {
					//if template name has an id in the tplname-id map
					id = tplNameToTplId.get(curTemplateName).toString();
				}

				StringBuilder curValues = new StringBuilder();
				for (Integer pId : curPageIds) {
					if (curValues.length() > 0) {
						curValues.append(",");
					}
					curValues.append("(" + id + ", ");
					curValues.append(pId);
					curValues.append(")");
				}
				output.append("REPLACE INTO " + tableToWrite + " VALUES "
						+ curValues + ";");
				output.append("\r\n");

			}
		}

		return output.toString();
	}
373857
def normalize_column_name(name):
    """"""
    if not isinstance(name, six.string_types):
        raise ValueError('%r is not a valid column name.' % name)

    # limit to 63 characters
    name = name.strip()[:63]
    # column names can be 63 *bytes* max in postgresql
    if isinstance(name, six.text_type):
        while len(name.encode('utf-8')) >= 64:
            name = name[:len(name) - 1]

    if not len(name) or '.' in name or '-' in name:
        raise ValueError('%r is not a valid column name.' % name)
    return name
1103647
private void validateAndAppendColumnName(CQLTranslator translator, StringBuilder queryBuilder, String b,
            Class<?> clazz)
    {
        String dataType = CassandraValidationClassMapper.getValidationClass(clazz, true);
        translator.appendColumnName(queryBuilder, b, translator.getCQLType(dataType));
        queryBuilder.append(Constants.SPACE_COMMA);
    }
1144615
private <S extends Model> String buildInsertSQL(S model, List<Object> columnValues) {
        SQLParams sqlParams = SQLParams.builder()
                .model(model)
                .columnValues(columnValues)
                .modelClass(this.modelClass)
                .tableName(this.tableName)
                .pkName(this.primaryKeyColumn)
                .build();

        return Anima.of().dialect().insert(sqlParams);
    }
376556
def _columns_sql(self, with_namespace=False, **kwargs):
        
        return ' ({columns})'.format(
              columns=','.join(term.get_sql(with_namespace=False, **kwargs)
                               for term in self._columns)
        )
781417
private static String getColumnName(ResultSetMetaData metaData, int idx, EColumnNameCase nameCase) throws SQLException {
		String colName = metaData.getColumnName(idx);
		switch (nameCase) {
			case LOWER:
				colName = colName.toLowerCase();
				break;
			case UPPER:
				colName = colName.toUpperCase();
				break;
		}

		return colName;
	}
1252460
function quoteIdent(value) {

    if (value === undefined || value === null) {
        throw new Error('SQL identifier cannot be null or undefined');
    } else if (value === false) {
        return '"f"';
    } else if (value === true) {
        return '"t"';
    } else if (value instanceof Date) {
        return '"' + formatDate(value.toISOString()) + '"';
    } else if (value instanceof Buffer) {
        throw new Error('SQL identifier cannot be a buffer');
    } else if (Array.isArray(value) === true) {
        var temp = [];
        for (var i = 0; i < value.length; i++) {
            if (Array.isArray(value[i]) === true) {
                throw new Error('Nested array to grouped list conversion is not supported for SQL identifier');
            } else {
                temp.push(quoteIdent(value[i]));
            }
        }
        return temp.toString();
    } else if (value === Object(value)) {
        throw new Error('SQL identifier cannot be an object');
    }

    var ident = value.toString().slice(0); // create copy

    // do not quote a valid, unquoted identifier
    if (/^[a-z_][a-z0-9_$]*$/.test(ident) === true && isReserved(ident) === false) {
        return ident;
    }

    var quoted = '"';

    for (var i = 0; i < ident.length; i++) {
        var c = ident[i];
        if (c === '"') {
            quoted += c + c;
        } else {
            quoted += c;
        }
    }

    quoted += '"';

    return quoted;
}
353713
public String getInsertNamesPrepareSQL(T bean) {
        if (this.tableStrategy == null) return insertNamesPrepareSQL;
        return insertNamesPrepareSQL.replace("${newtable}", getTable(bean));
    }
88168
def quote(value, column = nil)
      if value.kind_of?(GeoRuby::SimpleFeatures::Geometry)
        "'#{value.as_hex_ewkb}'"
      else
        original_quote(value,column)
      end
    end
257949
def get_column_names(context, query):
        """"""
        table_info = context.sql_client.send(query)
        if 'fields' in table_info:
            return table_info['fields']

        return None
1177057
function validateColumns(columns) {
  if (!columns) {
    return;
  }

  // check IDs
  var ids = {};
  columns.forEach(function (column, i) {
    var id = column.id;

    if (!ids[id]) {
      ids[id] = [i];
    } else {
      ids[id].push(i);
    }
  });
  Object.keys(ids).forEach(function (id) {
    if (ids[id].length > 1) {
      console.warn('Column ID \'' + id + '\' used in multiple columns ' + ids[id].join(', '), ids[id].map(function (index) {
        return columns[index];
      }));
    }
  });
}
943696
function dbQuote($filter = array(), $join = " AND ") {
		$QUOTE_CHAR = defined('DB::USE_ANSI_SQL') ? '"' : '';

		$string = '';
		$sep = '';

		foreach ($filter as $field => $value) {
			// first break the field up into its two components
			$operator = '';
			if (is_string($field)) {
				list($field, $operator) = explode(' ', trim($field));
			}

			$value = $this->recursiveQuote($value);

			if (strpos($field, '.')) {
				list($tb, $fl) = explode('.', $field);
				$string .= $sep . $QUOTE_CHAR . $tb . $QUOTE_CHAR . '.' . $QUOTE_CHAR . $fl . $QUOTE_CHAR . " $operator " . $value;
			} else {
				if (is_numeric($field)) {
					$string .= $sep . $value;
				} else {
					$string .= $sep . $QUOTE_CHAR . $field . $QUOTE_CHAR . " $operator " . $value;
				}
			}

			$sep = $join;
		}

		return $string;
	}