Loading tutorials
WHERE, ORDER BY and LIMIT. It also assumes you know Apex classes, collections and sObjects, and that you know sharing and field-level security (FLS) exist. It covers how the two core dynamic query methods behave: what they return, how they re6 min readDatabase.query does and why concatenating user input into a query string is dangerous. The previous chapter showed the attack. This chapter shows the main fix.6 min readDatabase.queryWithBinds, the method that takes bind values from a map instead of from local variables. It assumes you can read and write Apex classes, static SOQL with WHERE, ORDER BY and LIMIT, and Apex collections. It also assumes you know that bind variables keep user 6 min readWHERE, ORDER BY and LIMIT, and that you have seen Database.query and bind variables in the earlier chapters. Here you learn to convert user-supplied text into real Apex types before it reaches a query, and where that conversio5 min readWHERE and LIMIT, and that you know why bind variables stop SOQL injection. The previous chapters covered both. Here the concern is different. A bind variable keeps input from changing the structure of a query, but it does not stop the input fro6 min readDatabase.query is dangerous. It also assumes you know that bind variables fix value injection. Here you handle the parts of a query that a bind variabl5 min readDatabase.query and bind variables from earlier chapters. You should also know that field-level security (FLS) controls which fields a user may read.7 min readDatabase.query. It also assumes you have seen a SOQL injection (an attacker changing the structure of your query through input) and the bind-variable fix from the earlier chapters. Here you will learn what `Str5 min readDatabase.query, bind variables and allowlisting.6 min read@IsTest and @TestSetup. It also assumes you know the defenses from the earlier chapters: bind variables, Database.queryWithBinds, allowlists, Schema describe checks and user mode. Here you will turn those defenses into automated tests t6 min read