IQryptSiaqodb lets you transparently make queries to Siaqodb's Document Store without explicitly encrypt/decrypt values. You can query encrypted values and get Documents through IQryptQuery class which is derived from Sqo.Documents.Query class. The following methods are overridden and they encrypt values passed before they are sent to the query parser:

  • WhereEqual
  • WhereNotEqual
  • WhereGreaterThan
  • WhereGreaterThanOrEqual
  • WhereLessThan
  • WhereLessThanOrEqual
  • WhereBetween
  • WhereIN

Example:

 IQryptSiaqodbConfigurator.EncryptTag("my_tag", EncryptionType.OPE, typeof(int));
....
 IQryptQuery query = new IQryptQuery();
            query.WhereLessThan("my_tag", 30); //30 values is encrypted first and then sent to query parser 
            var q = bucket.Find(query);
            foreach (Document o in q)
            {
                Assert.IsTrue(o.GetTag<int>("my_tag") < 30);
            }

Different encryption schemes allows different query types:

  • OPE - order preserving encryption - lets you do following types of queries:

    • WhereEqual
    • WhereNotEqual
    • WhereGreaterThan
    • WhereGreaterThanOrEqual
    • WhereLessThan
    • WhereLessThanOrEqual
    • WhereBetween
    • WhereIN
  • DET - deterministic encryption - lets you do following types of queries:

    • WhereEqual
    • WhereNotEqual
    • WhereIN
  • RND - randomized encryption - does now allow any types of queries.

You can find more information about queries on Siaqodb documentation.