An open API service indexing awesome lists of open source software.

https://github.com/rezigned/sql-builder

Sql builder is a library that helps you create SQL statement in a simpler style.
https://github.com/rezigned/sql-builder

Last synced: about 1 year ago
JSON representation

Sql builder is a library that helps you create SQL statement in a simpler style.

Awesome Lists containing this project

README

          

SQL-Builder
===========

Sql builder is the library that help you create SQL statement in a simpler style.

Example usage

```php
filter('username', 'admin')
$q->to_sql() will compose an sql
# >> SELECT * FROM users u WHERE username=?

# More complex where condition
$q->filter('date_created', '<', time())
$q->to_sql()
# >> SELECT * FROM users u WHERE date_created < ?

# Arbitary condition
$q->filter('u.setting_id IS NOT NULL')
# >> SELECT * FROM users u WHERE u.setting IS NOT NUL

```