PHPackages                             shipfastlabs/toolkit-database - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. shipfastlabs/toolkit-database

ActiveLibrary[Database &amp; ORM](/categories/database)

shipfastlabs/toolkit-database
=============================

Read-only database query tool for the Laravel AI SDK

1.0.0(1mo ago)011MITPHPPHP ^8.4.0

Since May 31Pushed 1mo agoCompare

[ Source](https://github.com/shipfastlabs/toolkit-database)[ Packagist](https://packagist.org/packages/shipfastlabs/toolkit-database)[ RSS](/packages/shipfastlabs-toolkit-database/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

shipfastlabs/toolkit-database
=============================

[](#shipfastlabstoolkit-database)

[![Latest Version](https://camo.githubusercontent.com/d7e2003ff0752c722090ca5e714ba379cb87b442008ebd7eb8a1db2d63312465/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73686970666173746c6162732f746f6f6c6b69742d64617461626173652e737667)](https://packagist.org/packages/shipfastlabs/toolkit-database)[![Total Downloads](https://camo.githubusercontent.com/843a1b9e165748f3e5b894dc3449a5e8d9d56b58b770f4edc5aa941fe91dd33b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73686970666173746c6162732f746f6f6c6b69742d64617461626173652e737667)](https://packagist.org/packages/shipfastlabs/toolkit-database)

> Read-only database query tool for the Laravel AI SDK

Part of the [shipfastlabs/toolkit](https://github.com/shipfastlabs/toolkit) catalog of reusable AI tools for the Laravel AI SDK.

Installation
------------

[](#installation)

```
composer require shipfastlabs/toolkit-database
```

Usage
-----

[](#usage)

Instantiate the tool and pass it to an agent's `tools()`:

```
use Shipfastlabs\Toolkit\Database\DatabaseQueryTool;

$tools = [new DatabaseQueryTool];
```

Input schema
------------

[](#input-schema)

ParameterTypeRequiredDescription`query`stringyesA single read-only SQL `SELECT` statement.Matching rows are returned as pretty-printed JSON.

Configuration
-------------

[](#configuration)

This tool ships no config file or service provider. It reads its settings from the `ai.toolkit.database` key of the Laravel AI SDK's existing `config/ai.php`. Add the section manually:

```
// config/ai.php

return [

    // ... existing laravel/ai config ...

    'toolkit' => [
        'database' => [
            'connection' => env('TOOLKIT_DATABASE_CONNECTION'),
            'max_rows' => (int) env('TOOLKIT_DATABASE_MAX_ROWS', 100),
        ],
    ],

];
```

KeyDefaultDescription`ai.toolkit.database.connection``null` (default connection)The connection to query. Point at a read-only replica for extra safety.`ai.toolkit.database.max_rows``100`A `LIMIT` of this size is appended to any query that lacks one.Safety
------

[](#safety)

- **Read-only enforced**: only a single statement beginning with `SELECT` (or a `WITH … SELECT` CTE) is allowed.
- **Write keywords rejected**: `INSERT`, `UPDATE`, `DELETE`, `DROP`, `ALTER` and similar keywords are refused, even inside an otherwise-`SELECT` statement.
- **Single statement only**: queries containing `;` separators are refused.
- **Row cap**: results are bounded by `max_rows`.
- Query failures are returned to the model as strings, not thrown.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

54d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/31663512?v=4)[Pushpak Chhajed](/maintainers/pushpak1300)[@pushpak1300](https://github.com/pushpak1300)

---

Top Contributors

[![pushpak1300](https://avatars.githubusercontent.com/u/31663512?v=4)](https://github.com/pushpak1300 "pushpak1300 (3 commits)")

---

Tags

ailaravellaravel-aitoollaraveldatabaseaisqltool

### Embed Badge

![Health badge](/badges/shipfastlabs-toolkit-database/health.svg)

```
[![Health](https://phpackages.com/badges/shipfastlabs-toolkit-database/health.svg)](https://phpackages.com/packages/shipfastlabs-toolkit-database)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M12.2k](/packages/illuminate-database)[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10823.4k](/packages/awssat-laravel-sync-migration)[sarfraznawaz2005/indexer

Laravel package to monitor SELECT queries and offer best possible INDEX fields.

562.7k](/packages/sarfraznawaz2005-indexer)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
