Get sqls working with SQLite

This commit is contained in:
Radon Rosborough 2021-01-17 22:04:00 -08:00
parent 69ef6fab47
commit 423672d793
2 changed files with 17 additions and 6 deletions

View File

@ -11,9 +11,15 @@ install:
- sqlite - sqlite
riju: riju:
- sqls - sqls
files:
"/opt/sqlite/sqls.yml": |
connections:
- driver: sqlite3
dataSourceName: db.sqlite3
repl: | repl: |
sqlite3 rm -f db.sqlite3
sqlite3 db.sqlite3
input: | input: |
SELECT 123 * 234; SELECT 123 * 234;
@ -22,11 +28,12 @@ template: |
SELECT 'Hello, world!'; SELECT 'Hello, world!';
run: | run: |
sqlite3 -cmd "$(< main.sql)" rm -f db.sqlite3
sqlite3 db.sqlite3 -cmd "$(< main.sql)"
lsp: lsp:
start: | start: |
sqls sqls -config /opt/sqlite/sqls.yml
skip: skip:
- lsp - lsp

View File

@ -1,9 +1,13 @@
id: "sqls" id: "sqls"
install: install:
prepare:
apt:
- golang
manual: | manual: |
install -d "${pkg}/usr/local/bin" install -d "${pkg}/usr/local/bin"
ver="$(latest_release lighttiger2505/sqls | sed 's/^v//')" export GO111MODULE=on
wget "https://github.com/lighttiger2505/sqls/releases/download/v${ver}/sqls_${ver}_Linux_x86_64.tar.gz" -O sqls.tar.gz export GOPATH="$PWD/go"
tar -xf sqls.tar.gz -C "${pkg}/usr/local/bin" go get github.com/lighttiger2505/sqls
cp go/bin/sqls "${pkg}/usr/local/bin/"