ProcessWire adds SQLite and PostgreSQL support

25 September 2026 by Ryan Cramer   0 Comments

This week on the dev branch (3.0.274) you can now install and run ProcessWire on SQLite or PostgreSQL, in addition to MySQL.

Support for SQLite and PostgreSQL are experimental, but they have come far enough that I'd love for you to try them and tell us how they work for you.

A big thank you to Adrian Jones (@adrian), who built the PostgreSQL support. It started from a feature request asking whether PostgreSQL could follow the SQLite work. A day later Adrian was sending pull requests, and he has kept them coming at an amazing pace ever since. In addition, Claude Opus 5, Opus 5.5 and GPT 5.6 Sol made this all possible, at least from my end.

How it works

ProcessWire and its modules keep writing the same MySQL SQL they always have. On SQLite and PostgreSQL, ProcessWire translates each query as it runs. So your existing API code, templates and most modules work without changes. Behind the scenes, each database gets what it needs to behave like MySQL:

  • Text searches and sorting ignore case and accents, as with MySQL, so title%=apfel finds "Äpfel".
  • MySQL's JSON functions work on both.
  • PostgreSQL uses its own full text search for the fulltext selector operators (~=, *= and others), with relevance ordering.
  • On SQLite, the fulltext operators use LIKE and REGEXP instead, so results are close to MySQL's but have no relevance ordering.

How to try it

Grab the dev branch and run the installer. The database step now has a "Database Type" option: MySQL, SQLite (experimental) or PostgreSQL (experimental). The CLI installer takes dbType=sqlite or dbType=pgsql.

SQLite:

  • Requires PHP's pdo_sqlite extension and SQLite 3.35 or newer.
  • No database server needed. The whole database is a single file in /site/assets/database/.
  • The installer checks that the file can't be downloaded from the web. The included .htaccess takes care of that on Apache. On nginx and others, you'll need an equivalent rule, and the installer will tell you if it's missing.
  • By default, sorting ignores case but sorts accented letters after the rest. If you'd like "Äpfel" sorted with the A's, as MySQL does, set $config->dbOptions = ['sqlite' => ['unicodeSort' => true]];. It's off by default because it makes sorting slower.

PostgreSQL:

  • Requires PHP's pdo_pgsql extension and PostgreSQL 16 or newer.
  • The installer creates the database if it doesn't exist and your user is allowed to.
  • The installer also creates the unaccent and pg_trgm extensions when it can. Without unaccent, searches ignore case but not accents. Without pg_trgm, there are no fulltext indexes. Either way, the installer tells you what's missing.

Moving a site between databases

You can move a site between MySQL, SQLite and PostgreSQL, in any direction:

  • Export it as a site profile with the latest version of ProcessExportProfile (5.0.2 or newer), including users if you want to keep them.
  • Install that profile on the other database.

If the profile includes users, the installer keeps them, and you log in with your existing account.

To make this possible, ProcessWire now keeps a log of every change to the database schema, in MySQL's terms. So a site exported from SQLite or PostgreSQL installs on MySQL with the same tables and indexes it would have had there.

Where we need help

  • Third-party modules, especially ones that run their own SQL queries. That's where a MySQL feature the translator doesn't handle yet might show up, and we’d want to know about those.
  • Your own sites. Export one as a profile and install it on SQLite or PostgreSQL, then click around the admin and the front end.
  • Where to look for errors: failed queries are logged to pgsql-errors on PostgreSQL, and to sqlite-errors on SQLite when debug mode is on.

When something fails, please open an issue with the error message, and the query if you have it.

Known differences

The PostgreSQL section of /wire/core/WireDatabase/API.md lists these in detail. The main ones include:

  • Sorting: on SQLite, accented letters sort after the rest unless unicodeSort is on.
  • Relevance on PostgreSQL: relevance values differ from MySQL's. With matches in more than one field, the order of results can differ too.
  • Zero dates on PostgreSQL: MySQL's zero dates (0000-00-00) become NULL.
  • Module SQL: modules that use MySQL-specific features the translator doesn't know yet will fail with an error saying so.

Please don't move production sites to SQLite or PostgreSQL yet. But if you have a test site or a spare hour, we'd be grateful for anything you find.

Most Pro modules that we tested are working with both SQLite and PostgreSQL. However, ProCache is one that needs an update, which I’ve already made, and will likely release next week. The tests on Pro modules have not yet been exhaustive so your mileage may vary — please let me know if you come across anything that doesn’t work.

Thanks for reading, and have a great weekend!


Post a comment