macro_rules! database_storage {
    (
        $(#[$attr:meta])*
        $v:vis struct $Storage:ident for $Database:ty {
            $(
                impl $TraitName:path {
                    $(
                        fn $query_method:ident() for $QueryType:path;
                    )*
                }
            )*
        }
    ) => { ... };
}
Expand description

This macro generates the “query storage” that goes into your database. It requires you to list all of the query groups that you need as well as the queries within those groups. The format looks like so:

salsa::database_storage! {
    struct MyDatabaseStorage for MyDatabase {
        impl MyQueryGroup {
            fn my_query1() for MyQuery1;
            fn my_query2() for MyQuery2;
        }
        // ... other query groups go here ...
    }
}

Here, MyDatabase should be the name of your database type. The macro will then generate a struct named MyDatabaseStorage that is used by the salsa::Runtime. MyQueryGroup should be the name of your query group.

See the hello_world example for more details.