Expand description
§🐬 dorsal
Dorsal is the backbone server structure of Stellular projects! It contains the base SQL helper modules and basic server helpers that make projects supporting sqlite, mysql, and postgresql easy to start and expand.
- Server crate located in
src/ - Example/template project located in
dorsal_example/
The Dorsal example also includes support for the user authentication base that is provided by Guppy, however this is not required.
§Usage
Add the package as a dependency:
cargo add dorsalYou can then model after the template project.
§Template Only
You can clone only the dorsal_example/ directory with the command below:
PROJECT_NAME="dorsal_example" &&
git clone --depth=1 https://github.com/stellularorg/dorsal $PROJECT_NAME &&
cd $PROJECT_NAME &&
git sparse-checkout set --no-cone dorsal_example &&
mv dorsal_example ../tmpdex &&
cd ../ &&
sudo rm -r $PROJECT_NAME &&
mv ./tmpdex $PROJECT_NAME &&
cd $PROJECT_NAMERe-exports§
pub use db::cachedb::CacheDB;pub use db::db::DefaultReturn;pub use db::db::StarterDatabase;pub use db::special::auth_db::AuthDatabase;pub use db::special::log_db::LogDatabase;pub use db::special::notification_db::Notification;pub use db::special::notification_db::NotificationDatabase;pub use db::sql::DatabaseOpts;pub use config::collect_arguments;pub use config::get_named_argument;pub use config::get_var;
Modules§
Macros§
- query
- Statically checked SQL query with
println!()style syntax.
Functions§
- query
- Execute a single SQL query as a prepared statement (transparently cached).