Start a shell duckdb
-- creates a new in memory table for your data
create table mydata as select * from 'myfile.csv';
-- do SQL stuff to your data
update mydata set name = 'foo' where name = 'bar';
copy (from mydata) to 'myfile_updated.csv';
Start a shell duckdb
-- creates a new in memory table for your data
create table mydata as select * from 'myfile.csv';
-- do SQL stuff to your data
update mydata set name = 'foo' where name = 'bar';
copy (from mydata) to 'myfile_updated.csv';
defmodule ParamSchema do | |
defmodule ValidationHelpers do | |
def validate_subset1(changeset, key, values) do | |
Ecto.Changeset.get_field(changeset, key) | |
|> case do | |
nil -> changeset | |
selected_values -> | |
Enum.split_with(selected_values, &Enum.member?(values, &1)) | |
|> IO.inspect(label: "hello") |
#!/usr/bin/env ruby | |
require 'date' | |
require 'time' | |
domain = ARGV[0] | |
if !domain | |
STDERR.puts "no domain given" | |
exit(-1) | |
end |
require 'bundler' | |
Bundler.setup | |
require 'sequel' | |
DB = Sequel.connect('sqlite::memory') | |
DB.create_table(:users) do | |
primary_key(:id) | |
String :name, null: false |
require 'bundler' | |
Bundler.setup | |
require 'sequel' | |
DB = Sequel.connect('sqlite::memory') | |
DB.create_table(:users) do | |
primary_key(:id) | |
String :name, null: false |
require 'dry/types' | |
module ROM | |
module Plugins | |
module Relation | |
module Schema | |
Undefined = Object.new.freeze | |
def self.included(klass) | |
super |
user system total real | |
DV: 1 thread 0.830000 0.020000 0.850000 ( 0.761257) | |
AM: 1 thread 5.880000 0.160000 6.040000 ( 5.992480) | |
DV: 2 threads 0.750000 0.010000 0.760000 ( 0.374995) | |
AM: 2 threads 5.370000 0.080000 5.450000 ( 2.780504) | |
Calculating ------------------------------------- | |
DV: 1 thread 1.000 i/100ms | |
AM: 1 thread 1.000 i/100ms |
class ApprovalsController < ApplicationController | |
def index | |
query = ApprovalQuery.new(params) | |
return render(json: {errors: query.errors.full_messages}, status: 422) unless query.valid? | |
render json: Approval.apply_query(query) | |
end | |
end | |
class ApprovalQuery < Query::Base |
/** | |
* Retrieve the posts based on query variables. | |
* | |
* There are a few filters and actions that can be used to modify the post | |
* database query. | |
* | |
* @since 1.5.0 | |
* @access public | |
* @uses do_action_ref_array() Calls 'pre_get_posts' hook before retrieving posts. | |
* |