-
Notifications
You must be signed in to change notification settings - Fork 47
/
Rakefile
39 lines (31 loc) · 1020 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task default: :test
namespace :docker do
task :build do
require_relative "lib/dexter/version"
system "docker build --pull --no-cache -t ankane/dexter:latest -t ankane/dexter:v#{Dexter::VERSION} .", exception: true
end
task :release do
require_relative "lib/dexter/version"
system "docker buildx build --push --pull --no-cache --platform linux/amd64,linux/arm64 -t ankane/dexter:latest -t ankane/dexter:v#{Dexter::VERSION} .", exception: true
end
end
namespace :bench do
task :find_columns do
require "benchmark/ips"
require "dexter"
indexer = Dexter::Indexer.new({})
query = Dexter::Query.new("SELECT * FROM posts WHERE user_id = 1 ORDER BY blog_id LIMIT 1000")
Benchmark.ips do |x|
x.report("find_columns") do
indexer.send(:find_columns, query.tree)
end
end
end
end