GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • SphinxQL Query Builder Documentation

This view

  • Original page
  • New address

GeezerVison is showing foolcode.github.io — Introduction - SphinxQL Query Builder Documentation

Introduction¶

SphinxQL Query Builder provides a fluent PHP API for SphinxQL and ManticoreQL.

It is designed for teams that want:

  • readable query composition

  • safe value quoting/escaping via connection drivers

  • testable SQL compilation (compile() + getCompiled())

  • helper wrappers for common engine commands

Supported drivers:

  • Foolz\\SphinxQL\\Drivers\\Mysqli\\Connection

  • Foolz\\SphinxQL\\Drivers\\Pdo\\Connection

Quick Example¶

<?php

use Foolz\SphinxQL\Drivers\Mysqli\Connection;
use Foolz\SphinxQL\SphinxQL;

$conn = new Connection();
$conn->setParams([
    'host' => '127.0.0.1',
    'port' => 9306,
]);

$rows = (new SphinxQL($conn))
    ->select('id', 'gid', 'title')
    ->from('rt')
    ->match('title', 'vacation')
    ->where('gid', '>', 300)
    ->orderBy('id', 'DESC')
    ->limit(5)
    ->execute()
    ->getStored();

Compile-First Workflow¶

Compiling queries before execution is useful for debugging and tests.

<?php

use Foolz\SphinxQL\SphinxQL;

$sql = (new SphinxQL($conn))
    ->select('a.id')
    ->from('rt a')
    ->leftJoin('rt b', 'a.id', '=', 'b.id')
    ->where('a.id', '>', 1)
    ->compile()
    ->getCompiled();

// SELECT a.id FROM rt a LEFT JOIN rt b ON a.id = b.id WHERE a.id > 1

Where To Next¶

  • Configuration for connection parameters and driver notes

  • SphinxQL Query Builder for full query API with examples

  • Helper API for SHOW/CALL/maintenance wrappers

  • Percolate (Manticore) for Manticore percolate workflows

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.