SQL Databases - Quickstart
You may need certain IAM permissions to carry out some actions described on this page. This means:
- you are the Owner of the Scaleway Organization in which the actions will be carried out, or
- you are an IAM user of the Organization, with a policy granting you the necessary permission sets
- You have an account and are logged into the Scaleway console.
- You have signed up to the private beta and received a confirmation email.
- You have installed the psql CLI tool (built-in with PostgreSQL).
Scaleway Serverless SQL Databases are fully managed databases that automatically scale both in storage and compute according to your workloads.
This page explains how to create, access and delete a Serverless SQL Database using the Scaleway console.
How to create a database
-
Click SQL Databases in the Serverless section of the side menu. The Serverless SQL Databases page displays.
-
Click + Create database. The database creation wizard displays.
-
Complete the following steps in the wizard:
- Choose a region, which is the geographical location in which your database will be created.
- Select a default engine version from the drop-down menu.
- Configure your database autoscaling, or keep the default values. Your database will scale within the defined range to match the incoming load.
Note:Define a minimum of 1 vCPU or more to avoid cold starts that can take a few seconds.
- Enter a name for your database, or keep the randomly-generated name. The name must only contain alphanumeric characters and dashes.
- Verify the estimated cost.
-
Click Create database to finish. The setting up of your database will take a few seconds. Check the Overview tab to see its status.
How to connect to a database
-
From the Overview tab of your database, click the Set up credentials button. The setup wizard displays.
-
Select yourself as the principal to connect to the database.
Note:Refer to the IAM documentation for more information on identities and access rights.
-
Set up the Connection string:
- If you already have a secret key, replace the
[INSERT_SECRET_KEY_HERE]
placeholder with your key. - If you do not have a secret key, click Generate new secret key.
- If you already have a secret key, replace the
-
Copy your connection string and store it securely.
-
Run the following command in a terminal:
psql "[YOUR_CONNECTION_STRING]"An output similar to the following response displays:
psql (15.3, server 14.8 (Debian 14.8-1pgsg120+1))SSL connection (protocol: TLSv1.3, cipher: TLS_AES_128_GCM_SHA256, compression: off)Type "help" for help. -
Run the following command to see the version of your Serverless SQL Database:
SELECT version ();An output similar to the following displays:
PostgreSQL 14.8 (Debian 14.8-1.pgdg120+1) on x86_64-pc-linux-gnu,compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit -
Press
q
to quit the version overview.
You can now perform the authorized actions in the database.
How to delete a database
-
Click SQL Databases in the Serverless section of the side menu. The Serverless SQL Databases page displays.
-
Click the «See more Icon» icon next to the database you want to delete, and select Delete from the drop-down menu. A pop-up displays.
-
Type DELETE, then click Delete database.
- You can also delete a database from its Overview tab.
- You can delete several databases by selecting the appropriate items from the SQL databases section and clicking the icon.