2017 © Pedro Peláez
 

library orcons-db

A database query builder for ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

image

chamamme/orcons-db

A database query builder for ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  • Sunday, July 22, 2018
  • by chamamme
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

NoQuery

NoQuery is a php query builder running on ADODB library. It is aimed at making database interactions easier with less codes. NoQuery currently supports MySQL, Firebird-Interbase, PostgreSQL, SQLite3, Oracle, Microsoft SQL Server, Foxpro ODBC, Access ODBC, Informix, DB2, Sybase, Sybase SQL Anywhere, generic ODBC and Microsoft's ADO due its leverage on ADODB., (*1)

Installation

 > composer require chamamme/noquery

Configuration

NoQuery requires a configuration array. A typical configuration looks like

$config = [ 'driver' => 'mysqli', #eg. access,ado,ibase,fbsql,db2,informix,ldap,mssqlnative,netezza,odbc,odbtp,oci8,pdo,postgres9,proxy,ads,sybase_ase,sqlite3,sybase 'server' => "localhost", 'username' => "root", 'password' => "", 'port' => "3306", 'database' => "test_db", 'debug' => false ];

Usage

It all starts with an instance of Tablet class which requires a configuration array variable., (*2)

$db = new  NoQuery\Builder( $config ) 

Now we are ready to interact with our database., (*3)

Methods

Name Params (Type) Description Example
table table (string) Tells orcons-db the database table to interact with. table('users')
select columns (array) Performs a select query. select(['name','age'])
update args (array) Performs an UPDATE statement . update(['name'=>'Andrew','age'=>10])
where conditions (array) Adds an where clause to sql statement where(["name = 'Chamamme'])
orWhere conditions (array) Adds an OR clause to sql statement orWhere([age = 25])
whereIn column (string) , conditions (array) Adds an WHERE IN clause to sql statement whereIn('age',[ 25 , 6 , 8 ])
whereNotIn column (string) , conditions (array) Adds an WHERE NOT IN clause to sql statement whereNotIn('age',[ 25 , 6 , 8 ])
whereBetween column (string) , conditions (array) Adds an BETWEEN clause to sql statement whereBetween('age',[ 18 ,19 ])
orWhereIn conditions (array) Adds an OR IN clause to sql statement orWhereIn(['name'=>'Andrew','age'=>25])
get limit (int), offset (int) Executes the sql statement get() or get(0,10)
run Executes the sql statement run()
toSql returns the final sql statment toSql()

Sample

```php, (*4)

require("vendor/autoload.php"); #change to the actual path of your composer autoload.php file, (*5)

use NoQuery\Builder;, (*6)

$config = [ 'driver' => "mysqli", 'server' => "localhost", 'username' => "root", 'password' => "", 'port' => "3306", 'database' => "test_db", 'debug' => false ];, (*7)

$db = new Builder( $config ) ; #Instantiate the Builder class

#select query
$db->table('users')
    ->select(['name','gender','age'])
    ->get();

#update statement
$db->table('users')
      ->update(['name'=>'Chamamme'])
      ->where(["id = 5","gender ='male'"])
      ->go();

```, (*8)

The Versions

22/07 2018

dev-master

9999999-dev

A database query builder for ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction query builder layer orcons

26/06 2018

1.0.6

1.0.6.0

A database query builder for ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction query builder layer orcons

20/10 2017

1.0.5

1.0.5.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons

20/10 2017

1.0.3

1.0.3.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons

20/10 2017

1.0.4

1.0.4.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons

20/10 2017

1.0.2

1.0.2.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons

18/10 2017

1.0.1

1.0.1.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons

13/10 2017

1.0.0

1.0.0.0

A database layer over ADODB which is aimed at code beautification by minimizing the use of raw SQL in codes

  Sources   Download

MIT

The Requires

 

by Andrew Chamamme

database php library adodb abstraction layer orcons