Connect with Standard Ruby
You can get started with SingleStore (formerly MemSQL) and Ruby quickly. SingleStore is wire-compliant with MySQL, meaning connecting to SingleStore is as easy as connecting to a MySQL database.
The sections below describe how to connect your application. For a complete example, including samples of CRUD operations, refer to this GitHub repo.
Prerequisites
Ruby (version 2.6.x or 3.x)
mysql2
gem
Connection Details
To connect your Ruby application to your SingleStore cluster (SingleStore DB or SingleStore Managed Service) you'll need the following:
Host: the endpoint (SingleStore Managed Service) or IP Address (SingleStore DB) for your cluster. You can find the endpoint in the SingleStore Portal.
Port: default is
3306
User:
admin
(SingleStore Managed Service) orroot
(SingleStore DB).Password
Database
Here is an example of a Ruby connection for a SingleStore Managed Service cluster:
client = Mysql2::Client.new( :host => "svc-1234ebc1-ab6f-123d-8e67-cd5d066ca0e8-ddl.aws-region-1.svc.singlestore.com", :username => "admin", :password => "<admin password>", :database => "test" )
More Information
Using Stored Procedures: GItHub