.$$$$$$;;;;;;;;;;;;;;;;;,,,,,, ........ ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ..,;$$$$$$$$$, ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ .,$$$$$$$$$$$$$;, ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ .'$$$$$$$$$$$$$$$$;, ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ,$$$$$$$$$$$$$$$$$$;, ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ '$$$$$$$$$$$$$$$$$$$$;, ;$$$$$$$$$$$. .$$$$$$$$$$$$$$$;'... ;$$$$$$$$$$$ .$$$$$$$$$$$$$$;.. ;$$$$$$$$$$$ .'$$$$$$$$$$$$$$;. ;$$$$$$$$$$$. ...';$$$$$$$$$$$$$$$$. ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$, ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;. ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,. ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;. ;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$;'. .$$$$$;;;;;;;;;;;;;;;;;,,,'... Downloading Linux_x86_64 ... ######################################################################## 100.0% Installing to /root/.turso Updating profile /root/.bashrc Turso will be available when you open a new terminal. If you want to make Turso available in this terminal, please run: source /root/.bashrc Turso CLI installed! If you are a new user, you can sign up with turso auth signup. If you already have an account, please login with turso auth login.
先に、Web の画面でアカウントを作ってあるので、f you already have an account, please login with turso auth login. の方で進めます。
1 2 3 4 5
$ turso auth login error: Unable to open browser. Visit this URL on this device to login: https://api.turso.io?port=40173&redirect=true Waiting for authentication...
$ turso auth login error: Unable to open browser. Visit this URL on this device to login: https://api.turso.io?port=43043&redirect=true Waiting for authentication...
✔ Success! Logged in as [github のアカウントID] ✏️ We are so happy you are here! Now that you are authenticated, it is time to create a database: turso db create
認証ができると、ブラウザは以下の表示になる。
誘導にしたがって、データベースの作成。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
$ turso db create Created database [自動生成されたDB名] in Tokyo, Japan (nrt) in 46 seconds.
You can start an interactive SQL shell with:
turso db shell [自動生成されたDB名]
To see information about the database, including a connection URL, run:
turso db show [自動生成されたDB名]
✏️ Now that you created a database, the next step is to create a replica. Why don't we try? turso db locations turso db replicate [自動生成されたDB名] [location]
また、上記ではテーブル名を指定しなかったが、指定することは可能。
1 2 3 4 5 6 7 8 9 10
$ turso db create test-db Created database test-db in Tokyo, Japan (nrt) in 39 seconds.
You can start an interactive SQL shell with:
turso db shell test-db
To see information about the database, including a connection URL, run:
turso db locations ID LOCATION ams Amsterdam, Netherlands cdg Paris, France den Denver, Colorado (US) dfw Dallas, Texas (US) ewr Secaucus, NJ (US) fra Frankfurt, Germany gru São Paulo, Brazil hkg Hong Kong, Hong Kong iad Ashburn, Virginia (US) jnb Johannesburg, South Africa lax Los Angeles, California (US) lhr London, United Kingdom maa Chennai (Madras), India mad Madrid, Spain mia Miami, Florida (US) nrt Tokyo, Japan [default] # <= これだけ青色に ord Chicago, Illinois (US) otp Bucharest, Romania scl Santiago, Chile sea Seattle, Washington (US) sin Singapore sjc Sunnyvale, California (US) syd Sydney, Australia waw Warsaw, Poland yul Montreal, Canada yyz Toronto, Canada
1 2 3 4 5 6 7 8 9 10 11
$ turso db shell [自動生成されたDB名] Connected to [自動生成されたDB名] at libsql://[自動生成されたDB名]-[github のアカウントID].turso.io
Welcome to Turso SQL shell!
Type ".quit" to exit the shell, ".tables" to list all tables, and ".schema" to show table schemas.
turso db destroy [自動生成されたDB名] Database [自動生成されたDB名], all its replicas, and data will be destroyed. Are you sure you want to do this? [y/n]: y Destroyed database [自動生成されたDB名] in 3 seconds.
# 削除したのでリストに出てこない $ turso db list NAME LOCATIONS URL