You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database interactions are managed through multiple gateways, including [cache](./src/postgres/cache.rs), [chain](./src/postgres/chain.rs), [contract](./src/postgres/contract.rs), [extraction_state](./src/postgres/extraction_state.rs) and [protocol](./src/postgres/protocol.rs).
20
+
Database interactions are managed through multiple gateways,
21
+
including [cache](./src/postgres/cache.rs), [chain](./src/postgres/chain.rs), [contract](./src/postgres/contract.rs), [extraction_state](./src/postgres/extraction_state.rs)
22
+
and [protocol](./src/postgres/protocol.rs).
20
23
21
-
The CachedGateway serves as the main entry point for all database communications. It is designed to efficiently manage and execute database operations by utilizing an in-memory cache and ensuring data consistency through transactional writes. Writes are batched and deduplicated to improve performance and reduce load on the database.
24
+
The CachedGateway serves as the main entry point for all database communications. It is designed to efficiently manage
25
+
and execute database operations by utilizing an in-memory cache and ensuring data consistency through transactional
26
+
writes. Writes are batched and deduplicated to improve performance and reduce load on the database.
22
27
23
28
### Versioning
24
29
25
-
Tycho employs a robust versioning system to track historical data within the database. The [versioning](./src/postgres/versioning.rs) module provides tools to handle historical data, ensuring that each version of an entity is tracked and stored appropriately.
30
+
Tycho employs a robust versioning system to track historical data within the database.
31
+
The [versioning](./src/postgres/versioning.rs) module provides tools to handle historical data, ensuring that each
32
+
version of an entity is tracked and stored appropriately.
26
33
27
34
#### Key Concepts
28
-
- VersionedRow: A trait for structs that can be inserted into a versioned table. It automates the valid_to attribute management, facilitating batch insertions.
29
35
30
-
- DeltaVersionedRow: Similar to VersionedRow, but also handles setting previous_value attributes, allowing for more complex versioning scenarios.
36
+
- VersionedRow: A trait for structs that can be inserted into a versioned table. It automates the valid_to attribute
37
+
management, facilitating batch insertions.
31
38
32
-
- StoredVersionedRow: A trait that enables setting the end version on currently active rows in the database based on new incoming entries. It's essential for ensuring that historical data is correctly marked as outdated when new versions are inserted.
39
+
- DeltaVersionedRow: Similar to VersionedRow, but also handles setting previous_value attributes, allowing for more
40
+
complex versioning scenarios.
41
+
42
+
- StoredVersionedRow: A trait that enables setting the end version on currently active rows in the database based on new
43
+
incoming entries. It's essential for ensuring that historical data is correctly marked as outdated when new versions
Currently Tycho exposes a single special [test-group](https://nexte.st/book/test-groups.html) via nextest:
120
140
121
-
1.`test(serial-db)`: These are tests against the database that need to commit data. To not intefere with other test that require a empty db but do not commit, we run these tests separately. Most of these tests use the `run_against_db` test harness. Test within that group are run sequentially, the remaining tests run in parallel. To add a test to this group simply ensure its name or its test package name includes the string `serial_db`.
141
+
1.`test(serial-db)`: These are tests against the database that need to commit data. To not intefere with other test
142
+
that require a empty db but do not commit, we run these tests separately. Most of these tests use
143
+
the `run_against_db` test harness. Test within that group are run sequentially, the remaining tests run in parallel.
144
+
To add a test to this group simply ensure its name or its test package name includes the string `serial_db`.
122
145
123
-
If your test does not require committing to the database and has no special resource requirements, create the test as usual.
146
+
If your test does not require committing to the database and has no special resource requirements, create the test as
0 commit comments