Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Multi tenant instance updated

g.sys.system.multiTenantInstanceUpdated calls the multi tenant instance updated system API from your code, whatever the settings of that API say about HTTP callers.

Multi tenant instance updated System API

After the connection string of a tenant of a multi-tenant instance changed in the tenants table, tell API Maker. Every server drops the connection pools of that tenant, and the next request of the tenant connects with the new connection string.

await g.sys.system.multiTenantInstanceUpdated({ instanceName: 'crm', username: 'acme' });

Several instances or tenants at once, each item answered on its own:

1
2
3
4
5
const output = await g.sys.system.multiTenantInstanceUpdated([
    { instanceName: 'crm', username: 'acme' },
    { instanceName: 'billing', username: 'acme' },
]);
// [{ success: true, data: true }, { success: false, data: false, error: { code: 404, message: "..." } }]