Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[RFC]: Sql Statement Query Caching

Đang mở
#112 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@simon-mundy đang làm issue này rồi.

Từ ngày 9/1/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

enhancement Lang Feature Refactor qa
Proposed Version

0.6.0

Basic Information

PhpDb manually compiles each Select query for every single query, creating unnecessary overhead when a query itself will not change based on adapter/platform.

The intention of this proposal is to allow a caching mechanism which would determine if a Statement uses a Parameter Container and if so, store the compiled query in a cache that is user-determined. This still allows the database driver to correctly quote/execute data without needing to cache-bust regularly.

Background

No response

Considerations

No response

Proposal(s)

Sample pseudo code:-

$select->from('foo')->where([
    'c1' => null,
    'c2' => [1, 2, 3],
    new \Laminas\Db\Sql\Predicate\IsNotNull('c3'),
]);
// Cached string is 'SELECT "foo".* FROM "foo" WHERE "c1" IS NULL AND "c2" IN (?, ?, ?) AND "c3" IS NOT NULL'

$statement = $sql->prepareStatementForSqlObject($select, $storage); // where $storage is a PSR-6 compliant storage wrapper
$results = $statement->execute(); // Statement will use pre-prepared SQL string based on driver/adapter/platform
Appendix/Additional Info

No response

Ngôn ngữ chính
PHP
Star
18
Fork
8
Merge trung bình
6 ngày 11 giờ
Pull request đã merge (30 ngày)
14

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Không có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php-db/phpdb

Tất cả issue của php-db/phpdb

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.