2022-07-20
2022-07-20 本文已影响0人
wwmin_
- postgresql 判断表是否存在,存在则删除
/* 判断后删除表 */
DO
$do$
BEGIN
if( (select 1 from pg_tables
where schemaname = 'public' and tablename = 'CraftCategory')
is not null ) then
DROP TABLE "CraftCategory";
end if;
if( (select 1 from pg_tables
where schemaname = 'public' and tablename = 'CraftEntity')
is not null ) then
DROP TABLE "CraftEntity";
end if;
END
$do$
- 更新rust工具
Rust 由工具rustup
安装和管理
rustup update
// 查看cargo 版本
cargo --version
- rust换源
参考:https://course.rs/first-try/slowly-downloading.html
在$HOME/.cargo/config.toml
添加以下内容
# 选择的镜像源
# 喜欢哪个用哪个吧,没有注释掉的那个就是你选择的
#replace-with = 'ustc'
#replace-with = 'tuna'
#replace-with = 'sjtu'
#replace-with = 'rustcc'
replace-with = 'aliyun'
# 源码地址
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
# 镜像地址
# 清华大学
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
# 中国科学技术大学
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"
# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index"
# rustcc社区
[source.rustcc]
registry = "git://crates.rustcc.cn/crates.io-index"
# 阿里云
[source.aliyun]
registry = "https://code.aliyun.com/rustcc/crates.io-index"