2017 © Pedro Peláez
 

library search-query-composer

Tokenizer and composer for search query from user input.

image

risototh/search-query-composer

Tokenizer and composer for search query from user input.

  • Monday, April 16, 2018
  • by risototh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

Search Query Composer

This library is intended for use in cases, where you want to extend the search abilities of simple search input. It takes the input from user, and tries to interpret them as an expression. For example, user enters something like a AND NOT (b OR c) and this library will tokenize this input and construct the valid SQL statement fragment like, (*1)

`field` LIKE '%a%'
AND NOT(
  `field` LIKE '%b%'
  OR
  `field` LIKE '%c%'
)

Features

  • PSR-4 autoloading compliant structure
  • Supports operators AND, OR, NOT
  • Supports subquery nesting
  • Easy to use

Use

Basic usage is very simple:, (*2)

$userInput = 'a AND NOT (b OR c)';
$pdo = new \PDO('your pdo connection');
echo RisoToth\Database\SearchQuery::make($userInput, $pdo, '`field`');

The Versions

16/04 2018

dev-master

9999999-dev

Tokenizer and composer for search query from user input.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Richard Toth

database sql php search

16/04 2018

1.1.0

1.1.0.0

Tokenizer and composer for search query from user input.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Richard Toth

database sql php search

29/03 2018

1.0.2

1.0.2.0

Tokenizer and composer for search query from user input.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Richard Toth

database sql php search

28/03 2018

1.0.1

1.0.1.0

Tokenizer and composer for search query from user input.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Richard Toth

database sql php search

28/03 2018

1.0.0

1.0.0.0

Tokenizer and composer for search query from user input.

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Richard Toth

database sql php search