Connecting To CockroachCloud and Importing Data

Summary

Links

In this lesson, you will learn:

  • How to download the CA certificate
  • How to find the connection string in the CockroachCloud UI
  • How to connect to a running CockroachCloud cluster with the SQL shell
  • How to run a SHOW DATABASES command in the shell
  • How to create a table using a CSV

30 Day CockroachCloud Trial Code

  • PYDEVS30

Code used

IMPORT TABLE movr.vehicles (
        id UUID PRIMARY KEY,
        last_longitude FLOAT8,
        last_latitude FLOAT8,
        battery INT8,
        last_checkin TIMESTAMP,
        in_use BOOL,
        vehicle_type STRING NOT NULL
    )
CSV DATA ('https://cockroach-university-public.s3.amazonaws.com/10000vehicles.csv')
    WITH delimiter = '|';
SHOW TABLES;
SELECT * FROM vehicles LIMIT 10;