Skip to content

Commit 78ff09f

Browse files
authored
1 parent e9f263f commit 78ff09f

33 files changed

+2714
-1774
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{{- $repourl := $.Info.RepositoryURL -}}
2+
3+
{{ range .CommitGroups -}}
4+
## {{ .Title }}
5+
6+
{{ range .Commits -}}
7+
{{- /** Remove markdown urls when there's a pull request linked and replace it with a tag **/ -}}
8+
{{- $subject := (regexReplaceAll `URL` (regexReplaceAll `\[(.*)(\d\d)\]\(.*?\)` .Subject "<a href=\"URL/pull/${2}\">${1}${2}</a>") $repourl) -}}
9+
{{- /** Filter out refs mentioned in the title **/ -}}
10+
{{- $list := (list) -}}
11+
{{- range $idx, $ref := .Refs -}}
12+
{{- if not (regexMatch $ref.Ref $subject) -}}
13+
{{ $list = append $list $ref }}
14+
{{- end -}}
15+
{{- end -}}
16+
{{- /** end custom varaibles **/ -}}
17+
18+
{{ if .TrimmedBody -}}<dl><dd><details><summary>{{ else -}}- {{ end -}}
19+
<a href="{{$repourl}}/commit/{{.Hash.Long}}"><tt>{{.Hash.Short}}</tt></a> {{ $subject }}
20+
{{- if $list -}}
21+
{{ printf " %s " "(closes"}}
22+
{{- range $idx, $ref := $list -}}{{ if $idx }}, {{ end -}}
23+
<a href="{{ $repourl }}/issues/{{ $ref.Ref}}"> #{{ $ref.Ref}}</a>{{ end }})
24+
{{- end -}}
25+
{{ if .TrimmedBody -}}</summary>{{ printf "\n\n%s\n\n" .TrimmedBody }}</details></dd></dl>{{ end }}
26+
27+
{{ end }}
28+
{{ end }}
29+
30+
{{- if .RevertCommits -}}
31+
### Reverts
32+
33+
{{ range .RevertCommits -}}
34+
* {{ .Revert.Header }}
35+
{{ end }}
36+
{{ end -}}
37+
38+
{{- if .NoteGroups -}}
39+
{{ range .NoteGroups -}}
40+
### {{ .Title }}
41+
42+
{{ range .Notes }}
43+
{{ .Body }}
44+
{{ end }}
45+
{{ end -}}
46+
{{ end -}}
47+
{{ end -}}

β€Ž.github/chglog/CHANGELOG.tpl.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $repourl }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }}
66

7-
> {{ datetime "2006-01-02" .Tag.Date }}
8-
97
{{ range .CommitGroups -}}
108
### {{ .Title }}
119

β€Ž.github/workflows/changelog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Generator Changelog
22

33
on:
44
schedule:
5-
- cron: "0 8 */2 * *"
5+
- cron: "0 8 */1 * *"
66

77
jobs:
88
build-sources:
@@ -35,7 +35,7 @@ jobs:
3535
env:
3636
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3737
COMMIT_MSG: |
38-
:card_file_box: update CHANGELOG.md
38+
:card_file_box: update changelog
3939
run: |
4040
git config --global user.name "github-actions[bot]"
4141
git config --global user.email "github-actions[bot]@users.noreply.github.com"

β€Ž.github/workflows/docgen.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name: Generate docs
2-
32
on: push
4-
53
jobs:
64
build-sources:
75
name: Generate docs
@@ -41,13 +39,13 @@ jobs:
4139
- name: Generating docs
4240
run: |
4341
export PATH="${PWD}/build/:${PATH}"
44-
make docgen
42+
make gen_nvimhelp
4543
# inspired by nvim-lspconfigs
4644
- name: Update documentation
4745
env:
4846
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4947
COMMIT_MSG: |
50-
:card_file_box: Update doc/sql.txt
48+
:card_file_box: update doc/sqlite.txt
5149
run: |
5250
git config --global user.name "github-actions[bot]"
5351
git config --global user.email "github-actions[bot]@users.noreply.github.com"

β€Ž.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# name: Create Release
2+
# on:
3+
# push:
4+
# tags: ["v*"]
5+
# jobs:
6+
# release:
7+
# if: github.event.base_ref == 'refs/heads/master' # not sure, maybe not
8+
# runs-on: ubuntu-20.04
9+
# container:
10+
# image: golang:1.16
11+
# steps:
12+
# -
13+
# name: Check out a copy of the repo
14+
# uses: actions/checkout@v2
15+
# with: { fetch-depth: 0 }
16+
# -
17+
# run: date +%F > todays-date
18+
# -
19+
# name: Restore cache for today's nightly.
20+
# uses: actions/cache@v2
21+
# with:
22+
# path: build
23+
# key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}
24+
# -
25+
# name: Show Tag
26+
# id: tag
27+
# run: echo ::set-output name=TAG::${GITHUB_REF##*/}
28+
# -
29+
# name: Install required utils
30+
# run: |
31+
# apt-get update
32+
# apt-get -y install luarocks
33+
# go get github.com/git-chglog/git-chglog/cmd/git-chglog
34+
# -
35+
# name: Setup Environment
36+
# run: |
37+
# test -d build || {
38+
# mkdir -p build
39+
# wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
40+
# chmod +x nvim.appimage
41+
# ./nvim.appimage --appimage-extract
42+
# mv ./squashfs-root/usr/bin/nvim ./build/nvim
43+
# }
44+
# mkdir -p ~/.local/share/nvim/site/pack/vendor/start
45+
# git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
46+
# ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
47+
# ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
48+
# -
49+
# name: Generate changelog
50+
# run: |
51+
# $(go env GOPATH)/bin/git-chglog \
52+
# -c .github/chglog/config.yml \
53+
# -t .github/chglog/CHANGELOG.release.md \
54+
# -o RELEASE_CHANGELOG.md ${{ steps.tag.outputs.TAG }}
55+
# cat RELEASE_CHANGELOG.md
56+
# -
57+
# name: Generate Luarocks
58+
# run: |
59+
# export GTAG=${{ steps.tag.outputs.TAG }}
60+
# export PATH="${PWD}/build/:${PATH}"
61+
# make genluarock
62+
# -
63+
# name: Update version in files
64+
# run: |
65+
# sed -i '/sqlite\.db\.__version/s/".*"/"${{ steps.tag.outputs.TAG }}"/' ./lua/sqlite/db.lua
66+
# git add ./lua/sqlite/init.lua
67+
# -
68+
# name: Upload to luarocks
69+
# env:
70+
# LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
71+
# run: |
72+
# luarocks upload \
73+
# .sqlite-${{ steps.tag.outputs.TAG }}-0.rockspec \
74+
# --api-key=${LUAROCKS_TOKEN}
75+
# -
76+
# name: Push Release Changes
77+
# env:
78+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
# COMMIT_MSG: |
80+
# :bookmark: release ${{ steps.tag.outputs.TAG }}
81+
82+
# see https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }}
83+
# run: |
84+
# git config --global user.name 'github-actions[bot]'
85+
# git config --global user.email 'github-actions[bot]@users.noreply.github.com'
86+
# git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
87+
# git commit -m "${COMMIT_MSG}"
88+
# git push origin HEAD:master
89+
# -
90+
# name: Create GH Release
91+
# uses: softprops/action-gh-release@v1
92+
# with:
93+
# body_path: RELEASE_CHANGELOG.md

β€Ž.sqlite-master-0.rockspec

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
rockspec_format = "3.0"
2+
package = "sqlite"
3+
version = "master-0"
4+
source = {
5+
url = "git://github.com/tami5/sqlite.lua",
6+
branch = "master",
7+
}
8+
9+
dependencies = {
10+
"luv",
11+
}
12+
13+
description = {
14+
detailed = "",
15+
homepage = "https://github.com/tami5/sqlite.lua",
16+
labels = { "sqlite3", "binding", "luajit", "database" },
17+
license = "MIT",
18+
summary = "SQLite/LuaJIT binding and a highly opinionated wrapper for storing, retrieving, caching, and persisting [SQLite] databases",
19+
}
20+
21+
build = {
22+
type = "builtin",
23+
modules = {
24+
["sqlite.db"] = "/lua/sqlite/db.lua",
25+
["sqlite.defs"] = "/lua/sqlite/defs.lua",
26+
["sqlite.init"] = "/lua/sqlite/init.lua",
27+
["sqlite.json"] = "/lua/sqlite/json.lua",
28+
["sqlite.tbl"] = "/lua/sqlite/tbl.lua",
29+
["sqlite.tbl.cache"] = "/lua/sqlite/tbl/cache.lua",
30+
["sqlite.tbl.extend"] = "/lua/sqlite/tbl/extend.lua",
31+
["sqlite.utils"] = "/lua/sqlite/utils.lua",
32+
},
33+
}

β€ŽMakefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ test:
55
lint:
66
luacheck lua/
77

8-
docgen:
9-
nvim --headless --noplugin -u test/minimal_init.vim -c "luafile ./scripts/gendocs.lua" -c 'qa'
8+
gen_nvimhelp:
9+
nvim --headless --noplugin -u test/minimal_init.vim -c "luafile ./scripts/gen_nvimhelp.lua" -c 'qa'
1010

1111
testfile:
1212
nvim --headless --noplugin -u test/minimal_init.vim -c "PlenaryBustedDirectory test/auto/$(file)_spec.lua { minimal_init = './test/minimal_init.vim' }"
13+
14+
gen_luarock:
15+
nvim --headless --noplugin -u test/minimal_init.vim -c "luafile ./scripts/gen_rockspec.lua" -c 'qa'
16+

β€ŽREADME.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
1-
sql.nvim πŸ’«
1+
sqlite.lua πŸ’«
22
=================
33

44

55
[SQLite]/[LuaJIT] binding and a highly opinionated wrapper for storing, retrieving, caching, and persisting [SQLite] databases.
6-
[sql.nvim] present new possibilities for plugin development and while it's primarily created for [neovim], it support all luajit environments.
6+
[sqlite.lua] present new possibilities for plugin development and while it's primarily created for [neovim], it support all luajit environments.
77

8-
- [Changelog](https://github.com/tami5/sql.nvim/blob/master/CHANGELOG.md)
9-
- [Docs](https://github.com/tami5/sql.nvim/blob/master/doc/sql.txt)
10-
11-
⏲️ Status
12-
------------------
13-
Under heavy development. Low level API is stable for usage, however, top level API and new features are subject to change.
14-
Please wait for 0.1 relaese or watch the repo for changes.
8+
- [Changelog](https://github.com/tami5/sqlite.lua/blob/master/CHANGELOG.md)
9+
- [Docs](https://github.com/tami5/sqlite.lua/blob/master/doc/sql.txt)
1510

11+
<p align="center"> <img src="./doc/preview.svg"> </p>
1612

1713
✨ Features:
1814
------------------
19-
- Connect, reconnect, close sql db connections `sql:open/sql:close`
20-
- Evaluate any sqlite statement and return result if any `sql:eval`
21-
- Helper function over `sql:eval` to do all sort of operation.
22-
- High level API with `sql:table` for better experience
15+
- Connect, reconnect, close sql db connections `sqlite:open/sql:close`
16+
- Evaluate any sqlite statement and return result if any `sqlite:eval`
17+
- Helper function over `sqlite:eval` to do all sort of operation.
18+
- High level API with `sqlite.tbl` for better experience.
2319
- lua tables deserialization/serialization (in helper functions and high level api)
2420
- 90% test coverage.
2521
- Up-to-date docs and changelog
@@ -28,14 +24,23 @@ Please wait for 0.1 relaese or watch the repo for changes.
2824
🚧 Installation
2925
-----------------
3026

31-
Add `sql.nvim` to your lua `package.path`, neovim `/**/start/` or use your
32-
favorite vim package manager, and ensure you have `sqlite3` installed locally.
33-
If you are using macos, then sqlite3 should be installed already, otherwise install using brew.
27+
### [Packer.nvim](https://github.com/wbthomason/packer.nvim)
28+
29+
```lua
30+
use { "tami5/sqlite.lua" }
31+
```
32+
33+
### [luarocks](https://luarocks.org/)
34+
35+
```bash
36+
luarocks install sqlite
37+
```
3438

39+
**Ensure you have `sqlite3` installed locally.**
3540

3641
#### Windows
3742

38-
[Download precompiled](https://www.sqlite.org/download.html) and set `let g:sql_clib_path = path/to/sqlite3.dll` (note: `/`)
43+
[Download precompiled](https://www.sqlite.org/download.html) and set `let g:sqlite_clib_path = path/to/sqlite3.dll` (note: `/`)
3944

4045
#### Linux
4146
```bash
@@ -48,14 +53,13 @@ sudo apt-get install sqlite3 libsqlite3-dev # Ubuntu
4853
programs.neovim.plugins = [
4954
{
5055
plugin = pkgs.vimPlugins.sql-nvim;
51-
config = "let g:sql_clib_path = '${pkgs.sqlite.out}/lib/libsqlite3.so'";
56+
config = "let g:sqlite_clib_path = '${pkgs.sqlite.out}/lib/libsqlite3.so'";
5257
}
5358
];
5459
```
5560

5661
[Installation]: #🚧_installation
57-
[Status]: #status
5862
[SQLite]: https://www.sqlite.org/index.html
5963
[LuaJIT]: https://luajit.org
60-
[sql.nvim]: https://github.com/tami5/sql.nvim
64+
[sqlite.lua]: https://github.com/tami5/sqlite.lua
6165
[neovim]: https://github.com/neovim/neovim

β€Ždoc/.keep

Whitespace-only changes.

β€Ždoc/preview.svg

Lines changed: 27 additions & 0 deletions
Loading

0 commit comments

Comments
Β (0)