holochain_data/dht/tx_operations/
entry.rs1use super::super::inner::entry;
4use crate::handles::{TxRead, TxWrite};
5use crate::kind::Dht;
6use holo_hash::{AgentPubKey, EntryHash};
7use holochain_integrity_types::entry::Entry;
8
9impl TxWrite<Dht> {
10 pub async fn insert_entry(&mut self, hash: &EntryHash, entry: &Entry) -> sqlx::Result<()> {
11 entry::insert_entry(self.conn_mut(), hash, entry).await
12 }
13
14 pub async fn insert_private_entry(
15 &mut self,
16 hash: &EntryHash,
17 author: &AgentPubKey,
18 entry: &Entry,
19 ) -> sqlx::Result<()> {
20 entry::insert_private_entry(self.conn_mut(), hash, author, entry).await
21 }
22}
23
24impl TxRead<Dht> {
25 pub async fn get_entry(
28 &mut self,
29 hash: EntryHash,
30 author: Option<&AgentPubKey>,
31 ) -> sqlx::Result<Option<Entry>> {
32 entry::get_entry(self.conn_mut(), hash, author).await
33 }
34}