Download the PHP package sukhrobnurali/querylite without Composer
On this page you can find all versions of the php package sukhrobnurali/querylite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sukhrobnurali/querylite
More information about sukhrobnurali/querylite
Files in sukhrobnurali/querylite
Package querylite
Short Description QueryLite - A Lightweight SQL Query Builder
License MIT
Informations about the package querylite
🚀 QueryLite - Lightweight SQL Query Builder
QueryLite is a fast, lightweight, and easy-to-use database query builder that simplifies SQL interactions using native PDO. It provides an intuitive model-based API while ensuring raw SQL performance.
Installation
Install the package via Composer:
📌 Example Usage
1️⃣ Define a Model
Extend QueryLite
to define your own database model.
2️⃣ Establish a Database Connection
Before using QueryLite, set up a PDO connection:
3️⃣ Query the Database
🔹 Select Data
🔹 Insert Data
🔹 Update Data
🔹 Delete Data
🛠 QueryLite API Methods
Method | Description | Example |
---|---|---|
select($columns) |
Select specific columns from a table | $userModel->select(['id', 'name']); |
where($column, $operator, $value) |
Add a WHERE condition | $userModel->where('status', '=', 'active'); |
orderBy($column, $direction) |
Add sorting to queries | $userModel->orderBy('id', 'DESC'); |
limit($count) |
Limit query results | $userModel->limit(50); |
insert($data) |
Insert new records | $userModel->insert(['name' => 'Jane']); |
update($data) |
Update records | $userModel->update(['email' => '[email protected]']); |
delete() |
Delete records | $userModel->delete()->whereEqual('id', 1); |
getAllRows() |
Fetch all results | $userModel->getAllRows(); |
🛠 Running Tests
To ensure QueryLite functions correctly, run:
🌟 Features
✅ Minimal & Fast – Built on native PDO for raw SQL execution.
✅ Chainable Query Methods – Clean and readable query building.
✅ Supports MySQL & SQLite – Works seamlessly with popular databases.
✅ No Dependencies – Fully self-contained, no external libraries needed.
✅ Customizable & Extendable – Easily define models and extend functionality.
👨💻 Contribution & Support
Feel free to contribute or provide feedback to improve QueryLite. If you encounter any issues, submit a bug report or suggest new features.
📩 Contact: Open an issue on GitHub or email [email protected]
All versions of querylite with dependencies
ext-pdo_mysql Version *
ext-pdo Version *