From fd903395a436f4d4e59b9a37e087eb9a86db65ad Mon Sep 17 00:00:00 2001 From: Lewin Probst Date: Sun, 27 Feb 2022 11:23:32 +0100 Subject: [PATCH] docs: Updated CHANGELOG.md and documentations --- CHANGELOG.md | 13 +++++++++++++ naphtha-proc-macro/src/lib.rs | 2 ++ naphtha/src/lib.rs | 11 +++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e429568..682bf25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## v0.5.0 + +### New features + +- `diesel::Pg` connection is now implemented + +### Changes + +* Updated examples to be able to use feature flags for the database selection + ## v0.4.1 ### New features @@ -70,8 +80,11 @@ None * Added `barrel` integration for `SQLite3` * Added `SQLite3` support, backed by `diesel` + * Added an example for `SqliteConnection` + * Added possibility for `custom` queries + * Added possibility to change the model before and after updating it in the database by implementing the `DatabaseUpdateHandler` trait. ### Changes diff --git a/naphtha-proc-macro/src/lib.rs b/naphtha-proc-macro/src/lib.rs index f598ff7..94539e2 100644 --- a/naphtha-proc-macro/src/lib.rs +++ b/naphtha-proc-macro/src/lib.rs @@ -1,3 +1,5 @@ +//! This crate is a support crate that contains the necessary macros for naphtha to compile. + extern crate proc_macro; extern crate quote; diff --git a/naphtha/src/lib.rs b/naphtha/src/lib.rs index a96018d..f6cd5e6 100644 --- a/naphtha/src/lib.rs +++ b/naphtha/src/lib.rs @@ -21,13 +21,15 @@ //! * Change database on specific model in your application without the need to //! change your code. //! * Possibility to query a model from the database by using one of its member. -//! * Integrated [barrel] for writing your SQL migrations. +//! * Integrated [barrel] for writing your SQL migrations and the possibility to apply them during +//! runtime. //! * Thread safe handling of the database connection. //! //! ## Supported databases //! //! * SQlite3 (using [diesel](diesel) under the hood). //! * MySQL (using [diesel](diesel) under the hood). +//! * PostgreSQL (using [diesel](diesel) under the hood). //! //! ## Examples //! @@ -47,6 +49,7 @@ //! ### Defining a model and use database connection //! //! To create a model and its database integration, the following code is required. +//! //! *Note that this is an excerpt, see the `examples` folder in the repository for //! a full working example.* //! @@ -55,7 +58,7 @@ //! pub struct Person { //! id: i32, //! pub description: Option, - pub updated_at: NaiveDateTime, +//! pub updated_at: NaiveDateTime, //! } //! //! pub mod schema { @@ -63,7 +66,7 @@ //! persons (id) { //! id -> Int4, //! description -> Nullable, - updated_at -> Timestamp, +//! updated_at -> Timestamp, //! } //! } //! } @@ -147,7 +150,7 @@ pub use naphtha_proc_macro::model; feature = "barrel-mysql", feature = "barrel-pg" ))] -/// Re-exports the [barrel] crate including small additions required by naphtha. +/// Re-exports the [barrel] crate including small trait additions required by naphtha. pub mod barrel; mod database_impl; mod tests;