Skip to content

Latest commit

 

History

History
141 lines (90 loc) · 2.39 KB

File metadata and controls

141 lines (90 loc) · 2.39 KB
title Quickstart
description Welcome to Turso Cloud! Get started in minutes.

In this quickstart you will learn how to:

  1. Install the Turso CLI
  2. Signup to Turso Cloud
  3. Create your first Turso Cloud database
  4. Connect to Database Shell

We'll be using the Turso CLI throughout this quickstart to manage databases and connect to the database shell.

brew install tursodatabase/tap/turso
curl -sSfL https://get.tur.so/install.sh | bash
curl -sSfL https://get.tur.so/install.sh | bash

The next command will open your browser to sign up:

turso auth signup
turso auth login

Turso Cloud hosts two SQLite-compatible engines: Turso, with concurrent writes and multi-user access built in, and libSQL. Create your first Turso database with the name my-db:

turso db create my-db --tursodb

To create a libSQL database instead, omit the --tursodb flag:

turso db create my-db

You can inspect your new database using the following command:

turso db show my-db

Congratulations, you created a database! Now connect to it with the shell command:

turso db shell my-db

Replace my-db with the name of your database if you named it differently.

Now create a table for `users` using SQL:
CREATE TABLE users (
  ID INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT
);

Then insert a row into the users table:

INSERT INTO users (name) VALUES ('Iku');
Finally, query for all `users`:
SELECT * FROM users;

When you're ready to move onto the next step, you'll want to to quit the shell:

.quit

You're now ready to connect your application to your database. Pick from one of the SDKs below to continue: