getStore
The getStore
method returns a reference to the underlying Store
that is backing this Queries
object.
getStore(): Store
Example
This example creates a Queries
object against a newly-created Store
and then gets its reference in order to update its data.
import {createQueries, createStore} from 'tinybase';
const queries = createQueries(createStore());
queries.setQueryDefinition('dogColors', 'pets', ({select, where}) => {
select('color');
where('species', 'dog');
});
queries
.getStore()
.setRow('pets', 'fido', {species: 'dog', color: 'brown'});
console.log(queries.getResultTable('dogColors'));
// -> {fido: {color: 'brown'}}
Since
v2.0.0