mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
follow sqlite new release (#40)
* refactor(sql_wrapper): follow sqlite new release * update readme
This commit is contained in:
parent
f8cf92a637
commit
cf3a1deb9c
@ -59,11 +59,11 @@ If the active buffer (prior to the finder being launched) is attached to an LSP
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) (required)
|
- [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)
|
- [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.
|
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
|
## Installation
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ use {
|
|||||||
config = function()
|
config = function()
|
||||||
require"telescope".load_extension("frecency")
|
require"telescope".load_extension("frecency")
|
||||||
end,
|
end,
|
||||||
requires = {"tami5/sql.nvim"}
|
requires = {"tami5/sqlite.lua"}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
local util = require("telescope._extensions.frecency.util")
|
local util = require("telescope._extensions.frecency.util")
|
||||||
local vim = vim
|
local vim = vim
|
||||||
|
|
||||||
local has_sql, sql = pcall(require, "sql")
|
local has_sqlite, sqlite = pcall(require, "sqlite")
|
||||||
if not has_sql then
|
if not has_sqlite then
|
||||||
error("This plugin requires sql.nvim (https://github.com/tami5/sql.nvim)")
|
error("This plugin requires sqlite.lua (https://github.com/tami5/sqlite.lua) " .. tostring(sqlite))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: pass in max_timestamps from db.lua
|
-- 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
|
-- create the db if it doesn't exist
|
||||||
db_root = db_root or vim.fn.stdpath('data')
|
db_root = db_root or vim.fn.stdpath('data')
|
||||||
local db_filename = db_root .. "/file_frecency.sqlite3"
|
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
|
if not self.db then
|
||||||
print("error")
|
print("error")
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user