class Parser

This class allows you to store and retrieve data from files in JSON format using SQL standard.

  • The data are described by a json schema in compliance with the spécifications of http://json-schema.org
  • This schema can be generated on this site: http://jsonschema.net

  • The API is very similar to PDO

  • The JSON schema is saved in a file whose name is in the form .schema.json

  • The data is saved in a file whose name is in the form .json

Constants

SQL_SELECT_KEYWORD

SQL_FROM_KEYWORD

SQL_WHERE_KEYWORD

SQL_ORDER_BY_KEYWORD

SQL_LIMIT_KEYWORD

SQL_UPDATE_KEYWORD

SQL_CREATE_KEYWORD

SQL_DELETE_KEYWORD

Properties

protected JsonSQL $jsonsql A pointer on the JsonSQL owner.
protected Engine $engine A pointer on JSON database engine.
protected string $sql The sql request.

Methods

void
__construct(JsonSQL $jsonsql, string $sql)

Constructor of class Parser

static stdClass
create(JsonSQL $jsonsql, $sql)

Parser factory.

parse()

Parses the sql statement.

Details

at line 119
protected void __construct(JsonSQL $jsonsql, string $sql)

Constructor of class Parser

Parameters

JsonSQL $jsonsql The JsonSQL instance
string $sql The sql request

Return Value

void

at line 134
static stdClass create(JsonSQL $jsonsql, $sql)

Parser factory.

Parameters

JsonSQL $jsonsql
$sql

Return Value

stdClass The parsed request

Exceptions

JsonSQLException

at line 165
stdClass parse()

Parses the sql statement.

Return Value

stdClass The parsed request

Exceptions

JsonSQLException