承接 degami/lessql 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

degami/lessql

Composer 安装命令:

composer require degami/lessql

包简介

LessQL: The agile PHP ORM alternative

README 文档

README

go to the original project

LessQL

Build Status

LessQL is a lightweight and performant alternative to Object-Relational Mapping for PHP.

Installation

Install LessQL via composer: composer require degami/lessql. LessQL requires PHP >= 8.0 and PDO.

Usage

// SCHEMA
// user: id, name
// post: id, title, body, date_published, is_published, user_id
// categorization: category_id, post_id
// category: id, title

// Connection
$pdo = new PDO('sqlite:blog.sqlite3');
$db = new LessQL\Database($pdo);

// Find posts, their authors and categories efficiently:
// Eager loading of references happens automatically.
// This example only needs FOUR queries, one for each table.
$posts = $db->post()
	        ->where('is_published', 1)
	        ->orderBy('date_published', 'DESC');

foreach ($posts as $post) {
	$author = $post->user()->fetch();

	foreach ($post->categorizationList()->category() as $category) {
		// ...
	}
}

// Saving complex structures is easy
$row = $db->createRow('post', array(
	'title' => 'News',
	'body' => 'Yay!',
	'categorizationList' => array(
		array(
			'category' => array('title' => 'New Category')
		),
		array('category' => $existingCategoryRow)
	)
));

// Creates a post, a new category, two new categorizations
// and connects them all correctly.
$row->save();

Features

  • Efficient deep finding through intelligent eager loading
  • Constant number of queries, no N+1 problems
  • Save complex, nested structures with one method call
  • Convention over configuration
  • Work closely to your database: LessQL is not an ORM
  • No glue code required
  • Clean, readable source code
  • Fully tested with SQLite3, MySQL and PostgreSQL
  • MIT license

Inspired mainly by NotORM, it was written from scratch to provide a clean API and simplified concepts.

Documentation and Examples

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 39
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固