Skip to content

Commit ef7df66

Browse files
committed
lazysql 0.3.4 (new formula)
1 parent 15c6cc4 commit ef7df66

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Formula/l/lazysql.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Lazysql < Formula
2+
desc "Cross-platform TUI database management tool"
3+
homepage "https://github.com/jorgerojas26/lazysql"
4+
url "https://github.com/jorgerojas26/lazysql/archive/refs/tags/v0.3.4.tar.gz"
5+
sha256 "b8f725e7e3e26e4d8c90f5ce5f336f8916f9dfdeb9468736c7d8a2b3a970498c"
6+
license "MIT"
7+
8+
livecheck do
9+
url :stable
10+
regex(/^v?(\d+(?:\.\d+)+)$/i)
11+
end
12+
13+
depends_on "go" => :build
14+
uses_from_macos "sqlite" => :test
15+
16+
def install
17+
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=#{version}")
18+
end
19+
20+
test do
21+
path = testpath/"school.sql"
22+
path.write <<~SQL
23+
create table students (name text, age integer);
24+
insert into students (name, age) values ('Bob', 14);
25+
insert into students (name, age) values ('Sue', 12);
26+
insert into students (name, age) values ('Tim', 13);
27+
select name from students order by age asc;
28+
SQL
29+
30+
names = shell_output("sqlite3 test.db < #{path}").strip.split("\n")
31+
assert_equal %w[Sue Tim Bob], names
32+
33+
assert_match "terminal not cursor addressable", shell_output("#{bin}/lazysql test.db 2>&1", 1)
34+
35+
assert_match version.to_s, shell_output("#{bin}/lazysql -version 2>&1")
36+
end
37+
end

0 commit comments

Comments
 (0)