Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fortress-sdk-ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fortress-sdk-ruby

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Fortress Ruby SDK

Welcome to the Fortress Ruby SDK. This SDK provides a way for you to leverage the power of the Fortress platform in your Ruby applications.

Installation

You can install the SDK using Gem. Simply run the following command:

gem install fortress-sdk-ruby

Quick Start

Here is a quick example to get you started with the SDK:

require 'fortress'

# Initialize the client
client = Fortress::Client.new(api_key, organization_id)

# Create a new tenant
client.create_tenant("tenant_name", "alias")

# Connect to the tenant
conn = client.connect_tenant("tenant_name")

conn.exec('CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(50))')
conn.exec("INSERT INTO users (name) VALUES ('Alice')")
conn.exec('SELECT * FROM users') do |result|
  result.each do |row|
    print "User: #{row['name']}\n"
  end
end

# Delete the tenant
client.delete_tenant("tenant_name")

Documentation

Below is a list of the available functionality in the SDK. Using the SDK you can create a new tenants and point them to existing or new databases. You can also easily route data requests based on tenant names. For more detailed information, please refer to the Fortress API documentation.

Database Management:

  • create_database(database_name: str, alias: str): Creates a new database.
  • delete_database(database_name: str): Deletes to a database.
  • list_databases(): Lists all databases.
  • connect_database(database_id: str): Connects to a database and turns into SQL connection.

Tenant Management:

  • create_tenant(tenant_name: str, alias: str, database_id: str = ""): Creates a new tenant.
  • delete_tenant(tenant_name: str): Deletes a tenant.
  • list_tenants(): Lists all tenants.
  • connect_tenant(tenant_name: str): Connects to a tenant and turns into SQL connection.

Configuration

To use the SDK, generate an API key from the Fortress dashboard to initialize the client. Also, provide the organization ID, which is available under the API Keys page on the platform website.

License

This SDK is licensed under the MIT License.

Support

If you have any questions or need help, don't hesitate to get in touch with our support team at founders@fortress.build.

FAQs

Package last updated on 02 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc