Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@googleapis/sqladmin
Advanced tools
@googleapis/sqladmin is an npm package that provides access to the Google Cloud SQL Admin API. This API allows you to manage Cloud SQL instances, including creating, configuring, and deleting instances, as well as managing databases, users, and other resources within those instances.
Create a Cloud SQL Instance
This feature allows you to create a new Cloud SQL instance with specified settings such as tier, disk size, disk type, and region.
const {google} = require('@googleapis/sqladmin');
const sqladmin = google.sqladmin('v1beta4');
async function createInstance(auth) {
const request = {
project: 'your-project-id',
resource: {
name: 'instance-name',
settings: {
tier: 'db-f1-micro',
dataDiskSizeGb: '10',
dataDiskType: 'PD_SSD',
region: 'us-central1'
}
},
auth: auth
};
try {
const response = await sqladmin.instances.insert(request);
console.log(response.data);
} catch (err) {
console.error(err);
}
}
List Cloud SQL Instances
This feature allows you to list all Cloud SQL instances within a specified project.
const {google} = require('@googleapis/sqladmin');
const sqladmin = google.sqladmin('v1beta4');
async function listInstances(auth) {
const request = {
project: 'your-project-id',
auth: auth
};
try {
const response = await sqladmin.instances.list(request);
console.log(response.data.items);
} catch (err) {
console.error(err);
}
}
Delete a Cloud SQL Instance
This feature allows you to delete a specified Cloud SQL instance.
const {google} = require('@googleapis/sqladmin');
const sqladmin = google.sqladmin('v1beta4');
async function deleteInstance(auth) {
const request = {
project: 'your-project-id',
instance: 'instance-name',
auth: auth
};
try {
const response = await sqladmin.instances.delete(request);
console.log(response.data);
} catch (err) {
console.error(err);
}
}
Create a Database in a Cloud SQL Instance
This feature allows you to create a new database within a specified Cloud SQL instance.
const {google} = require('@googleapis/sqladmin');
const sqladmin = google.sqladmin('v1beta4');
async function createDatabase(auth) {
const request = {
project: 'your-project-id',
instance: 'instance-name',
resource: {
name: 'database-name'
},
auth: auth
};
try {
const response = await sqladmin.databases.insert(request);
console.log(response.data);
} catch (err) {
console.error(err);
}
}
List Databases in a Cloud SQL Instance
This feature allows you to list all databases within a specified Cloud SQL instance.
const {google} = require('@googleapis/sqladmin');
const sqladmin = google.sqladmin('v1beta4');
async function listDatabases(auth) {
const request = {
project: 'your-project-id',
instance: 'instance-name',
auth: auth
};
try {
const response = await sqladmin.databases.list(request);
console.log(response.data.items);
} catch (err) {
console.error(err);
}
}
The aws-sdk package provides access to AWS services, including Amazon RDS, which is similar to Google Cloud SQL. It allows you to manage RDS instances, databases, and users. Compared to @googleapis/sqladmin, aws-sdk offers a broader range of services beyond just database management.
The azure-arm-sql package provides access to Azure SQL Database management. It allows you to create, configure, and manage SQL databases and servers on Microsoft Azure. This package is similar to @googleapis/sqladmin but is specific to the Azure cloud platform.
The node-postgres package is a collection of node.js modules for interfacing with PostgreSQL databases. While it does not provide cloud-specific management features like @googleapis/sqladmin, it is useful for managing PostgreSQL databases directly.
API for Cloud SQL database instance management
$ npm install @googleapis/sqladmin
All documentation and usage information can be found on GitHub. Information on classes can be found in Googleapis Documentation.
This library is licensed under Apache 2.0. Full license text is available in LICENSE.
We love contributions! Before submitting a Pull Request, it's always good to start with a new issue first. To learn more, see CONTRIBUTING.
Crafted with ❤️ by the Google Node.js team
113.0.0 (2023-03-13)
FAQs
sqladmin
The npm package @googleapis/sqladmin receives a total of 290,267 weekly downloads. As such, @googleapis/sqladmin popularity was classified as popular.
We found that @googleapis/sqladmin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.