laravel/framework · error · RuntimeException

This database engine does not support fulltext search operat

Error message

This database engine does not support fulltext search operations.

What it means

The base Grammar::whereFullText() throws because this engine has no full-text search compilation. Only MySqlGrammar and PostgresGrammar override whereFullText; SQLite and SQL Server use the base method and throw, because their full-text capabilities (FTS5 / CONTAINS) differ structurally and Laravel does not map them through this builder method.

Source

Thrown at src/Illuminate/Database/Query/Grammars/Grammar.php:837

     * @return string
     */
    public function compileJsonValueCast($value)
    {
        return $value;
    }

    /**
     * Compile a "where fulltext" clause.
     *
     * @param  \Illuminate\Database\Query\Builder  $query
     * @param  array  $where
     * @return string
     *
     * @throws \RuntimeException
     */
    public function whereFullText(Builder $query, $where)
    {
        throw new RuntimeException('This database engine does not support fulltext search operations.');
    }

    /**
     * Compile a clause based on an expression.
     *
     * @param  \Illuminate\Database\Query\Builder  $query
     * @param  array  $where
     * @return string
     */
    public function whereExpression(Builder $query, $where)
    {
        return $where['column']->getValue($this);
    }

    /**
     * Compile the "group by" portions of the query.
     *
     * @param  \Illuminate\Database\Query\Builder  $query

View on GitHub (pinned to bd6b5437e6)

Solutions

  1. On SQLite use FTS5 virtual tables directly via whereRaw, or switch to a LIKE-based search.
  2. On SQL Server use CONTAINS/TABLE via whereRaw.
  3. Restrict whereFullText to MySQL/Postgres and provide a portable fallback search for other engines.

Example fix

// before
$query->whereFullText(['title', 'body'], $term);

// after (portable fallback)
$driver = $query->getConnection()->getDriverName();
if (in_array($driver, ['mysql','pgsql'])) {
    $query->whereFullText(['title','body'], $term);
} else {
    $query->where('title', 'like', "%{$term}%")
          ->orWhere('body', 'like', "%{$term}%");
}
Defensive patterns

Strategy: validation

Validate before calling

$driver = $query->getConnection()->getDriverName();
if (in_array($driver, ['mysql','pgsql'])) {
    $query->whereFullText(['title','body'], $term);
} else {
    $query->where('title', 'like', "%{$term}%")->orWhere('body', 'like', "%{$term}%");
}

Type guard

function supportsFullText(\Illuminate\Database\Connection $connection): bool
{
    return $connection instanceof \Illuminate\Database\MySqlConnection
        || $connection instanceof \Illuminate\Database\PostgresConnection;
}

Prevention

When it happens

Trigger: Calling whereFullText($columns, $value) on a sqlite or sqlsrv connection.

Common situations: Building search with whereFullText against MySQL/Postgres in production, then running the test suite on SQLite. Copying a fulltext search query into a SQL Server migration target.

Related errors


AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06). Data as JSON: /data/errors/84ad0b10970faf47.json. Report an issue: GitHub.