databases
Creates, updates, deletes, gets or lists a databases
resource.
Overview
Name | databases |
Type | Resource |
Id | google.sqladmin.databases |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The name of the database in the Cloud SQL instance. This does not include the project ID or instance name. |
charset | string | The Cloud SQL charset value. |
collation | string | The Cloud SQL collation value. |
etag | string | This field is deprecated and will be removed from a future version of the API. |
instance | string | The name of the Cloud SQL instance. This does not include the project ID. |
kind | string | This is always sql#database . |
project | string | The project ID of the project containing the Cloud SQL database. The Google apps domain is prefixed if applicable. |
selfLink | string | The URI of this resource. |
sqlserverDatabaseDetails | object | Represents a Sql Server database on the Cloud SQL instance. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | database, instance, project | Retrieves a resource containing information about a database inside a Cloud SQL instance. |
list | SELECT | instance, project | Lists databases in the specified Cloud SQL instance. |
insert | INSERT | instance, project | Inserts a resource containing information about a database inside a Cloud SQL instance. Note: You can't modify the default character set and collation. |
delete | DELETE | database, instance, project | Deletes a database from a Cloud SQL instance. |
patch | UPDATE | database, instance, project | Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics. |
update | REPLACE | database, instance, project | Updates a resource containing information about a database inside a Cloud SQL instance. |
SELECT
examples
Lists databases in the specified Cloud SQL instance.
SELECT
name,
charset,
collation,
etag,
instance,
kind,
project,
selfLink,
sqlserverDatabaseDetails
FROM google.sqladmin.databases
WHERE instance = '{{ instance }}'
AND project = '{{ project }}';
INSERT
example
Use the following StackQL query and manifest file to create a new databases
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.sqladmin.databases (
instance,
project,
charset,
collation,
etag,
name,
instance,
project,
sqlserverDatabaseDetails
)
SELECT
'{{ instance }}',
'{{ project }}',
'{{ charset }}',
'{{ collation }}',
'{{ etag }}',
'{{ name }}',
'{{ instance }}',
'{{ project }}',
'{{ sqlserverDatabaseDetails }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: charset
value: string
- name: collation
value: string
- name: etag
value: string
- name: name
value: string
- name: instance
value: string
- name: selfLink
value: string
- name: project
value: string
- name: sqlserverDatabaseDetails
value:
- name: compatibilityLevel
value: integer
- name: recoveryModel
value: string
UPDATE
example
Updates a databases
resource.
/*+ update */
UPDATE google.sqladmin.databases
SET
charset = '{{ charset }}',
collation = '{{ collation }}',
etag = '{{ etag }}',
name = '{{ name }}',
instance = '{{ instance }}',
project = '{{ project }}',
sqlserverDatabaseDetails = '{{ sqlserverDatabaseDetails }}'
WHERE
database = '{{ database }}'
AND instance = '{{ instance }}'
AND project = '{{ project }}';
REPLACE
example
Replaces all fields in the specified databases
resource.
/*+ update */
REPLACE google.sqladmin.databases
SET
charset = '{{ charset }}',
collation = '{{ collation }}',
etag = '{{ etag }}',
name = '{{ name }}',
instance = '{{ instance }}',
project = '{{ project }}',
sqlserverDatabaseDetails = '{{ sqlserverDatabaseDetails }}'
WHERE
database = '{{ database }}'
AND instance = '{{ instance }}'
AND project = '{{ project }}';
DELETE
example
Deletes the specified databases
resource.
/*+ delete */
DELETE FROM google.sqladmin.databases
WHERE database = '{{ database }}'
AND instance = '{{ instance }}'
AND project = '{{ project }}';