Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
textql 2.0.1 (new formula)
Browse files Browse the repository at this point in the history
Textql allows fast execution of SQL statements over text files. Supports a *nix-like interface, stdin/stdout and pipes. Avoids disk access unless requested.
  • Loading branch information
dinedal committed Dec 15, 2015
1 parent 41736dc commit 1a116cb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Library/Formula/textql.rb
@@ -0,0 +1,30 @@
require "language/go"

class Textql < Formula
desc "Executes SQL across text files"
homepage "https://github.com/dinedal/textql"
url "https://github.com/dinedal/textql/archive/2.0.1.tar.gz"
sha256 "f88daca5aa7a8898b290676d534279105e85ca41d1943408a8b97c537abb369b"

depends_on "go" => :build

go_resource "github.com/mattn/go-sqlite3" do
url "https://github.com/mattn/go-sqlite3.git",
:revision => "8897bf145272af4dd0305518cfb725a5b6d0541c"
end

def install
(buildpath + "src/github.com/dinedal/textql").install "inputs", "outputs", "storage", "sqlparser", "util", "cmd"
ENV["GOPATH"] = buildpath
Language::Go.stage_deps resources, buildpath/"src"

system "go", "build", "-ldflags", "-X main.VERSION 2.0.0", "#{buildpath}/src/github.com/dinedal/textql/cmd/textql.go"
bin.install "textql"
end

test do
version = pipe_output("#{bin}/textql --version")
assert_match /2.0.1/, version
assert_equal "3\n", pipe_output("#{bin}/textql -sql 'select count(*) from stdin'", "a\nb\nc\n")
end
end

0 comments on commit 1a116cb

Please sign in to comment.