-
-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite usage #122
Comments
In theory it's definitely possible, since we abstracted the database connection into an interface that should work with dependency injection (so you can connect it to any kind of DB that can fulfill the interface). In practice, we still need to tidy up the existing database functionality a bit, and work on basic features before we can put this on the roadmap. So........... maybe! But not immediately. |
I guess i would try to implement myself then, since I've been meaning to use it on my own host. |
Just to chime in, I think this would be a wonderful addition to GtS 🚀 |
To add to this, once this is possible it would be nice to add something to the docs that explains how to connect it to an existing masto / flavor database. |
I considered the same for my own project but decided against it:
so it's something to keep in mind! |
Just some FYI's. Sqlite is getting a lot of attention on HN these days, and will probably suffice in production for small-scale instances. Here's some One process programming notes (with Go and SQLite). In this HN comment in a larger thread about Litestream (written in Go) some good tips on production-use. And if you wanna go wild, then use a cluster with rqlite (also written in Go). |
There is a pure go implementation now!? sqlite 🤯 |
this would be the implementation i suggest we go for, since i'd rather avoid gcc dependencies |
I mentioned this issue in the above PR, because the database interface tidying up and reshuffling will affect how this is implemented (hopefully making it easier overall). |
So, right now we use Go-PG for postgres connections and ORM. Looks like go-pg is now in maintenance mode, and the devs recommend migrating to Bun. And bun (guess what!) also works with SQLite, and is apparently a bit faster than go-pg. So the quickest step to getting sqlite working with gotosocial might just be to migrate from go-pg => bun https://bun.uptrace.dev/guide/pg-migration.html#new-features |
Now that the migration to bun is complete, the starting point for adding an SQLite implementation is here: https://github.com/superseriousbusiness/gotosocial/blob/main/internal/db/bundb/bundb.go#L89-L91 Since sqlite doesn't use the same sort of connection options as postgres, this will also probably necessitate some changes to the database configuration in the following locations (at least) https://github.com/superseriousbusiness/gotosocial/blob/main/internal/config/db.go |
Currently being tackled in #154 |
For small (and single-user) instances, it would alleviate the maintenance burden to allow running an instance using SQLite as RDBMS.
Would you consider it something possible for this project?
The text was updated successfully, but these errors were encountered: