3 个不稳定版本
0.1.0 | 2021 年 9 月 17 日 |
---|---|
0.0.2 | 2021 年 9 月 17 日 |
0.0.1 | 2021 年 9 月 17 日 |
#25 in #create-file
9KB
75 行
compile-time-create-file
使用 Rust 中的过程宏在编译时创建文件和目录。
示例
use compile_time_create_file::create_file;
create_file!(
"migrations/users.sql",
"create table if not exists users (
id serial,
username varchar(128) not null,
password varchar(512) not null,
email varchar(256) not null,
enabled boolean not null default true
);
"
);
安装
在你的开发依赖项中添加 compile-time-create-file = "0.0.1"
[dev-dependencies]
compile-time-create-file = "0.0.1"
依赖项
~1.5MB
~35K SLoC