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

global_shared_db

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

global_shared_db

  • 0.0.9
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

GlobalSharedDb

A shared database for LINGOCHAMP

Installation

Add this line to your application's Gemfile:

gem 'global_shared_db', '0.0.9'

And then execute:

$ bundle

Or install it yourself as:

$ gem install global_shared_db

Usage

Init DB connection

GlobalSharedDb.setup({
  adapter: 'mysql2',
  host: 'localhost',
  database: 'global_shared_db',
  username: 'root',
  password: nil
})

switch connection

  GlobalSharedDb.establish_connection({host: 'localhost', database: 'xxx'})

Add rake task

如果你的项目需要对数据库做 create/migrate 操作的话, 在 Rakefile 加入如下代码

require 'global_shared_db/load_tasks'

然后就可以运行一个 global_shared_db 的 task

rake global_shared_db:create global_shared_db:migrate

Development

Create test DBs

rake db:create db:migrate

Add model

module GlobalSharedDb
  class MyModel < BaseDb
  end
end

MyModel # activerecord model

FAQs

Package last updated on 24 Jul 2018

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