git clone https://github.com/rom-rb/rom.git
cd rom/core
bundle install
createdb rom
ruby benchmarks/basic_bench.rb
ruby benchmarks/basic_bench.rb --jit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateStuff | |
def initialize(stuff_repo) | |
@stuff_repo = stuff_repo | |
end | |
def call(params) | |
@stuff_repo.create(params) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"name": "app", | |
"dockerComposeFile": "docker-compose.yml", | |
"service": "dev", | |
"workspaceFolder": "/usr/local/src/app", | |
"extensions": [ | |
"eamodio.gitlens", | |
"sleistner.vscode-fileutils", | |
"rebornix.Ruby", | |
"castwide.solargraph", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"options": { | |
"shell": { | |
"executable": "/usr/local/bin/zsh", | |
"args": ["-l", "-c"] | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'logger' | |
require 'byebug' | |
require 'dry/monads' | |
require 'dry/monads/do' | |
require 'dry/matcher/result_matcher' | |
module Dry | |
module Transaction | |
module Steps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dry/validation' | |
require 'dry/types' | |
require 'dry/struct' | |
module Types | |
include Dry::Types() | |
end | |
class OrderContract < Dry::Validation::Contract | |
params do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'dry/monitor/notifications' | |
module MyApp | |
def self.notifications | |
@__notifications__ ||= Dry::Monitor::Notifications.new(:my_app) | |
end | |
notifications.register_event("users.created") | |
class Logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rom' | |
require 'rom-repository' | |
require 'rom-sql' | |
require 'logger' | |
config = ROM::Configuration.new(:sql, 'sqlite::memory') | |
conn = config.gateways[:default].connection | |
conn.create_table(:users) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rom-repository' | |
require 'rom-sql' | |
require 'logger' | |
config = ROM::Configuration.new(:sql, 'sqlite::memory') | |
config.gateways[:default].connection.create_table(:songs) do | |
primary_key :id | |
column :title, String | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
******************************************************************************** | |
SEEDING 1000 users | |
SEEDING 3000 tasks | |
******************************************************************************** | |
******************************************************************************** | |
INSERTED 1000 users via ROM/Sequel | |
INSERTED 3000 tasks via ROM/Sequel | |
INSERTED 9000 tags via ROM/Sequel | |
******************************************************************************** |
NewerOlder