How to run examples:
- Run $ createdb nplusonedb to create DB
- Run specs $ rspec demo.rb
How to run examples:
ActiveRecord::Migration.remove_foreign_key(:current_table, :foreign_table) # no lock | |
ActiveRecord::Migration.add_column(:current_table, :column_bigint, :bigint) # no lock | |
copy_data = lambda do | |
CurrentTable.where(column_bigint: nil).where.not(column: nil).in_batches do |batch| | |
batch.update_all("column_bigint = column") | |
end | |
end |
class GraphqlController < ApplicationController | |
include EnsureHash | |
def execute | |
result = GraphqlSchema.execute( | |
params[:query], | |
variables: ensure_hash(params[:variables]), | |
context: context, | |
operation_name: params[:operationName], | |
) |
How to run examples:
$ createdb railstestdb
to create DB$ ruby demo.rb
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "graphql" | |
end | |
class BaseObject < GraphQL::Schema::Object | |
end |
Results gathered from my MacBook Pro Mid 2014 (2,5 GHz Quad-Core Intel Core i7, 16 GB 1600 MHz DDR3)
user system total real
1 fields, 0 nested levels: 0.000153 0.000002 0.000155 ( 0.000152)
1 fields, 2 nested levels: 0.000188 0.000001 0.000189 ( 0.000187)
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strconv" | |
) | |
func getInputData() *[]int { |
I hereby claim:
To claim this, I am signing this object: