Cookie消すか別ブラウザで開くと治りました
https://github.com/prisma/studio/issues/988#issuecomment-1218110765
旧プロジェクト(テーブルあり、データあり)→新プロジェクト(テーブル無し)への引っ越し作業をしたのでメモ
postgreを手元にも入れる
$OLD_DB_URL, $NEW_DB_URLにそれぞれのURLを入れておく
この際に用いるURLはURLではなくSettings->Database->Connection Stringでした
https://app.supabase.com/project/[projectid]/settings/database から確認可能です
旧プロジェクトでやること
(supabaseのSQLEditorで) ALTER ROLE postgres SUPERUSER (手元のシェルで) pg_dump --clean --if-exists --quote-all-identifiers -h $OLD_DB_URL -U postgres > dump.sql (supabaseのSQLEditorで) ALTER ROLE postgres NOSUPERUSER
新プロジェクトでやること
(supabaseのSQLEditorで) ALTER ROLE postgres SUPERUSER (手元のシェルで) psql -h $NEW_DB_URL -U postgres -f dump.sql (supabaseのSQLEditorで) ALTER ROLE postgres NOSUPERUSER
これで完了した
repo/があり、その中でprisma経由でsupabaseいじっている
supabaseにアクセスするのが面倒なのでsupabase cliを入れてみる
brew install supabase/tap/supabase supabase login # https://app.supabase.com/account/tokens に飛ばされるので、tokenを作成してコピー、貼り付けをします supabase init # supabase/config.tomlが生成されます supabase start # Studio URLへ行くとローカルにsupabaseのGUI環境が出来ています supabase link --project-ref [project-id] # linkさせる supabase remote commit # remoteの変更をローカルに適用する # この状態で http://localhost:54323/project/default へ行くとリモートのデータが含まれている # プロジェクト名は強制的にdefaultになってしまう(ここも自動で本番と同名にしてほしい...)
名前はdefaultになってしまっているがテーブルはカラムと型がついていた
親の顔より見たクラメソ様の記事
※この記事では'API URL'にアクセスとなっていますが、'Studio URL'かと思います
First implementation - Command Line Applications in Rust
Exercise for the reader: This is not the best implementation: It will read the whole file into memory – however large the file may be. Find a way to optimize it! (One idea might be to use a BufReader instead of read_to_string().)
とのことだったのでBuffReader使いました
#![allow(unused)] use clap::Parser; use std::io::BufReader; use std::fs::File; use std::io::BufRead; /// Search for a pattern in a file and display the lines that contain it. #[derive(Parser)] struct Cli { /// The pattern to look for pattern: String, /// The path to the file to read #[clap(parse(from_os_str))] path: std::path::PathBuf, } fn main() { let args = Cli::parse(); let content = File::open(&args.path).expect("could not read file"); let mut reader = BufReader::new(content); let mut line = String::new(); for line in reader.lines() { if line.as_ref().unwrap().contains(&args.pattern) { println!("{}", line.unwrap()); } } println!("path = {:?}", args.path); println!("pattern = {:?}", args.pattern); }
もっといいやり方あるかも
Rustに詳しい私のアンチの方がいたらご教示ください。
sudo apt-get install build-essential procps curl file git /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
その後Run these commandsの2つ実行
examples/docker at master · actix/examples · GitHub
をクローンして、examples/dockerの中で作業する
App Runnerのデフォルトドメインを叩いて、ローカルと同じ挙動にする
curl [デフォルトドメイン]; curl [デフォルトドメイン]/again Hello world!Hello world again!
1 ECRにactixのDockerイメージを登録(CLIで済ませる)
2 AppRunnerでECRを指定(コンソールで設定する)
actixapprunnerという名前でECRレポジトリ作成
aws ecr create-repository --repository-name actixapprunner
この結果でJSONで表示される"repositoryUri"を使います
ECRにログイン
aws ecr get-login-password --region ap-northeast-1 | docker login --username AWS --password-stdin [repositoryUri]
actixapprunnerというタグ付けでビルド
docker build -t actixapprunner .
タグの関連付け
docker tag actixapprunner:latest [repositoryUri]/:latest
push
docker push [repositoryUri]:latest
App Runnerコンソール
->リポジトリタイプ: コンテナレジストリ
->プロバイダー: Amazon ECR
->イメージURI: 作成したイメージを選択
->その他はデフォルトで作成
curl [デフォルトドメイン]; curl [デフォルトドメイン]/again Hello world!Hello world again!
雷雨の中私用で外出てから何故か鼻水が止まりません、不思議ですね。
Rustでバックエンドやりたいになっていて、Dockerのexampleを見つけました。
明日これをawsにのせていい感じにしたい。
examples/docker at master · actix/examples · GitHub
Packtでずっと気になっていたBabylon.jsの本がEarly Access可能になったのでそれも読みたい。
jsとmaintanableってタイトルから矛盾してるじゃねーか!!と思うかも知れませんが, Babylon自体はTSで書かれてるという旨も説明ありました。