All Projects → earaujoassis → sequel-seed

earaujoassis / sequel-seed

Licence: MIT license
A Sequel extension to make seeds/fixtures manageable like migrations

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to sequel-seed

Dry Schema
Coercion and validation for data structures
Stars: ✭ 249 (+896%)
Mutual labels:  ruby-gem
jsrand
A seeded pseudo-random number generator for JavaScript.
Stars: ✭ 19 (-24%)
Mutual labels:  seed
glimmer-dsl-opal
Glimmer DSL for Opal (Pure-Ruby Web GUI and Auto-Webifier of Desktop Apps)
Stars: ✭ 22 (-12%)
Mutual labels:  ruby-gem
crate ruby
A Ruby client library for CrateDB.
Stars: ✭ 31 (+24%)
Mutual labels:  ruby-gem
dokken-images
Minimal Docker Images for testing
Stars: ✭ 20 (-20%)
Mutual labels:  ruby-gem
rails-multi-environment-seeding
Example of using seeds in rails app
Stars: ✭ 13 (-48%)
Mutual labels:  seed
Unimidi
Realtime MIDI IO for Ruby
Stars: ✭ 229 (+816%)
Mutual labels:  ruby-gem
ui5-webcomponents-react-seed
Seed of UI5 Web Components for React
Stars: ✭ 12 (-52%)
Mutual labels:  seed
memo wise
The wise choice for Ruby memoization
Stars: ✭ 486 (+1844%)
Mutual labels:  ruby-gem
sapper-authentication-demo
A demonstration of Auth with Sapper + JWT + Server Side Rendering + RBAC
Stars: ✭ 102 (+308%)
Mutual labels:  seed
busser-rspec
Run RSpec tests through busser
Stars: ✭ 12 (-52%)
Mutual labels:  ruby-gem
sequel-pg advisory lock
Extension for ruby Sequel library that allows using PostgreSQL advisory locks for application-level mutexes.
Stars: ✭ 20 (-20%)
Mutual labels:  sequel
jekyll-extlinks
This Jekyll plugin adds custom attributes (rel="nofollow", target="_blank", etc.) to external links in your content.
Stars: ✭ 18 (-28%)
Mutual labels:  ruby-gem
gcra-ruby
Generic cell rate algorithm (leaky bucket) implementation for rate limiting
Stars: ✭ 49 (+96%)
Mutual labels:  ruby-gem
hatenablog
A Ruby gem for Hatena Blog AtomPub API
Stars: ✭ 40 (+60%)
Mutual labels:  ruby-gem
Api Fuzzer
API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities
Stars: ✭ 238 (+852%)
Mutual labels:  ruby-gem
tty-platform
Operating system detection
Stars: ✭ 28 (+12%)
Mutual labels:  ruby-gem
pixitar
🧝 Pixitar is an avatar generation library written in Ruby.
Stars: ✭ 20 (-20%)
Mutual labels:  ruby-gem
flextures
This plug-in can load and dump test data in databases, loading function is very flexible, dump function is very simple
Stars: ✭ 21 (-16%)
Mutual labels:  fixtures
javascript-seed-project
Seed project for JavaScript based apps. Just clone and code.
Stars: ✭ 17 (-32%)
Mutual labels:  seed

Sequel::Seed Gem Version Build Status codecov Codacy Badge

A Sequel extension to make seeds/fixtures manageable like migrations

Usage

Create a seed file (eg. /path/to/seeds/20150928000000_initial_seed.rb)

Sequel.seed(:development, :test) do # Applies only to "development" and "test" environments
  def run
    [
      ['USD', 'United States dollar'],
      ['BRL', 'Brazilian real']
    ].each do |abbr, name|
      Currency.create abbr: abbr, name: name
    end
  end
end

Set the environment

Sequel::Seed.setup :development

Load the extension

require 'sequel'
require 'sequel/extensions/seed'

Sequel.extension :seed

Apply the seeds/fixtures

DB = Sequel.connect(...)
Sequel::Seeder.apply(DB, "/path/to/seeds")

For more information, please check the project website.

Limitations

  • JSON and YAML files don't work with associations
  • Only timestamped seed/fixture files

What's next?

Work with Model's associations inside JSON & YAML files

Support

If you need any help (or have found any bug 🐞), please post it on /issues. Thank you!

License

MIT License © Ewerton Carlos Assis

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].