LemmyNet/activitypub-federation-rust

Examples on how to implement Object Trait for persistent storage like Sqlite

MarcCoquand opened this issue · 1 comments

Hey! I'm trying out this crate to setup an activitypub server.

I am not too familiar with Rust and tried to implement the Object trait for my Sqlite implementation. However, I found it unclear how to best implement "DataType". My assumption is from the example

    type DataType = DbConnection;

That it should be some connection to the sql database akin to SqliteConnection in Diesel. However, SqliteConnection does not implement Clone+Share+Send, so it's not obvious to me what I should implement there for it to work. Any pointers? I looked at the examples and they seem to do it without a real database implementation, so it didn't help me too much.

You need to wrap it in Arc then.