PHPackages                             craftix/lite-eloquent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. craftix/lite-eloquent

ActiveLibrary[Database &amp; ORM](/categories/database)

craftix/lite-eloquent
=====================

Lightweight, dependency-free Eloquent-style PDO Query Builder for PHP

1.1.0(5mo ago)02MITPHPPHP &gt;=8.2

Since Dec 2Pushed 5mo agoCompare

[ Source](https://github.com/mirataollahi/lite-eloquent)[ Packagist](https://packagist.org/packages/craftix/lite-eloquent)[ RSS](/packages/craftix-lite-eloquent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Lite Eloquent
=============

[](#lite-eloquent)

**Lite Eloquent** is a lightweight, high-performance PHP database query builder and ORM-inspired library.
It provides an easy-to-use, fluent API for building SQL queries with support for joins, where clauses, pagination, and bindings—without the heavy dependencies.

---

✨ Features
----------

[](#-features)

- 🚀 **High-performance** PHP database query builder
- 📦 **Lightweight** and dependency-free (only requires PDO)
- 🔗 **Fluent, chainable API** similar to Eloquent
- 🔒 **Secure** with proper parameter bindings (SQL injection protection)
- 🗄️ **Multi-dialect support** (MySQL, Pgsql)
- 📄 **Pagination** support (simple and length-aware)
- 🔄 **Transaction** support
- 📊 **Collection** class with array-like operations
- 🎯 **Type-safe** with PHP 8.2+ features

### Supported Operations

[](#supported-operations)

- ✅ `SELECT` queries with columns, joins, where clauses, ordering, limit
- ✅ `INSERT` queries (single and bulk)
- ✅ `UPDATE` queries with where clauses
- ✅ `DELETE` queries with where clauses
- ✅ `UPSERT` operations (MySQL: ON DUPLICATE KEY UPDATE, Pgsql: ON CONFLICT)
- ✅ `INSERT OR IGNORE` operations
- ✅ Complex `WHERE` conditions (nested groups, IN, BETWEEN, NULL checks, LIKE, etc.)
- ✅ `JOIN` clauses (INNER, LEFT, RIGHT, FULL)
- ✅ Raw SQL expressions
- ✅ Pagination (with total count or simple)
- ✅ Database transactions

---

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require craftix/lite-eloquent
```

**Requirements:**

- PHP &gt;= 8.2
- PDO extension

---

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Setup

[](#basic-setup)

```
