Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
noma4i committed Aug 15, 2020
1 parent 7e73a7e commit 2b42759
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.0.0
- Added Rails5 support

## 0.2.3
- Removed pry require in runtime

Expand Down
18 changes: 9 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PATH
remote: .
specs:
ar_shard (0.2.3)
activerecord (~> 6)
ar_shard (1.0.0)
activerecord (>= 5.2, < 7)

GEM
remote: https://rubygems.org/
Expand All @@ -18,17 +18,17 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
coderay (1.1.3)
appraisal (2.3.0)
bundler
rake
thor (>= 0.14.0)
concurrent-ruby (1.1.7)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
method_source (1.0.0)
minitest (5.11.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
minitest (5.14.1)
rake (12.3.3)
sqlite3 (1.4.2)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
Expand All @@ -38,9 +38,9 @@ PLATFORMS
ruby

DEPENDENCIES
appraisal (~> 2.3)
ar_shard!
minitest (~> 5.0)
pry
rake (~> 12.0)
sqlite3 (~> 1.4)

Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# AR Shard

AR Shard is non-intrusive extenstion for ActiveRecord to add threadsafe Model based sharding or just multidatabase connection. As this gem uses connection_handlers it can work only with ActiveRecord 6 and above.
AR Shard is non-intrusive extenstion for ActiveRecord to add threadsafe Model based sharding or just multidatabase connection. As this gem uses connection_handlers it can work only with ActiveRecord version 5 and above.

## Features
- Multiple Databases support for Rails5
- Shard only part of you ActiveRecord w/o sharing connection
- Work with you Sharded Model and AR model at the same time
- Threadsafe. Battle-tested with Sidekiq and 4 mixed Databases
- Define config as a Proc. `Due to nature of connection_handlers all DB connections are established at boot time`

##Limitations
- Doesn't care about migrations
- Define config as a Proc. `Due to nature of connection_handlers all DB connections are established at boot time`
- if data structure is different between databases you should use `ModelName.reset_column_information`

## Installation

Add this line to your application’s Gemfile:

```ruby
gem 'ar_shard', '~> 0.2'
gem 'ar_shard', '~> 1.0'
```

## Usage
Expand Down Expand Up @@ -103,7 +107,7 @@ To get started with development:
git clone https://github.com/noma4i/ar_shard.git
cd ar_shard
bundle install
bundle exec rake test
bundle exec appraisal rake test
```

## License
Expand Down
9 changes: 4 additions & 5 deletions ar_shard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/noma4i/ar_shard'
spec.metadata['source_code_uri'] = spec.homepage

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end

spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_dependency 'activerecord', '>= 6'
spec.add_dependency 'activerecord', ['>= 5.2', '< 7']

spec.add_development_dependency 'pry'
spec.add_development_dependency 'sqlite3', '~> 1.4'
spec.add_development_dependency 'appraisal', '~> 2.3'
end
2 changes: 1 addition & 1 deletion lib/ar_shard/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ARShard
VERSION = "0.2.3"
VERSION = '1.0.0'
end

0 comments on commit 2b42759

Please sign in to comment.