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.
| Database | How a rule is enforced |
|---|---|
| MySQL 8.0.16 and later, MariaDB | ALTER TABLE ... ADD CONSTRAINT ... CHECK (...) |
| PostgreSQL | ALTER TABLE ... ADD CONSTRAINT ... CHECK (...) |
| SQLite | BEFORE 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#
| Area | SQLite | MySQL | PostgreSQL |
|---|---|---|---|
| Key columns (slug, locale, paths, setting keys) | byte for byte | utf8mb4_bin, so /Old and /old are different keys | byte for byte |
| Blocks and revision snapshots | JSON text | LONGTEXT, because the JSON type re-sorts object keys and a saved block would not read back as saved | json |
| Search | LIKE | FULLTEXT in boolean mode, ranked title, then excerpt, then body, then newest | tsvector 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) | LIKE | LIKE | LIKE 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 withcoullworks-blog.tables.prefixbefore you migrate.







