Trait proof_of_sql::base::database::DataAccessor

source ·
pub trait DataAccessor<S: Scalar>: MetadataAccessor {
    // Required method
    fn get_column(&self, column: ColumnRef) -> Column<'_, S>;
}
Expand description

Access database columns of an in-memory table span.

Prover uses this information to process a query.

In pseudo-code, here is a sketch of how DataAccessor fits in with the prove workflow:

prove(query, database) {
      if(!validate_query(query, database)) {
          // if the query references columns that don't exist
          // we should error here before going any further
          invalid-query()
      }
      update-cached-columns(database, query)
           // if the database represents an in-memory cache of an externally persisted
           // database we should update the cache so that any column referenced in the query
           // will be available
      database.reader_lock()
          // we can't be updating the database while proving
      accessor <- make-data-accessor(database)
      proof <- prove-valid-query(query, accessor)
      database.reader_unlock()
      return proof
}

Note: we assume that the query has already been validated so that we will only be accessing information about columns that exist in the database.

Required Methods§

source

fn get_column(&self, column: ColumnRef) -> Column<'_, S>

Return the data span in the table (not the full-table data)

Implementors§