Typescript
Reference
Detailed reference for the Fortress TSX SDK
Note: we handle connection caching for all of our SDKs.
Client
The Client
class is the main entry point for interacting with the Fortress platform. Here is a link to the Github
Initialization
Tenant actions
Tenant actions are the main way used to interact with tenant data on the Fortress platform. This is the way to guarantee that data only comes from a specific tenant. Fortress will ensure tenant isolation using this method. Once a tenant is connected, all queries will only return that tenant’s data.
Connect to a tenant
Create a tenant
- Important Note: alias_name is an optional name that you can give a specific tenant to make interacting with them easier. If it is not included in this function, the alias_name for a tenant will be just the tenant_id
- Important Note: database_id is an optional field that takes in a string. If it is included, then the tenant will be added to an existing database. If not, a new database would automatically be created for the tenant.
- Important Note: isolation_level can be either ‘shared’ or ‘dedicated’
- Important Note: platform can be either ‘aws’ or ‘managed’
Delete a tenant
- Important Note: Deleting a tenant using this will just remove the connection to the database but will not delete the data. We are working on this feature soon!
List tenants
Database actions
Database actions are used to interact with the entire database on the Fortress platform.
Create a database
- Important Note: The platform can be either ‘aws’ or ‘managed’
Delete a database
- Important Note: Deleting a database will delete all the data inside of it, but will not delete the tenant objects that are attached to it.