GithubHelp home page GithubHelp logo

activedbsoft / webapi-active-query-builder-php Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 2.71 MB

Active Query Builder WebAPI client for PHP

Home Page: https://webapi.activequerybuilder.com/

License: Apache License 2.0

PHP 98.72% Shell 1.23% Batchfile 0.05%
sql-query-builder sql-query sql sql-builder php web-api rest-client

webapi-active-query-builder-php's Introduction

WebApiActiveQueryBuilder

Active Query Builder Web API lets create, analyze and modify SQL queries for different database servers using RESTful HTTP requests to a cloud-based service. It requires SQL execution context (information about database schema and used database server) to be stored under the registered account at https://webapi.activequerybuilder.com/.

Requirements

PHP 5.4.0 and later

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/WebApiActiveQueryBuilder/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api = new WebApiActiveQueryBuilder\ActiveQueryBuilderApi();
$metadataGuid= "b3207f4f-b1f4-4dc2-979b-7724ed2d0221";
$sql = "Select customer_id, first_name From customer";

$query = new WebApiActiveQueryBuilder\SqlQuery(); // \WebApiActiveQueryBuilder\SqlQuery | Information about SQL query and it's context.
$query->setGuid($metadataGuid);
$query->setText($sql);

$columns = $api->getQueryColumnsPost($query);
print_r($columns);

$transform = new WebApiActiveQueryBuilder\Transform();
$transform->setGuid($metadataGuid);
$transform->setSql($sql);	

$filter = new WebApiActiveQueryBuilder\ConditionGroup();

$condition = new WebApiActiveQueryBuilder\Condition();
$condition->setField('customer_id');
$condition->setConditionOperator('Greater');
$condition->setValues(array(10));

$filter->setConditions(array($condition));

$page = new WebApiActiveQueryBuilder\Pagination();
$page->setSkip(10);
$page->setTake(5);
	
$order = new WebApiActiveQueryBuilder\Sorting();
$order->setField('customer_id');
$order->setOrder('asc');

$transform->setFilter($filter);
$transform->setPagination($page);
$transform->setSortings(array($order));

$result = $api->transformSqlPost($transform);
print_r($result);
?>

Documentation for API Endpoints

All URIs are relative to https://webapi.activequerybuilder.com

Class Method HTTP request Description
ActiveQueryBuilderApi getQueryColumnsPost POST /getQueryColumns
ActiveQueryBuilderApi transformSQLPost POST /transformSQL

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

[email protected]

Source code

Full source code of all clients for Active Query Builder Web API is available on GitHub. Get the source code of javascript here: https://github.com/ActiveDbSoft/webapi-active-query-builder-php

webapi-active-query-builder-php's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.