miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
6.54k stars 706 forks source link

Pure-go Sqlite #1925

Open aymanbagabas opened 1 year ago

aymanbagabas commented 1 year ago

Hi all 👋

Couldn't help but notice that Miniflux doesn't support Sqlite because the driver needs CGo and GCC. Would like to share that there is a pure-go Sqlite driver that doesn't need CGo nor GCC https://gitlab.com/cznic/sqlite would be great if Miniflux supports Sqlite as its a lot lighter that Postgres.

hauleth commented 8 months ago

That would also make backing everything up way easier.

gergan commented 7 months ago

Hi @fguillot - are you open for a pull request adding sqlite support?

fhemberger commented 7 months ago

@gergan I took a very quick peek at the code the other day. Seems you'd need to borrow two methods from the pq package, which are used in Miniflux:

Couldn't find any other code specificly tied to Postgres at first glance. So it looks like changing database drivers could be feasible without too much of a hassle.

fguillot commented 7 months ago

Hi @fguillot - are you open for a pull request adding sqlite support?

I'm not against that. However, I'm a little bit concerned about the number of changes required.

Not sure either about the maturity of pure Go Sqlite drivers compared to https://github.com/mattn/go-sqlite3

gergan commented 6 months ago

I've had a quick look at the table definitions (DDL) and there will be some problems - for example the hstore extension, there is no "with timezone" datetime type in sqlite. Probably there will be tons of other problems too. I will not have the time in January to do any work on this. Probably the best way would be to just try to make the code work with sqlite and if the changes to the code are not minimal, than probably it is not a good idea.

hauleth commented 6 months ago

It is weird that Miniflux uses timestamp with timezone at all, as this type is in general discouraged if you are using any form of ORM or anything. It has only a little bit sense when there is human operator on the DB, but other than that it introduces more problems than it solves. And hstore technically can be replaced by JSON fields.

E021ntox commented 1 week ago

sqlite, please. postgresql is the biggest weakness of miniflux.