I hereby claim:
- I am bacarini on github.
- I am bacarini (https://keybase.io/bacarini) on keybase.
- I have a public key ASAVjz3x_Du7b2LgSis67LA-ry9n2opBYDB6M2QgIvYjJwo
To claim this, I am signing this object:
require ‘sequel’ | |
module MyApp | |
class SequelDb | |
class << self | |
attr_reader :main_db, :alt_db | |
def start_connections | |
@main_db ||= establish_connection | |
@alt_db ||= establish_connection('alternative-database-name') |
before_fork do |_, _| | |
MyApp::SequelDb.disconnect_all | |
end | |
after_fork do |_, _| | |
MyApp::SequelDb.start_connections | |
end |
class Post < Sequel::Model(:posts) | |
end |
require 'sequel' | |
require_relative '../../config/initializers/sequel_init' | |
namespace :db do | |
desc 'Load the seed data from db/seeds.rb' | |
task seed: :environment do | |
require 'sequel/extensions/seed' | |
Sequel.extension :seed | |
Sequel::Seeder.apply(MyApp::SequelDb.main_db, "db/seeds") |
MyApp::SequelDb["SELECT * FROM posts WITH (NOLOCK);"].all |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner[:sequel].strategy = :transaction | |
end | |
config.before(:each) do | |
DatabaseCleaner[:sequel, {:connection => MyApp::SequelDb.main_db}].start | |
DatabaseCleaner[:sequel, {:connection => MyApp::SequelDb.alt_db}].start | |
end |
class Comment < Sequel::Model | |
set_dataset MyApp::SequelDb.alt_db[:comments] | |
end |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: n8n-deployment | |
namespace: standard | |
labels: &labels | |
app: n8n | |
component: deployment | |
spec: |