#graphql #diesel #integrate #specifically #id #derive #tailored

derive-id

简单的新类型 ID,专门用于与 Async GraphQL 和 Diesel 集成

2 个不稳定版本

0.2.0 2023 年 3 月 14 日
0.1.6 2021 年 6 月 11 日

#806 in HTTP 服务器

25 每月下载次数

MIT 许可证

4KB
63

Derive ID

License Cargo Documentation

一种适合某些 NewType ID 的单尺寸 derive,专门用于与 Async GraphQL 和 Diesel 集成。特别是,这允许使用与 diesel::associations::BelongsTo 一起使用的 ID 类型。

	derive_id! {
		#[derive(Identifiable)]
		#[diesel(table_name = content)]
		#[graphql(name = "ContentID")]
		pub struct ContentId(#[diesel(column_name = "id")] i32);
	}

依赖关系

~14–26MB
~466K SLoC