Store
Store
Bases: Store[Dataset, StatementEntity]
Feature add-ons to nomenklatura.store.Store
Source code in ftmq/store/base.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
scope
property
The effective read scope: the store's explicit dataset, or all
datasets present in the backend when it was opened without one.
__init__(dataset=None, linker=None, cast_types=True, **kwargs)
Initialize a store. This should be called via
get_store
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset | str | None
|
A |
None
|
linker
|
Resolver | None
|
A |
None
|
cast_types
|
bool
|
Normalize statement values on write (see
|
True
|
Source code in ftmq/store/base.py
casting_writer(writer)
Rebless a backend writer so it casts statement values on write (see
writer). A store that builds its
writer itself has to route it through here.
Source code in ftmq/store/base.py
get_scope()
iterate(dataset=None)
Iterate all the entities, optional filter for a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
str | Dataset | None
|
|
None
|
Yields:
| Type | Description |
|---|---|
StatementEntities
|
Generator of |
Source code in ftmq/store/base.py
writer(*args, **kwargs)
The backend writer, normalizing statement values on the way in.
Values are cast into the canonical format of their property type (see
ftmq.statements); values that don't parse are
passed through unchanged (ftmq statements cast-types --drop-invalid
cleans those out of an existing dump). Disable with the store's
cast_types=False.
Source code in ftmq/store/base.py
View
Bases: View[Dataset, StatementEntity]
Feature add-ons to nomenklatura.store.base.View
Source code in ftmq/store/base.py
query(query=None)
Get the entities of a store, optionally filtered by a
Query object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
Query | None
|
The Query filter object |
None
|
Yields:
| Type | Description |
|---|---|
StatementEntities
|
Generator of |