This is an optional step that seeks to simplify your usage of the APIs.
Serverless SQL Databases API
Introduction
Scaleway's Serverless SQL DB is a fully-managed and flexible service offering SQL Databases. It provides elastic scaling and a pay-per-use model, ensuring you pay only for the queries you run and storage you consume.
Designed to free you from administrative and configuration tasks, it lets you focus solely on your data and application development. We handle high availability, regular backups, and configuration.
Your database only runs when in use, hosted in our energy-efficient datacenters in Europe, reducing your carbon footprint. Data is kept securely within our regions in Paris, Amsterdam, and Warsaw. Serverless SQL DB by Scaleway is a smart choice for efficient and sustainable database management.
Concepts
Refer to our dedicated concepts page to find definitions of the different terms referring to Serverless SQL DB.
Quickstart
-
Configure your environment variables.
Noteexport SCW_ACCESS_KEY="<API access key>"export SCW_SECRET_KEY="<API secret key>"export SCW_REGION="<Scaleway region>" -
Edit the POST request payload you will use to create your Serverless SQL DB Database. Replace the parameters in the following example:
{"organization_id": "895693aa-3915-4896-8761-c2923b008be7","project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826","name": "myDB","cpu_min": 0,"cpu_max": 5}Parameter Description organization_id
Your Organization ID. It must be in UUID format. To find your Organization ID, you can consult the Scaleway console. project_id
The ID of the Project you want to create your Serverless SQL DB Database in. To find your Project ID you can list the projects or consult the Scaleway console. name
Name of the Serverless SQL DB Database cpu_min
The minimum number of CPUs units your Serverless SQL DB Database can scale down to. cpu_max
The maximum number of CPUs units your Serverless SQL DB Database can scale up to. -
Create a Database by running the following command. Make sure you include the payload you edited in the previous step.
curl -X POST \-H "X-Auth-Token: $SCW_SECRET_KEY" \"Content-Type: application/json" \https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databases \-d '{"organization_id": "895693aa-3915-4896-8761-c2923b008be7","project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826","name": "myDB","cpu_min": 0,"cpu_max": 5}' -
List your Databases.
curl -X GET \-H "Content-Type: application/json" \-H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/serverless-sqldb/v1alpha1/regions/$SCW_REGION/databasesYou should get a response like the following:
NoteThis is a response example, the UUIDs and IP address displayed are not real.
{"id": "f5122f66-fb50-4cef-aa02-487ef4fc1af0","name": "myDB","organization_id": "895693aa-3915-4896-8761-c2923b008be7","project_id": "d8e65f2b-cce9-40b7-80fc-6a2902db6826","status": "ready","endpoint": "postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB","created_at": "2019-04-19T16:24:52.591417Z","region": "fr-par"} -
Retrieve your Serverless SQL DB endpoint from the response.
NoteIn the example above, the Endpoint is
postgres://f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB
. -
Connect to your Database with the psql database client using the endpoint and one of your IAM principals:
psql postgres://<iam-principal>:<iam-api-key>@f5122f66-fb50-4cef-aa02-487ef4fc1af0.pg.sdb.fr-par.scw.cloud/myDB
Technical Information
Regions
Scaleway's infrastructure is spread across different regions and Availability Zones.
Serverless SQL DB is available in the Paris region, which is represented by the following path parameters:
fr-par
PostgreSQL specifications
Versions
Scaleway Serverless SQL DB supports PostgreSQL version 14.
Technical Limitations
User Management
- users do NOT have
SUPERUSER
norREPLICATION
privileges.
Going Further
For more information about Serverless SQL DB , you can check out the following pages:
- Serverless SQL DB Documentation
- Scaleway Slack Community join the #database channel
- Contact our support team.
Serverless SQL Databases
GET
/serverless-sqldb/v1alpha1/regions/{region}/databases
POST
/serverless-sqldb/v1alpha1/regions/{region}/databases
GET
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
PATCH
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
DELETE
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}
POST
/serverless-sqldb/v1alpha1/regions/{region}/databases/{database_id}/restore
Serverless SQL Databases Backups
GET
/serverless-sqldb/v1alpha1/regions/{region}/backups
GET
/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}
POST
/serverless-sqldb/v1alpha1/regions/{region}/backups/{backup_id}/export