FoxQL
A fast, secure, and easy modern SQL library for PHP. supporting multiple database types: MySQL, PostgreSQL, SQLite, Sybase, Oracle, and MSSQL.
Install / Use
/learn @code3-dev/FoxQLREADME
🦊 FoxQL
A fast, secure, and easy modern SQL library for PHP
Seamlessly work with PostgreSQL, MySQL, SQLite, Sybase, Oracle, and MSSQL databases
</div>✨ Features
- 🚀 Simple & 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
Using Composer (Recommended)
composer require foxql/foxql
🚀 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
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
Explore our comprehensive documentation for detailed usage instructions:
🔄 Core Operations
| Basic Operations | Data Manipulation | Schema Management | Raw SQL | | ---------------- | ----------------- | ----------------- | ------- | | Connection | Insert | Create Table | Query | | Select | Update | Drop Table | Execute | | Get | Delete | Action | | | Has | Replace | Migration | |
📊 Aggregation Functions
| Statistical | Mathematical | Other | | ----------- | ------------ | ----- | | Count | Sum | Rand | | Average | Max | | | | Min | |
📄 License
FoxQL is open-sourced software licensed under the MIT license.
👨💻 Developer
- Name: Hossein Pira
- Telegram: @h3dev
- Email: h3dev.pira@gmail.com
- LinkedIn: https://www.linkedin.com/in/hossein-pira-748056278
Related Skills
feishu-drive
337.7k|
things-mac
337.7kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
337.7kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
1.9k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
