#jsonb #diesel #pg

macro diesel_as_jsonb

Use your structs as Jsonb with diesel and PG

6 releases (2 stable)

1.0.1 Nov 11, 2023
1.0.0 Jun 14, 2022
0.1.3 Dec 7, 2021
0.1.2 Nov 14, 2018

#291 in Procedural macros

Download history 270/week @ 2024-07-28 518/week @ 2024-08-04 357/week @ 2024-08-11 365/week @ 2024-08-18 121/week @ 2024-08-25 200/week @ 2024-09-01 684/week @ 2024-09-08 448/week @ 2024-09-15 417/week @ 2024-09-22 1075/week @ 2024-09-29 429/week @ 2024-10-06 559/week @ 2024-10-13 932/week @ 2024-10-20 860/week @ 2024-10-27 888/week @ 2024-11-03 968/week @ 2024-11-10

3,656 downloads per month

MIT license

4KB

Diesel As JSONB (for PG)

Usage

#[derive(AsJsonb)]]
struct Something {
    thing: String,
}

struct Wrapper {
    things: Vec<Something> // For field type Array<Jsonb>
    thing: Something // For field type Jsonb
}

Dependencies

~250–690KB
~16K SLoC