Registry / database / oci-mysql

oci-mysql

JSON →
library2.132.0jsnpmunverified

Official Oracle Cloud Infrastructure SDK for managing MySQL Database Service resources (DB systems, backups, channels, configurations). Current stable version is 2.132.0. Released as part of the oci-typescript-sdk monorepo, updated frequently alongside OCI API changes. Provides full TypeScript types and supports all MySQL service operations via OCI API. Differentiators: first-party Oracle SDK with comprehensive coverage of MySQL service lifecycle, authentication via API keys or instance principals, and integration with OCI IAM policies.

npm install oci-mysql
INSTALL
IMPORT
SIG · OCI-MYSQL
O
oci-mysql
databasejavascriptv2.132.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MysqlClient
✓ import { MysqlClient } from 'oci-mysql'
✗ const MysqlClient = require('oci-mysql').MysqlClient
ESM-only SDK; use named import.
MysqlDbSystem
✓ import { models } from 'oci-mysql'; const dbSystem: models.MysqlDbSystem = ...
✗ import { MysqlDbSystem } from 'oci-mysql'
All model types are under the 'models' namespace; do not import directly from package root.
CreateDbSystemDetails
✓ import { CreateDbSystemDetails } from 'oci-mysql/lib/model'
✗ import { CreateDbSystemDetails } from 'oci-mysql'
Model types are exported from 'oci-mysql/lib/model' or via 'models' namespace.

Shows how to authenticate using OCI config file and list MySQL DB systems in a compartment.

import { MysqlClient, models, requests } from 'oci-mysql'; import { common } from 'oci-common'; const provider = new common.ConfigFileAuthenticationDetailsProvider(); const client = new MysqlClient({ authenticationDetailsProvider: provider }); async function listDbSystems() { const compartmentId = process.env.COMPARTMENT_ID ?? ''; const request: requests.ListDbSystemsRequest = { compartmentId }; const response = await client.listDbSystems(request); console.log('DB systems:', response.items); } listDbSystems().catch(console.error);
Debug
Known issues
breakingPagination methods changed: list* methods no longer return paginated responses automatically; use for-await-of or manual pagination.
fix
Use async iterables: for await (const page of client.listDbSystemsPaginators(listDbSystemsRequest)) { ... }
affects: >=1.5.0
deprecatedThe global endpoint (e.g., 'https://mysql.us-phoenix-1.oci.oraclecloud.com') is deprecated; use regional endpoints or instance principal.
fix
Set endpoint via client constructor: new MysqlClient({ authenticationDetailsProvider, endpoint: 'https://mysql.us-phoenix-1.oci.oraclecloud.com' })
affects: >=2.0.0
gotchaAuthentication provider must be created before any client; common mistake is passing undefined provider.
fix
Ensure provider is initialized: const provider = new common.ConfigFileAuthenticationDetailsProvider();
affects: >=1.0.0
breakingAll request/response types moved to 'requests' and 'responses' namespaces in v2.
fix
Update imports: import { requests, responses } from 'oci-mysql';
affects: >=2.0.0
deprecatedUse of 'oci-common' SDK v1 style authentication (SimpleAuthenticationDetailsProvider) is deprecated.
fix
Use ConfigFileAuthenticationDetailsProvider or ResourcePrincipalAuthenticationDetailsProvider.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'mysql')
Client not initialized or incorrect import path for models.
fix
Ensure you import models from 'oci-mysql' and reference them as 'models.MysqlDbSystem'.
oci-common is not a constructor
Using CommonJS require() for ESM-only package.
fix
Use ESM imports: import { common } from 'oci-common';
Requested endpoint https://mysql.us-phoenix-1.oci.oraclecloud.com is not allowed
Using deprecated global endpoint; must specify region-specific endpoint.
fix
Set endpoint to regional format: 'https://mysql.us-phoenix-1.oci.oraclecloud.com' (or use default if in that region).
Missing required parameter compartmentId
Omitted compartmentId in list request.
fix
Provide compartmentId as a string in the request object.
Upgrade
Version history
2.132.0latest on npm
Audit
Dependencies
oci-commonrequiredProvides authentication, HTTP transport, and common types for all OCI SDK modules.
Agent activity
7 hits · last 30 days
node
6
Resources
oci-mysql — npm install oci-mysql · libregistry