code: public void validateSql(String sql, CancellationSignal cancellationSignal) {
          getThreadSession().prepare(sql,
                  getThreadDefaultConnectionFlags(/* readOnly =*/ true), cancellationSignal, null);
      }
docs: Verifies that a SQL SELECT statement is valid by compiling it.
  If the SQL statement is not valid, this method will throw a {@link SQLiteException}.
  
  @param sql SQL to be validated
  @param cancellationSignal A signal to cancel the operation in progress, or null if none.
  If the operation is canceled, then {@link OperationCanceledException} will be thrown
  when the query is executed.
  @throws SQLiteException if {@code sql} is invalid