定制 illuma-law/healthcheck-pgvector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

illuma-law/healthcheck-pgvector

最新稳定版本:v0.1.3

Composer 安装命令:

composer require illuma-law/healthcheck-pgvector

包简介

Focused pgvector extension health check for Spatie's Laravel Health package.

README 文档

README

Tests Packagist License Latest Stable Version

A focused pgvector extension health check for Spatie's Laravel Health package.

This package provides a simple, direct health check to verify that the vector extension (pgvector) is properly installed and active in your PostgreSQL database. This is critical for applications that rely on pgvector for storing AI embeddings and running semantic/similarity searches.

Features

  • Version Detection: Checks if the vector extension is enabled and reports the specific pgvector version installed.
  • Configurable Strictness: Choose whether a missing pgvector extension should return a Warning (degraded) or a Failure (broken) status for your application.
  • Query Safety: Safely handles database connection errors or missing tables, returning a failed state with the exception message instead of crashing the health check suite.

Installation

Require this package with composer:

composer require illuma-law/healthcheck-pgvector

Configuration

You can publish the config file with:

php artisan vendor:publish --tag="healthcheck-pgvector-config"

The healthcheck-pgvector.php config file allows you to define whether the check is strictly required by default.

return [
    // If true, the check will FAIL when the extension is missing.
    // If false, it will generate a WARNING instead.
    'required' => false,
];

Usage & Integration

Register the check inside your application's health service provider (e.g. AppServiceProvider or a dedicated HealthServiceProvider), alongside your other Spatie Laravel Health checks:

Basic Registration

use IllumaLaw\HealthCheckPgvector\PgvectorExtensionCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    PgvectorExtensionCheck::new(),
]);

Fluent Configuration

You can override the config file's default strictness on a per-check basis using the fluent required() method.

use IllumaLaw\HealthCheckPgvector\PgvectorExtensionCheck;
use Spatie\Health\Facades\Health;

Health::checks([
    // Make the health check FAIL immediately if pgvector is missing
    PgvectorExtensionCheck::new()->required(true),
]);

Expected Result States

The check interacts with the Spatie Health dashboard and JSON endpoints using these states:

  • Ok: The pgvector extension is installed. The short summary and meta data will include the exact installed version (e.g. 0.7.0).
  • Warning: pgvector is missing, but required is set to false.
  • Failed: pgvector is missing and required is set to true.
  • Failed (Exception): The database query to pg_extension throws an exception (e.g., database connection down).

Testing

Run the test suite:

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固