Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29071f0

Browse files
committed
store: Prepare to have two dynds implementations
1 parent 363f4a0 commit 29071f0

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

store/postgres/src/dynds/mod.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
mod shared;
2+
// mod private;
3+
4+
use crate::primary::Site;
5+
use diesel::PgConnection;
6+
use graph::{
7+
blockchain::BlockPtr,
8+
components::store::StoredDynamicDataSource,
9+
prelude::{BlockNumber, DeploymentHash, StoreError},
10+
};
11+
12+
pub fn load(
13+
conn: &PgConnection,
14+
id: &str,
15+
block: BlockNumber,
16+
) -> Result<Vec<StoredDynamicDataSource>, StoreError> {
17+
shared::load(conn, id, block)
18+
}
19+
20+
pub(crate) fn insert(
21+
conn: &PgConnection,
22+
deployment: &DeploymentHash,
23+
data_sources: &[StoredDynamicDataSource],
24+
block_ptr: &BlockPtr,
25+
) -> Result<usize, StoreError> {
26+
shared::insert(conn, deployment, data_sources, block_ptr)
27+
}
28+
29+
pub(crate) fn copy(
30+
conn: &PgConnection,
31+
src: &Site,
32+
dst: &Site,
33+
target_block: &BlockPtr,
34+
) -> Result<usize, StoreError> {
35+
shared::copy(conn, src, dst, target_block)
36+
}
37+
38+
pub(crate) fn revert(
39+
conn: &PgConnection,
40+
id: &DeploymentHash,
41+
block: BlockNumber,
42+
) -> Result<(), StoreError> {
43+
shared::revert(conn, id, block)
44+
}
45+
46+
pub(crate) fn drop(conn: &PgConnection, id: &DeploymentHash) -> Result<usize, StoreError> {
47+
shared::drop(conn, id)
48+
}
File renamed without changes.

0 commit comments

Comments
 (0)