Scaleway logo
Managed Database for PostgreSQL and MySQL API

Privileges are permissions that can be granted to database users. You can manage user permissions either via the console, the Scaleway APIs or SQL. Managed Database for PostgreSQL and MySQL provides a simplified and unified permission model through the API and the console to make things easier to manage and understand.

Each user has associated permissions that give them access to zero or more logical databases. These include:

  • None: No access to the database
  • Read: Allow users to read tables and fields in a database
  • Write: Allow users to write content in databases.
  • Admin: Read and write access to the data, and extended privileges depending on the database engine.

List user privileges for a database

GET
https://api.scaleway.com
/rdb/v1/regions/{region}/instances/{instance_id}/privileges

List privileges of a user on a database. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as database_name and user_name.

List user privileges for a database › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
instance_id
​string · required

UUID of the Database Instance.

List user privileges for a database › query Parameters

order_by
​scaleway.rdb.v1.ListPrivilegesRequest.OrderBy · enum

Criteria to use when ordering privileges listing.

Enum values:
user_name_asc
user_name_desc
database_name_asc
database_name_desc
Default: user_name_asc
page
​google.protobuf.Int32Value · int32
page_size
​integer · uint32
database_name
​string

Name of the database.

user_name
​string

Name of the user.

List user privileges for a database › Responses

200
​scaleway.rdb.v1.Privilege[]

Privileges of a user in a database in a Database Instance.

total_count
​integer · uint32

Total count of privileges present on a database.


Set user privileges for a database

PUT
https://api.scaleway.com
/rdb/v1/regions/{region}/instances/{instance_id}/privileges

Set the privileges of a user on a database. You must define database_name, user_name and permission in the request body.

Set user privileges for a database › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
instance_id
​string · required

UUID of the Database Instance.

Set user privileges for a database › Request Body

database_name
​string

Name of the database.

user_name
​string

Name of the user.

permission
​scaleway.rdb.v1.Permission · enum

Permission to set (Read, Read/Write, All, Custom).

Enum values:
readonly
readwrite
all
custom
none
Default: readonly

Set user privileges for a database › Responses

200
permission
​scaleway.rdb.v1.Permission · enum

Permission (Read, Read/Write, All, Custom).

Enum values:
readonly
readwrite
all
custom
none
Default: readonly
database_name
​string

Name of the database.

user_name
​string

Name of the user.