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
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
vectorextension 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
requiredis set tofalse. - Failed: pgvector is missing and
requiredis set totrue. - Failed (Exception): The database query to
pg_extensionthrows 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
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-20