Download the PHP package matatirosoln/sql-to-odata without Composer

On this page you can find all versions of the php package matatirosoln/sql-to-odata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sql-to-odata

MSDev SQL to OData

A PHP library for converting SQL queries to OData (Open Data Protocol) query syntax. Targets OData 4.01 at the intermediate conformance level, primarily designed for use with the Claris FileMaker OData API (FileMaker Server 2025 / v22+).

We would be very interested in hearing from potential users who have access to alternative OData implementations and may be interested in working to extend this library to ensure that it is broadly useful as possible.

Requirements

Installation

Usage

Call parse() on any supported SQL statement. It returns a typed query object you can inspect to build your OData request.

SELECT

Returns a SelectQuery with entitySet and queryString properties.

INSERT

Returns an InsertQuery with entitySet and body properties. body is an associative array of column-value pairs with PHP-native types, suitable for JSON-encoding into a POST request body.

UPDATE

Returns an UpdateQuery with entitySet, body, and filter properties. filter is an OData filter expression derived from the WHERE clause. UPDATE without a WHERE clause throws a ConversionException.

DELETE

Returns a DeleteQuery with entitySet and filter properties. DELETE without a WHERE clause throws a ConversionException.

Dispatching on query type

Use match or instanceof checks to handle each statement type:

Supported SQL features

Targets OData 4.01 intermediate conformance level (spec).

SELECT clauses

SQL OData
SELECT col1, col2 $select=col1,col2
SELECT * (omitted — returns all fields)
JOIN / LEFT JOIN $expand
WHERE $filter
ORDER BY $orderby
LIMIT n $top=n
LIMIT n OFFSET m $top=n&$skip=m

JOIN → $expand

SQL JOINs are translated to OData $expand, which follows navigation properties defined in the OData service metadata. Columns selected from a joined table are promoted into a nested $select within the expand:

Multiple JOINs produce a comma-separated $expand:

Note: Unlike SQL, OData $expand is constrained to navigation properties defined in the service metadata — arbitrary cross-entity joins are not supported by the OData protocol itself.

WHERE operators

SQL OData
= eq
!= / <> ne
> gt
>= ge
< lt
<= le
AND / OR and / or
IS NULL eq null
IS NOT NULL ne null
LIKE '%val%' contains(col, 'val')
LIKE 'val%' startswith(col, 'val')
LIKE '%val' endswith(col, 'val')
IN (a, b, c) (col eq a or col eq b or col eq c)

Exceptions

All errors throw Matatirosoln\SqlToOdata\Exception\ConversionException. Common cases:

Running tests

License

MIT — see LICENSE.

Contact

Steve Winter — Matatiro Solutions Ltd — [email protected]


All versions of sql-to-odata with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
phpmyadmin/sql-parser Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package matatirosoln/sql-to-odata contains the following files

Loading the files please wait ...