Share via


SQLiteQueryBuilder.StrictGrammar Property

Definition

Get if the query is marked as strict, as last configured by #setStrictGrammar(boolean). -or- When enabled, verify that all untrusted SQL conforms to a restricted SQL grammar.

public virtual bool StrictGrammar { [Android.Runtime.Register("isStrictGrammar", "()Z", "GetIsStrictGrammarHandler", ApiSince=30)] get; [Android.Runtime.Register("setStrictGrammar", "(Z)V", "GetSetStrictGrammar_ZHandler", ApiSince=30)] set; }
[<get: Android.Runtime.Register("isStrictGrammar", "()Z", "GetIsStrictGrammarHandler", ApiSince=30)>]
[<set: Android.Runtime.Register("setStrictGrammar", "(Z)V", "GetSetStrictGrammar_ZHandler", ApiSince=30)>]
member this.StrictGrammar : bool with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Get if the query is marked as strict, as last configured by #setStrictGrammar(boolean).

Java documentation for android.database.sqlite.SQLiteQueryBuilder.isStrictGrammar().

Property setter documentation:

When enabled, verify that all untrusted SQL conforms to a restricted SQL grammar. Here are the restrictions applied: <ul> <li>In WHERE and HAVING clauses: subqueries, raising, and windowing terms are rejected. <li>In GROUP BY clauses: only valid columns are allowed. <li>In ORDER BY clauses: only valid columns, collation, and ordering terms are allowed. <li>In LIMIT clauses: only numerical values and offset terms are allowed. </ul> All column references must be valid as defined by #setProjectionMap(Map).

This enforcement applies to #query, #update and #delete operations. This enforcement does not apply to trusted inputs, such as those provided by #appendWhere. Any enforcement failures will throw an IllegalArgumentException.

This feature is disabled by default on each newly constructed SQLiteQueryBuilder and needs to be manually enabled.

Java documentation for android.database.sqlite.SQLiteQueryBuilder.setStrictGrammar(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to