美文网首页
2022-07-20

2022-07-20

作者: wwmin_ | 来源:发表于2022-07-20 10:07 被阅读0次
    1. 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$
    
    1. 更新rust工具
      Rust 由工具 rustup 安装和管理
    rustup update
    // 查看cargo 版本
    cargo --version
    
    1. 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"
    

    相关文章

      网友评论

          本文标题:2022-07-20

          本文链接:https://www.haomeiwen.com/subject/zfyeirtx.html