public static void appendEscapedLiteral(StringBuilder buf, String str) throws SQLException {
		for (int i = 0; i < str.length(); ++i) {
			char ch = str.charAt(i);
			if (ch == '\0') {
				throw new SQLException("Zero byte in SQL string");
			}
			if (ch == '\\' || ch == '\'') {
				buf.append(ch);
			}
			buf.append(ch);
		}
	}
@param buf the string builder object
@param str the string to parse
@throws SQLException if there is a zero byte in the string
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/AbstractSQLFunctionDatabase.java