v2 icon indicating copy to clipboard operation
v2 copied to clipboard

Pure-go Sqlite

Open aymanbagabas opened this issue 1 year ago • 6 comments

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.

aymanbagabas avatar Jun 16 '23 01:06 aymanbagabas

That would also make backing everything up way easier.

hauleth avatar Dec 01 '23 10:12 hauleth

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

gergan avatar Jan 03 '24 12:01 gergan

@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.

fhemberger avatar Jan 03 '24 13:01 fhemberger

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

fguillot avatar Jan 04 '24 03:01 fguillot

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.

gergan avatar Jan 10 '24 23:01 gergan

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.

hauleth avatar Jan 11 '24 11:01 hauleth