diff --git a/README.md b/README.md index a87f56c..75305d3 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ The score is calculated using the age of the 10 most recent timestamps and the t | Timestamp age | Value | | -------- | ---------- | | 4 hours | 100 | -| 1 day | 80 | -| 3 days | 60 | -| 1 week | 40 | -| 1 month | 20 | -| 90 days | 10 | +| 1 day | 80 | +| 3 days | 60 | +| 1 week | 40 | +| 1 month | 20 | +| 90 days | 10 | ### Score calculation @@ -59,15 +59,15 @@ If the active buffer (prior to the finder being launched) is attached to an LSP ## Requirements - [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) (required) -- [sql.nvim](https://github.com/tami5/sql.nvim) (required) +- [sqlite.lua](https://github.com/tami5/sqlite.lua) (required) - [nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons) (optional) Timestamps and file records are stored in an [SQLite3](https://www.sqlite.org/index.html) database for persistence and speed. -This plugin uses `sql.nvim` to perform the database transactions. +This plugin uses `sqlite.lua` to perform the database transactions. ## Installation -### [Packer.nvim](https://github.com/wbthomason/packer.nvim) +### [Packer.nvim](https://github.com/wbthomason/packer.nvim) ```lua use { @@ -75,7 +75,7 @@ use { config = function() require"telescope".load_extension("frecency") end, - requires = {"tami5/sql.nvim"} + requires = {"tami5/sqlite.lua"} } ``` diff --git a/lua/telescope/_extensions/frecency/sql_wrapper.lua b/lua/telescope/_extensions/frecency/sql_wrapper.lua index 8af1291..75cbc4d 100644 --- a/lua/telescope/_extensions/frecency/sql_wrapper.lua +++ b/lua/telescope/_extensions/frecency/sql_wrapper.lua @@ -1,9 +1,9 @@ local util = require("telescope._extensions.frecency.util") local vim = vim -local has_sql, sql = pcall(require, "sql") -if not has_sql then - error("This plugin requires sql.nvim (https://github.com/tami5/sql.nvim)") +local has_sqlite, sqlite = pcall(require, "sqlite") +if not has_sqlite then + error("This plugin requires sqlite.lua (https://github.com/tami5/sqlite.lua) " .. tostring(sqlite)) end -- TODO: pass in max_timestamps from db.lua @@ -43,7 +43,7 @@ function M:bootstrap(db_root) -- create the db if it doesn't exist db_root = db_root or vim.fn.stdpath('data') local db_filename = db_root .. "/file_frecency.sqlite3" - self.db = sql:open(db_filename) + self.db = sqlite:open(db_filename) if not self.db then print("error") return