-
Hi! I'm trying out a minimal example to see how sqlite could be used in neoclip but getting the error local has_sqlite, sqlite = pcall(require, "sqlite")
if not has_sqlite then
print "Couldn't find sqlite.lua. Cannot use persistent history"
end
local db = sqlite.new('test.sql')
print(vim.inspect(db:status())) which prints
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Status called instantly
We are probably getting the result here because So i guess sqlite3_status returns 7 if it wasnt actually "opened", "connected" to a database (memory or file).
Edit: Correctly myself here a little bit (been thinking about it). Because sqlite.new defers the actual |
Beta Was this translation helpful? Give feedback.
-
Thanks @Conni2461, I was like how why this happened, 2000 lines of tests for nothing 🤣 Yes,
So you can either run neoclip sounds really interesting, I'm thrilled to use it with sqlite. Tag me if you need help and good luck |
Beta Was this translation helpful? Give feedback.
Thanks @Conni2461, I was like how why this happened, 2000 lines of tests for nothing 🤣
Yes,
.new
or.__call
just creates a logical object that doesn't even check if db file exists or anything..status
is a extremely low level api, meant for debugging and internal stuff..open
does what you would expect and.status
should work and return code 0.So you can either run
sqlite:open(path,...)
or with.new
rundb:open()
first before doing any sqlite stuff (other than creating self-contained tables).neoclip sounds really interesting, I'm thrilled to use it with sqlite. Tag me if you need help and good luck