Optionaloptions: { env?: string; host?: string; token?: string }ProtectedenvProtectedhostProtectedtokenCreate a new database connection
Supports multiple database types:
Connection configuration
Created connection details
const ratchet = new Ratchet();
// MySQL/PostgreSQL connection
await ratchet.createConnection({
id: 'users_db',
type: 'MySQL',
credentials: {
type: 'Credentials',
host: 'localhost',
dbname: 'users',
user: 'admin',
password: 'secret'
}
});
// MongoDB connection
await ratchet.createConnection({
id: 'mongo_db',
type: 'MongoDB',
credentials: {
type: 'DSN',
dsn: 'mongodb://localhost:27017/mydb'
}
});
// BigQuery connection
await ratchet.createConnection({
id: 'analytics_bq',
type: 'BigQuery',
credentials: {
type: 'ServiceAccount',
service_account_json: '{"type":"service_account",...}',
project_id: 'my-project-id'
}
});
Get a specific database connection by ID
Connection ID
Connection details including queries
Get all database connections for the current project
List of all configured ratchet connections
Inspect and execute a custom query without saving it
This allows you to test queries before saving them to a connection.
Query inspection request with connection name, query, and params
Query execution results
Execute a predefined database query
Runs a query that has been previously configured in a ratchet connection.
The query is identified by a qualified name in the format: connectionId.queryId
Qualified name of the query (format: connectionId.queryId)
Array of parameters to pass to the query
Query execution results
Test a database connection without saving it
Connection configuration to test
Success status if connection is valid
Update an existing database connection
Updated connection configuration
Success status
Base client for the platform API Classes that extend PlatformBaseClient have intentins of only working in platform context
PlatformBaseClient
Param: client
The axios instance to use for the client
Example