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

View File

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