diesel-derive-more

Crates.iodiesel-derive-more
lib.rsdiesel-derive-more
version1.1.3
sourcesrc
created_at2018-02-25 00:08:55.315389
updated_at2018-04-03 06:31:04.181775
descriptionAdditional derives to use with diesel to remove some boilerplate code
homepage
repositoryhttps://github.com/behos/diesel-derive-more
max_upload_size
id52719
size13,407
Giorgos Georgiou (behos)

documentation

README

diesel-derive-more

Build Status

This package provides some helpers for working with diesel models.

Provides

  • DefaultInsertable: Creates a default struct to use as an insertable model
  • DBEnum: Allows serializing and deserializing enums for DB storage
  • Deserialization for default insertable through the 'serialization' feature

This is work in progress (created to support one of my projects) so it will continue to evolve.

Testing

Create a postgres test db and add a .env file to the root of the project pointing to that db

DATABASE_URL=postgres://dev:password@127.0.0.1/dev

Initialize the db by running:

pushd tests && diesel migration run && popd

You can run this when you make changes to the test schemas as well

Commit count: 19

cargo fmt