variables property

List<FoundVariable> variables
getter/setter pair

The variables that appear in the sql query. We support three kinds of sql variables: The regular "?" variables, explicitly indexed "?xyz" variables and colon-named variables. Even though this feature is not supported by sqlite directly, we provide syntax sugar for expressions like column IN ?, where the variable will have a List type at runtime and expand to the appropriate tuple (e.g. column IN (?, ?, ?) when the variable is bound to a list with three elements). To make the desugaring easier at runtime, we require that:

  1. Array arguments don't have an explicit index (<expr> IN ?1 is forbidden). The reason is that arrays get expanded to multiple variables at runtime, so setting an explicit index doesn't make sense.
  2. We only allow explicitly-indexed variables to appear after an array if their index is lower than that of the array (e.g a = ?2 AND b IN ? AND c IN ?1. In other words, we can expand an array without worrying about the variables that appear after that array.

Implementation

late List<FoundVariable> variables;