Back to directory
kkharji avatar

sqlite.lua

SQLite LuaJIT binding with a very simple api.. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/kkharji/sqlite.lua.git

572

Stars

34

Forks

4

Watchers

MIT

License

sqlite.lua ๐Ÿ’ซ

SQLite/LuaJIT binding and a highly opinionated wrapper for storing, retrieving, caching, and persisting SQLite databases. sqlite.lua present new possibilities for plugin development and while it's primarily created for neovim, it support all luajit environments.

preview

โœจ Features:

  • Connect, reconnect, close sql db connections sqlite:open/sql:close
  • Evaluate any sqlite statement and return result if any sqlite:eval
  • Helper function over sqlite:eval to do all sort of operation.
  • High level API with sqlite.tbl for better experience.
  • lua tables deserialization/serialization (in helper functions and high level api)
  • 90% test coverage.
  • Up-to-date docs and changelog

๐Ÿšง Installation

Packer.nvim (Neovim)

use { "kkharji/sqlite.lua" }

luarocks (LuaJIT)

luarocks install sqlite luv

Ensure you have sqlite3 installed locally. (if you are on mac it might be installed already)

Windows

Download precompiled and set let g:sqlite_clib_path = path/to/sqlite3.dll (note: /)

Linux

sudo pacman -S sqlite # Arch
sudo apt-get install sqlite3 libsqlite3-dev # Ubuntu
sudo dnf install sqlite sqlite-devel # Fedora

Nix (home-manager)

programs.neovim.plugins = [
    {
      plugin = pkgs.vimPlugins.sqlite-lua;
      config = "let g:sqlite_clib_path = '${pkgs.sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}'";
    }
];

Notes:

  • Ensure you install pkgs.sqlite

๐Ÿ”ฅ Powered by sqlite.lua

Releases

Jun 14, 2022

๐Ÿ”– release v1.2.1

Download .zip

Highlights

Fix CI #139 Add alternate way to set clib path #136

๐Ÿ› Bug Fixes

74b3844 false is treat as nil when inserting (closes #123)

f9326aa sqlite:tbl(...) doesn't pass schema This what happen...

Sep 21, 2021

๐Ÿ”– release v1.2.0

Download .zip

โœจ Features 3420a3a make opts.lazy false by default and add opts.keep_open Before lazy was default and there was no way of changing that. I've decided to make it optional because it seems that:

Peop...

Sep 9, 2021

๐Ÿ”– release v1.1.0

Download .zip

๐Ÿ› Bug Fixes 43f5e0c luarocks auto-generate script (closes #115) Having "/" in the start of path breaks luarocks installation.

โœจ Features

5b39526 activate release workflow

โšก Performance Improvem...

Sep 1, 2021

๐Ÿ”– release v1.0.0 (#105)

Download .zip

โ™ป๏ธ refactor

rename emmyclass to be prefixed by sqlite enforce sqlite prefix on exported docs. a hack till tree-sitter-lua@#33 is closed rename export module to sqlite with backward compatibility with...