[free] [standalone] sqlite database

Hello everyone

I just released my SQLITE Database script on Github

Sqlite is a database that is entirely contained within in a single file, making it very user friendly and my database of choice for a new framework im working on.

Since ive seen many topics about people asking for a sqlite databse that can be accesed in lua, but havent been able to find any resources, ive decided to release this script under an mit license so anybody can use it.

If you find any bugs or have any questions, feel free to reply in the comments and Ill do my best to help you out.

Also feel free to submit your own pull requests to help the project.

For the full documentation head over to the github page

9 Likes

Looks solid. Not sure where a single SQLite database would be useful compared alongside MySQL. A framework based on this would be interesting. Will watch.

1 Like

If you already have a MySQL database setup, there probably is not much use in using an sqlite database along side it.

This is more aimed towards people making their own frameworks , gamemodes or other projects that are just starting out and have not yet locked themselves into using ox_mysql or similar.

Yeah, SQLite is a solid system still used by game developers. And a light framework can now use it easily with your resource. :smirk:

1 Like

I don’t think you realize how much I love you right now. Back in the SA:MP days (where SQLite was built-in) I would create entire RPG servers running on just sqlite. No overkill db configurations, just a simple .db file on my system.

I haven’t tinkered with it yet, but from what I see on the github, would it be possible to incorporate this in other resources, instead of using exports (like warmenu, for example)? This would make sqlite even more viable for creating resources that need a place to store data, but don’t want to deal with the current “give the user a .db file and hope that they use the correct MySQL resource” approach.

Its definetly possible to incorporate it into your script without having the user install the resource separately. You could copy the server.js file and db folder and then just use the events instead of using the exports.

But then, if want to read data from the db, you have to implement your own callbacks, because this is a wrapper for a js sqlite library and afaik there is no default way to do callbacks form js to lua (except when using nui but this resource has no nui).

Alternatively you could also just package you script inside a bracket folder eg: “[myscript]” and put my sqlite script inside along your script and use the exports in your script

Having a separate database per resource locks you out of the best parts of a relational database – foreign keys, cascading updates/deletes, data integrity; no joins for framework data and such, either. At that point you’re probably better off using kvp natives instead.