Skip to content
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

Compilation support for SQLite #3051

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jvoisin
Copy link
Collaborator

@jvoisin jvoisin commented Dec 29, 2024

  • CREATE TYPE … AS ENUM(…) is PostgreSQL-specific, and is roughly equivalent to CHECK(… in (…))
  • Specifying the index type is PostgreSQL-specific, so let's do it conditionally based on the used driver

This is another step towards #1925

@fguillot
Copy link
Member

How do you test that?

I tried this:

go build -tags=sqlite -o miniflux-sqlite

export DATABASE_URL="file:/tmp/test.db"

./miniflux-sqlite -debug -migrate
level=INFO msg="Running database migrations" current_version=0 latest_version=99 driver=sqlite3
[Migration v1] near "(": syntax error

@jvoisin jvoisin marked this pull request as draft December 30, 2024 14:42
@jvoisin
Copy link
Collaborator Author

jvoisin commented Dec 30, 2024

Yeah, it's not a complete port. I have a bunch of other (horrible) local hacks to make this work, but I thought I would send small PR as I move forward, instead of a big one, but oh well, let's go with a big one instead!

@jvoisin jvoisin force-pushed the sqlite_portability branch 7 times, most recently from 92be012 to c00ff89 Compare January 2, 2025 23:16
@jvoisin jvoisin marked this pull request as ready for review January 2, 2025 23:18
Miniflux can now be compiled with SQLite support. The next step are to actually
make it work.

- `CREATE TYPE … AS ENUM(…)` is PostgreSQL-specific, and is roughly equivalent
  to `CHECK(… in (…))`
- Specifying the index type is PostgreSQL-specific, so let's do it
  conditionally based on the used driver
- Replace `timestamp` with time` with `timestamptz`
- Don't use full-text search for sqlite for now
- `md5` isn't supported
- SQLite doesn't enforce types (yes.), so no need to alter tables to change
  them
- Various portability improvements
@jvoisin jvoisin force-pushed the sqlite_portability branch from c00ff89 to e1b50df Compare January 2, 2025 23:22
@jvoisin jvoisin changed the title Improve a bit SQL portability Compilation support for SQLite Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants