lapis
lapis copied to clipboard
SQLite3 Support
Any chance of integrating SQLite3 into Lapis? It is a very handy db when you don't need a full server. I'd like to make little isolated Lapis apps that don't depend on running a full psql server.
I would also like this. If nothing else, it would be nice to use a tiny self-contained database for testing things.
No plans at the moment, but contributions welcome.
When lapis first launched openresty was also optional. Maybe it should be optional again? This way anyone with a working LuaRocks can experiment with the basics of lapis.
I don't really see an issue with having openresty mandatory. Lapis is a web framework, so it's to be expected that it should run on a web server...
Landon Manning [email protected]
On 25 March 2016 at 15:46, leaf [email protected] wrote:
No plans at the moment, but contributions welcome.
When lapis first launched openresty was also optional. Maybe it should be optional again? This way anyone with a working LuaRocks can experiment with the basics of lapis.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/leafo/lapis/issues/394#issuecomment-201416999
I switched to openresty only because it was easier to maintain one server, openresty has certain characteristics that are valuable, and lapis does some things specifically for nginx (the configuration generation)
I don't really want to encourage people to run lapis in something like xavante because you're missing out on a lot of the benefites. But the decreased overhead in getting started might be worth it, almost like having it as a beginner mode.
I'm thinking of decoupling the server implementation such that you would specify what server implementation to use via the configuration.
Something like server "lapis.nginx"
would load a lua module lapis.nginx
with callbacks for doing everything necessary with nginx, or lapis.xavante
with the xavante implementation. This would make it easy for third party implementations to be separate modules
Discussion of that can be continued in #419
http://12factor.net/dev-prod-parity best practices here suggest using the same db in production and testing.
Definitely, this is more to reduce the barrier to entry to try out lapis, with the goal of attracting new users
And for small apps, no? Say one wants a small personal app and doesn't intend on going further with it.
Yup, that too.
Any more thought on this issue? I would really like to use the Lapis model setup for a website I am about to start working on, but I want to use SQLite since this is a smallish, read-only set of data and I feel like using psql is a bit overkill. I have an SQLite Lua module that I can use, but it isn't integrated with the Lapis model.
https://github.com/Wiladams/LJIT2SQLite
This is pretty decent:
http://lua.sqlite.org/
Gonna see if I can make SQLite3 work with that.
Hm. Maybe. I am somewhat partial to the API for the one I linked, though I don't like the PascalCase.
Edit: That one looks like it had a pretty decent API too. I'd say go for it. :)
Okay, the lsqlite3
library supports several features that make it a lot easier to write prepared statements, smarter queries and transaction. I'm gonna have to rewrite the typical approach used by the lapis postgres and mysql abstractions to take advantage of those features, and for better performance.
That would probably make it harder to choose between backends, unless we place an abstraction OVER the lqlite3 library. Which is something I don't want to do.
Anyone working on sqlite3 support now?
not that I'm aware of
any progress on this?
i'd like to try and take a stab at it, however i'm still learning lua, and laravel. I'd like my webcomic to have a lua backend for funzies.
I suspect any code pulled into lapis would be preferred as moonscript over lua. otherwise, any help would be appreciated!
@leafo What steps would be required to integrate SQLITE3? I'm feeling slightly more confident in my abilities and would like to tackle this problem.
not support sqlite in 2021?
it's Oct 2021 now, where is SQLite3 ?
@aceyin please keep comments on GitHub productive. Politely inquiring about the state of work or providing more context on your use case is a lot more helpful than demanding comments.
It's February 2023 and there is now sqlite support