Skip to content
Available for new work
Pages in Blog

ConceptPremium

Databases supported by CoullWorks Blog for Laravel

SQLite, MySQL and PostgreSQL support, how check constraints and search differ between them, and what to know before choosing one.

Updated 16 November 2026Back to the package pageBuy

The package runs on SQLite, MySQL and PostgreSQL. The same test suite runs against each, one database at a time. Choose the one your application already uses.

Check constraints#

Laravel's schema builder has no check-constraint API, so the package writes them itself.

DatabaseHow a rule is enforced
MySQL 8.0.16 and later, MariaDBALTER TABLE ... ADD CONSTRAINT ... CHECK (...)
PostgreSQLALTER TABLE ... ADD CONSTRAINT ... CHECK (...)
SQLiteBEFORE INSERT and BEFORE UPDATE triggers that abort when the rule is false

MySQL refuses a check that reads an auto-increment column. The one rule that does (a category may not be its own parent) is enforced with triggers on MySQL, as on SQLite.

Where the databases differ#

AreaSQLiteMySQLPostgreSQL
Key columns (slug, locale, paths, setting keys)byte for byteutf8mb4_bin, so /Old and /old are different keysbyte for byte
Blocks and revision snapshotsJSON textLONGTEXT, because the JSON type re-sorts object keys and a saved block would not read back as savedjson
SearchLIKEFULLTEXT in boolean mode, ranked title, then excerpt, then body, then newesttsvector with weights A, B and C and the simple configuration, in a GIN index
Short terms (under 3 letters) and the search.like_locales locales (Chinese, Japanese, Korean, Thai)LIKELIKELIKE as ILIKE

Choosing#

  • SQLite is fine for local development and small sites.
  • On PostgreSQL the package keeps a stored search vector with a GIN index, which keeps search fast on large blogs. On MySQL it uses a FULLTEXT index.
  • Table names are prefixed (cwb_ by default). Change the prefix with coullworks-blog.tables.prefix before you migrate.

Available for new work

UK based · PHP · Python · JS · TS. Every first call is free.