r4ndsen/sqlite-php 问题修复 & 功能扩展

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

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

r4ndsen/sqlite-php

最新稳定版本:1.0.0

Composer 安装命令:

composer require r4ndsen/sqlite-php

包简介

this library will help you deal with sqlite3 databases in php

README 文档

README

High-level helpers for SQLite3 with batteries-included query utilities, schema introspection, and pragma management.

Latest Stable Version Build Status Coverage Status

Requirements

  • PHP 8.2 or newer
  • ext-sqlite3 and ext-mbstring

Installation

Composer

composer require r4ndsen/sqlite-php

From source

git clone https://github.com/r4ndsen/sqlite-php.git
cd sqlite-php
composer install

Quick start

<?php

use r4ndsen\SQLite;
use r4ndsen\SQLite\Column;

$sqlite = new SQLite(':memory:');

$tasks = $sqlite->getTable('tasks');
$tasks
    ->addCreateColumn(Column::createIntegerColumn('id'))
    ->addCreateColumn(Column::createTextColumn('title')->disallowNull())
    ->addCreateColumn(Column::createIntegerColumn('is_done', 0))
    ->createIfNotExists();

$tasks->getDynamicInsertTable()
    ->push(['id' => 1, 'title' => 'Write docs'])
    ->push(['id' => 2, 'title' => 'Tag release', 'is_done' => 1])
    ->commit();

$openTasks = $sqlite->fetchPairs(
    'select id, title from tasks where is_done = :is_done order by id',
    ['is_done' => 0],
);
// [1 => 'Write docs']

foreach ($tasks as $row) {
    // Table implements IteratorAggregate, so you can iterate rows directly
}

$sqlite->validate(); // Runs PRAGMA integrity_check and throws on corruption

Head over to the documentation for more detail on tables, column helpers, pragmas, and query convenience methods.

Development tooling

All just recipes run from the project root (install just from https://github.com/casey/just):

just test        # PHPUnit against the current PHP version
just tests       # PHPUnit against the Docker matrix (PHP 8.2–8.5)
just coverage    # Generates HTML coverage and prints the report path
just infection   # Mutation testing (requires Xdebug)
just stan        # PHPStan static analysis

License

r4ndsen/sqlite-php is licensed under the MIT License. See LICENSE for details.

Changelog

See CHANGELOG for release notes.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固