Commit a51a249
authored
feat: add dictionary-like access to Table and Transaction (#15)
Add support for dictionary operations on tables and transactions:
- `table[key]`, `table[key] = record`, `del table[key]`
- `pop()`, `popitem()`, `setdefault()`, `update()`
Consolidate ReadableMixin into TableMixin which provides the full
interface for both Table and Transaction classes. Register TableMixin
as a virtual MutableMapping subclass to maintain JSONLT's sorted
iteration semantics while passing isinstance checks.1 parent 8c044a7 commit a51a249
8 files changed
Lines changed: 952 additions & 258 deletions
File tree
- src/jsonlt
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 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 | + | |
124 | 152 | | |
125 | 153 | | |
126 | 154 | | |
| |||
171 | 199 | | |
172 | 200 | | |
173 | 201 | | |
174 | | - | |
| 202 | + | |
175 | 203 | | |
176 | 204 | | |
177 | 205 | | |
| |||
184 | 212 | | |
185 | 213 | | |
186 | 214 | | |
| 215 | + | |
| 216 | + | |
187 | 217 | | |
188 | 218 | | |
189 | 219 | | |
| |||
0 commit comments