Download the PHP package yangweijie/think-orm-sqlite-remote without Composer
On this page you can find all versions of the php package yangweijie/think-orm-sqlite-remote. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download yangweijie/think-orm-sqlite-remote
More information about yangweijie/think-orm-sqlite-remote
Files in yangweijie/think-orm-sqlite-remote
Download yangweijie/think-orm-sqlite-remote
More information about yangweijie/think-orm-sqlite-remote
Files in yangweijie/think-orm-sqlite-remote
Vendor yangweijie
Package think-orm-sqlite-remote
Short Description ThinkPHP ORM SQLite Remote Connection via HTTP Tunnel or Socket
License Apache-2.0
Package think-orm-sqlite-remote
Short Description ThinkPHP ORM SQLite Remote Connection via HTTP Tunnel or Socket
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package think-orm-sqlite-remote
ThinkPHP ORM SQLite Remote
通过 HTTP Tunnel 或 Socket 访问远程 SQLite 数据库的 ThinkPHP ORM 扩展。
特性
- 双模式支持:HTTP Tunnel(Navicat 兼容)+ Socket(事务支持)
- 完整事务支持:BEGIN/COMMIT/ROLLBACK,支持 insertGetId
- WAL 模式优化:支持 SQLite WAL 高并发配置
- 连接池管理:Socket 模式下保持连接一致性
- 安全认证:支持 Basic Auth
- Navicat 兼容:HTTP Tunnel 模式可直接用于 Navicat 连接
架构
安装
要求 PHP >= 8.4(psl 依赖)
配置
HTTP Tunnel 模式(Navicat 连接)
Socket 模式(事务支持)
使用方法
启动 Socket 守护进程
WAL 模式配置(高并发优化)
WAL 配置说明
| 参数 | 默认值 | 说明 |
|---|---|---|
--wal-mode |
WAL | 日志模式(WAL/DELETE) |
--busy-timeout |
5000 | 锁等待超时(ms),高并发建议增大 |
--wal-checkpoint |
1000 | 自动 checkpoint 阈值 |
--synchronous |
NORMAL | 同步模式:OFF(最快)、NORMAL(推荐)、FULL(最安全) |
--transaction-timeout |
60 | 事务超时(s),防止长事务阻塞 |
SQLite PRAGMA 说明
基本查询
事务操作(需要 Socket 模式)
使用 Model
字段缓存
服务端部署
方式一:独立脚本
将 ntunnel_sqlite.php 部署到远程服务器。
方式二:ThinkPHP 路由(推荐)
方式三:完整部署(HTTP + Socket)
Navicat 连接配置
- 连接类型选择 SQLite
- 选择 HTTP 标签页
- 勾选 使用 HTTP 隧道
- 隧道网址:
http://your-server.com/ntunnel-sqlite - 勾选 使用验证,填写用户名和密码
- 数据库文件: 服务器上的绝对路径
协议说明
HTTP Tunnel 协议
与 Navicat 的 ntunnel_sqlite.php 兼容:
- 请求方法: POST
- 参数:
actn,dbfile,q[],encodeBase64 - 响应: 二进制格式(16字节头 + 结果集)
Socket 协议
基于 JSON 的请求/响应:
开发与测试
安装开发依赖
运行测试
测试覆盖
ConnectionSessionTest: WAL 配置、事务管理、查询执行、超时检测、Checkpoint
注意事项
- 事务限制: HTTP Tunnel 模式不支持事务,请使用 Socket 模式
- 安全: 使用 Basic Auth 或防火墙保护隧道入口
- 性能: Socket 模式比 HTTP 模式性能更好
- WAL 模式: 高并发场景推荐启用 WAL 模式
- 部署: Socket 守护进程需常驻运行(建议用 Supervisor)
- 事务超时: 长时间未提交的事务会自动回滚
目录结构
许可证
Apache-2.0 License
All versions of think-orm-sqlite-remote with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.4
topthink/framework Version ^8.0
topthink/think-orm Version ^3.0|^4.0
azjezz/psl Version ^5.0
topthink/framework Version ^8.0
topthink/think-orm Version ^3.0|^4.0
azjezz/psl Version ^5.0
The package yangweijie/think-orm-sqlite-remote contains the following files
Loading the files please wait ...