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.
- Host: GitHub
- URL: https://github.com/rezigned/sql-builder
- Owner: rezigned
- Created: 2011-12-07T11:07:47.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-01-08T05:27:54.000Z (over 13 years ago)
- Last Synced: 2025-02-03T22:59:19.077Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 102 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```