PHPackages                             foxql/foxql - 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. foxql/foxql

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

foxql/foxql
===========

A fast, secure, and easy modern SQL library for PHP

1.1.0(9mo ago)264MITPHPPHP &gt;=7.2.0

Since Aug 8Pushed 8mo agoCompare

[ Source](https://github.com/code3-dev/FoxQL)[ Packagist](https://packagist.org/packages/foxql/foxql)[ Docs](https://github.com/code3-dev/FoxQL)[ RSS](/packages/foxql-foxql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

🦊 FoxQL
=======

[](#-foxql)

[![PHP Version](https://camo.githubusercontent.com/ca7363333f911697897fedbd30260de1670730af039d07f6abd6b162ea8f3f2b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e322d3838393242462e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Composer Package](https://camo.githubusercontent.com/74eb0826adf272a5a46517606b8033437a4b29e55958ca4cb9c6cfd85cc7b523/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d666f78716c253246666f78716c2d626c7565)](https://packagist.org/packages/foxql/foxql)[![GitHub](https://camo.githubusercontent.com/38c7f226926e956e72959526138cc447ce0b41c57a93fdd7204f533513a0218e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769744875622d636f6465332d2d646576253246466f78514c2d626c61636b2e737667)](https://github.com/code3-dev/FoxQL)

**A fast, secure, and easy modern SQL library for PHP**

*Seamlessly work with PostgreSQL, MySQL, SQLite, Sybase, Oracle, and MSSQL databases*

---

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

[](#-features)

- 🚀 **Simple &amp; Intuitive API** - Write less, do more with a clean, fluent interface
- 🔒 **Secure by Default** - Built-in protection against SQL injection
- 🔄 **Multi-Database Support** - Works with PostgreSQL, MySQL, SQLite, Sybase, Oracle, and MSSQL
- 🧩 **Modular Design** - Use only what you need with a lightweight core
- 📊 **Powerful Query Builder** - Construct complex queries with ease
- 🛠️ **Schema Management** - Create and modify database structures programmatically
- 🏗️ **Migration System** - Laravel-inspired migrations for managing database schema changes

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

[](#-installation)

### Using Composer (Recommended)

[](#using-composer-recommended)

```
composer require foxql/foxql
```

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

[](#-quick-start)

```
// Create a new FoxQL instance with MySQL connection
try {
    $db = new \FoxQL\FoxQL([
        'type' => 'mysql',        // Database type: mysql, pgsql, sqlite, etc.
        'database' => 'my_database',
        'host' => 'localhost',
        'username' => 'root',
        'password' => 'password',
        'charset' => 'utf8mb4',   // Character set
        'prefix' => 'prefix_'      // Table prefix (optional)
    ]);

    // Insert data
    $db->insert('users', [
        'name' => 'John Doe',
        'email' => 'john@example.com'
    ]);

    // Select data
    $users = $db->select('users', '*');
    print_r($users);

} catch (\PDOException $e) {
    echo "Connection failed: " . $e->getMessage();
}
```

🏗️ Database Migrations
----------------------

[](#️-database-migrations)

FoxQL includes a powerful migration system for managing database schema changes:

```
// Create a table using the migration builder
$db->createTable('users', function($table) {
    $table->increments('id');
    $table->string('name', 100)->notNull();
    $table->string('email', 100)->notNull()->unique();
    $table->timestamps(); // Adds created_at and updated_at columns
});

// Run migrations from a directory
$migrations = $db->migrate('/path/to/migrations');

// See the complete example in examples/migration_example.php
```

📚 Documentation
---------------

[](#-documentation)

Explore our comprehensive documentation for detailed usage instructions:

### 🔄 Core Operations

[](#-core-operations)

Basic OperationsData ManipulationSchema ManagementRaw SQL[Connection](src/docs/connect.md)[Insert](src/docs/insert.md)[Create Table](src/docs/create.md)[Query](src/docs/query.md)[Select](src/docs/select.md)[Update](src/docs/update.md)[Drop Table](src/docs/drop.md)[Execute](src/docs/execute.md)[Get](src/docs/get.md)[Delete](src/docs/delete.md)[Action](src/docs/action.md)[Has](src/docs/has.md)[Replace](src/docs/replace.md)[Migration](src/docs/migration.md)### 📊 Aggregation Functions

[](#-aggregation-functions)

StatisticalMathematicalOther[Count](src/docs/count.md)[Sum](src/docs/sum.md)[Rand](src/docs/rand.md)[Average](src/docs/avg.md)[Max](src/docs/max.md)[Min](src/docs/min.md)📄 License
---------

[](#-license)

FoxQL is open-sourced software licensed under the [MIT license](LICENSE).

👨‍💻 Developer
-------------

[](#‍-developer)

- **Name:** Hossein Pira
- **Telegram:** [@h3dev](https://t.me/h3dev)
- **Email:**
- **LinkedIn:**

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance58

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

282d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40130ba18b583ddbb28f5251503480424ac073656c20e1375628b126359bf21a?d=identicon)[code3-dev](/maintainers/code3-dev)

---

Top Contributors

[![code3-dev](https://avatars.githubusercontent.com/u/158034265?v=4)](https://github.com/code3-dev "code3-dev (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/foxql-foxql/health.svg)

```
[![Health](https://phpackages.com/badges/foxql-foxql/health.svg)](https://phpackages.com/packages/foxql-foxql)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
