From a02cc97e0956597ef8c4c987299cea9d621a9e9a Mon Sep 17 00:00:00 2001 From: Diggory Blake Date: Tue, 30 Mar 2021 01:00:51 +0100 Subject: [PATCH] Various superficial improvements --- Cargo.toml | 3 ++- README.md | 17 +++++++++++++++-- sqlxmq_macros/Cargo.toml | 3 ++- src/lib.rs | 11 ++++++++++- src/utils.rs | 2 +- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d89000d..e3b8146 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "sqlxmq" -version = "0.1.0" +version = "0.1.1" authors = ["Diggory Blake "] edition = "2018" license = "MIT OR Apache-2.0" repository = "https://github.com/Diggsey/sqlxmq" description = "A reliable job queue using PostgreSQL as a backing store" readme = "README.md" +documentation = "https://docs.rs/sqlxmq" [workspace] members = ["sqlxmq_macros"] diff --git a/README.md b/README.md index 588e92f..cf7d70d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # sqlxmq +[![CI Status](https://github.com/Diggsey/sqlxmq/workflows/CI/badge.svg)](https://github.com/Diggsey/sqlxmq/actions?query=workflow%3ACI) +[![Documentation](https://docs.rs/sqlxmq/badge.svg)](https://docs.rs/sqlxmq) +[![crates.io](https://img.shields.io/crates/v/sqlxmq.svg)](https://crates.io/crates/sqlxmq) + A job queue built on `sqlx` and `PostgreSQL`. This library allows a CRUD application to run background jobs without complicating its @@ -104,6 +108,15 @@ present in other job queues. # Getting started +## Database schema + +This crate expects certain database tables and stored procedures to exist. +You can copy the migration files from this crate into your own migrations +folder. + +All database items created by this crate are prefixed with `mq`, so as not +to conflict with your own schema. + ## Defining jobs The first step is to define a function to be run on the job queue. @@ -167,8 +180,8 @@ async fn main() -> Result<(), Box> { The final step is to actually run a job. ```rust -example_job.new() - // This is where we override job configuration +example_job.builder() + // This is where we can override job configuration .set_channel_name("bar") .set_json("John") .spawn(&pool) diff --git a/sqlxmq_macros/Cargo.toml b/sqlxmq_macros/Cargo.toml index 67732c5..f08b152 100644 --- a/sqlxmq_macros/Cargo.toml +++ b/sqlxmq_macros/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "sqlxmq_macros" -version = "0.1.0" +version = "0.1.1" authors = ["Diggory Blake "] edition = "2018" license = "MIT OR Apache-2.0" repository = "https://github.com/Diggsey/sqlxmq" description = "Procedural macros for sqlxmq" readme = "../README.md" +documentation = "https://docs.rs/sqlxmq" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] diff --git a/src/lib.rs b/src/lib.rs index 22bc4e5..6309b9f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -105,6 +105,15 @@ //! //! # Getting started //! +//! ## Database schema +//! +//! This crate expects certain database tables and stored procedures to exist. +//! You can copy the migration files from this crate into your own migrations +//! folder. +//! +//! All database items created by this crate are prefixed with `mq`, so as not +//! to conflict with your own schema. +//! //! ## Defining jobs //! //! The first step is to define a function to be run on the job queue. @@ -196,7 +205,7 @@ //! # pool: sqlx::Pool //! # ) -> Result<(), Box> { //! example_job.builder() -//! // This is where we override job configuration +//! // This is where we can override job configuration //! .set_channel_name("bar") //! .set_json("John")? //! .spawn(&pool) diff --git a/src/utils.rs b/src/utils.rs index 6da6697..c656777 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -27,7 +27,7 @@ impl DerefMut for Opaque { } } -/// A handle to a background job which will be automatically cancelled if +/// A handle to a background task which will be automatically cancelled if /// the handle is dropped. Extract the inner join handle to prevent this /// behaviour. #[derive(Debug)]