Download the PHP package uchiko/sql-maker without Composer

On this page you can find all versions of the php package uchiko/sql-maker. 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-maker

Abstract

sql-maker - SQL builder written in PHP.

SQL::Maker - SQL builder written in perl. https://github.com/tokuhirom/SQL-Maker

REQUIREMENTS

The JSON SQL Injection Vulnerability

SQL_Maker has a JSON SQL Injection Vulnerability if not used in strict mode.

Therefore, I strongly recommend to use SQL_Maker in strict mode. You can turn on the strict mode by passing 'strict' => 1 as:

In strict mode, array or hash conditions are not accepted anymore. A sample usage snippet is shown in below:

See following articles for more details (perl version)

SYNOPSIS

create instance

  $builder = new uchiko\SQL\Maker(array('driver' => 'SQLite'));

select()

  $table = 'pokedex';

  $fields = array('id', 'name');

  $where = array();
  $where['area'] = 'houen';
  $where['type'] = array( 'like' => '%electric%' );

  $opt = array();
  $opt['order_by'] = array('id');

  list($sql, $binds) =
       $builder->select($table, $fields, $where, $opt);

 /*
  * $sql   => "SELECT id, name
  *            FROM pokedex
  *            WHERE (area = ?) AND (type LIKE ?)
  *            ORDER BY id"
  * $binds => ("houen", "%electric%")
  */

WHERE

 $table  = 'pokedex';

 $fields = array('*');

 $where  = array(
               'name'      => 'Pikachu',
               'legendry'  => null,
               'area'      => array('ish', 'joto'),
               'base_hp'   => array('<=' => 40),
               'type'      => array('like' => '%electric%'),
               'id'        => uchiko\SQL\Maker::scalar( array('= (? - 0)', 25) ),
               'available' => uchiko\SQL\Maker::scalar( array('LIKE ? ESCAPE ?', '%mega\\_kick%', '\\') )
               );

 list($sql, $binds) = $builder->select($table, $fields, $where);

 /*
  * WHERE ( name = "Pikachu" ) AND
  *       ( legendry IS NULL ) AND
  *       ( area IN ("ish", "joto") ) AND
  *       ( base_hp <= 40 ) AND
  *       ( type LIKE "%electric%" ) AND
  *       ( id = (25 - 0) ) AND
  *       ( available LIKE "%mega\_kick%" ESCAPE "\" );
  */

delete()

 list($sql, $binds) = $builder->delete('pokedex', array( 'id' => '25' ));

 /*
  * $sql    => "DELETE FROM pokedex WHERE (id = ?)"
  * $binds  => (25)
  */

insert()

  $table = 'pokedex';

  $values = array(
         'id' => 25,
         'name' => 'Pikachu'
);

list($sql, $binds) = $builder->insert($table, $values);

/*
 * $sql   => "INSERT INTO pokedex (name, id) VALUES (?, ?)"
 * $binds => ("Pikachu", 25)
 */

update()

  $table = 'pokedex';

  $set   = array('type' => 'electric');

  $where = array('id' => 25);

  list($sql, $binds) = $builder->update($table, $set, $where);

  /*
   * $sql   => "UPDATE pokedex SET type = ? WHERE (id = ?)"
   * $binds => ("electric", 25)
   */

method chain

   $sql = new uchiko\SQL\Maker\Select();

   $sql
    ->addSelect('foo')
    ->addSelect('bar')
    ->addSelect('baz')
    ->addFrom('table_name')
    ->asSql();
    
    // => "SELECT foo, bar, baz FROM table

All versions of sql-maker with dependencies

PHP Build Version
Package Version
Requires uchiko/sql-querymaker Version dev-master
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 uchiko/sql-maker contains the following files

Loading the files please wait ....