progrmanial/fast-sql 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

progrmanial/fast-sql

Composer 安装命令:

composer require progrmanial/fast-sql

包简介

A secure and flexible PHP class for generating SQL queries.

README 文档

README

fast-sql is a PHP class designed to provide a secure and flexible way to generate SQL queries. It supports various SQL operations, parameter binding to prevent SQL injection, transactions, and caching for improved performance.

Installation

You can install fast-sql using Composer. Add the following to your composer.json file:

{
    "require": {    
        "progrmanial/fast-sql": "dev-master"
    }
}

Then run:

composer install

Usage

<?php

use progrmanial\FASTSQL\SecureSQLGenerator;
use PDO;

// Create a PDO instance for mysql database connection
$pdo = new PDO('mysql:host=localhost;dbname=your_database', 'username', 'password');

// Create an instance of SecureSQLGenerator
$sqlGenerator = new SecureSQLGenerator($pdo);

// Example: SELECT operation
$result = $sqlGenerator
    ->select(['id', 'name'])
    ->from('users')
    ->where(['status' => 'active'])
    ->execute();

// Example: INSERT operation
$sqlGenerator
    ->insert('products', ['name' => 'Product A', 'price' => 29.99])
    ->execute();

// Example: JOIN operation
$result = $sqlGenerator
    ->select(['users.id', 'users.name', 'orders.total'])
    ->from('users')
    ->innerJoin('orders', ['users.id' => 'orders.user_id'])
    ->execute();

Features

  • Secure: Uses parameter binding to prevent SQL injection.
  • Flexible: Supports various SQL operations, including SELECT, INSERT, UPDATE, DELETE, and JOIN.
  • Transaction Management: Provides methods for starting, committing, and rolling back transactions.
  • Caching: Optionally caches query results for improved performance.
  • Set Operations: Supports INTERSECT, UNION, and EXCEPT set operations.

Contributing

If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

  • 总下载量: 64
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-15