Download the PHP package izzuddinmohsin/neuron-sqlserver-toolkit without Composer
On this page you can find all versions of the php package izzuddinmohsin/neuron-sqlserver-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download izzuddinmohsin/neuron-sqlserver-toolkit
More information about izzuddinmohsin/neuron-sqlserver-toolkit
Files in izzuddinmohsin/neuron-sqlserver-toolkit
Package neuron-sqlserver-toolkit
Short Description SQL Server / Azure SQL Database Toolkit for Neuron AI - The PHP Agentic Framework
License MIT
Informations about the package neuron-sqlserver-toolkit
SQL Server Toolkit for Neuron AI
A SQL Server / Azure SQL Database toolkit for Neuron AI — the PHP Agentic Framework. Gives your AI agents the ability to discover database schema, execute read queries, and perform write operations on SQL Server databases.
Adapted from Neuron AI's built-in MySQL Toolkit with full SQL Server compatibility, including schema-awareness, views discovery, positional parameters, and SQL Server-specific security hardening.
Features
- Schema Discovery — Automatically discovers tables, views, columns, relationships, indexes, and constraints
- Views Support — Discovers and distinguishes between tables and views (read-only indicator for LLM)
- Read Queries — Safe SELECT query execution with security validation
- Write Operations — INSERT, UPDATE, DELETE, and MERGE support with SCOPE_IDENTITY() for identity columns
- Security Hardened — Blocks dangerous operations like
xp_cmdshell,OPENROWSET,SELECT INTO, DDL statements - Positional Parameters — Uses
?placeholders (required for SQL Server PDO driver compatibility) - Azure SQL Compatible — Works with both on-premise SQL Server and Azure SQL Database
- LLM-Optimized Output — Schema output formatted with SQL Server-specific guidelines (TOP, GETDATE, LEN, etc.)
Requirements
- PHP 8.1+
- PDO SQL Server driver (
pdo_sqlsrv) - Neuron AI ^2.0
Installation
PDO SQL Server Driver Setup
Windows:
Download Microsoft Drivers for PHP for SQL Server and enable in php.ini:
Linux (Ubuntu/Debian):
Quick Start
Laravel Integration
Note: Return the toolkit instance directly — the framework will bootstrap it internally and register the guidelines automatically. You don't need to call
->provide().
Usage
Discover All Tables and Views
Discover Specific Tables/Views Only
Exclude the Write Tool
If you want read-only access, use the toolkit's exclude() method:
Azure SQL Connection
SQL Server vs MySQL Differences
This toolkit handles the key differences between SQL Server and MySQL automatically. The LLM receives SQL Server-specific guidelines, but here's a reference:
| Feature | MySQL | SQL Server |
|---|---|---|
| Limit rows | LIMIT 10 |
TOP 10 |
| Auto increment | AUTO_INCREMENT |
IDENTITY(1,1) |
| Current datetime | NOW() |
GETDATE() |
| String length | LENGTH() |
LEN() |
| String concat | CONCAT() or \|\| |
CONCAT() or + |
| Table quoting | `table` | [table] |
|
| Boolean type | BOOLEAN / TINYINT(1) |
BIT |
| Schema prefix | Not required | Required (e.g., dbo.table) |
| Parameters (PDO) | Named (:name) |
Positional (?) |
| Last insert ID | lastInsertId() |
SCOPE_IDENTITY() |
Security
Read Tool (SQLServerSelectTool)
| Status | Statements |
|---|---|
| ✅ Allowed | SELECT, WITH (CTE) |
| ❌ Blocked | INSERT, UPDATE, DELETE, DROP, CREATE, ALTER, TRUNCATE, MERGE, EXEC, EXECUTE, sp_executesql, xp_cmdshell, OPENROWSET, OPENDATASOURCE, BULK, INTO |
Write Tool (SQLServerWriteTool)
| Status | Statements |
|---|---|
| ✅ Allowed | INSERT, UPDATE, DELETE, MERGE |
| ❌ Blocked | DROP, CREATE, ALTER, GRANT, REVOKE, TRUNCATE, EXEC, EXECUTE, sp_executesql, xp_cmdshell, OPENROWSET, OPENDATASOURCE, BULK |
Additional Security Measures
- All queries use parameterized statements to prevent SQL injection
- SQL comments are stripped before validation
- The PDO instance can use dedicated credentials with limited database permissions
SELECT INTOis blocked to prevent table creation through the read tool
Toolkit Components
| Tool | Description |
|---|---|
SQLServerSchemaTool |
Discovers database structure (tables, views, columns, relationships, indexes, constraints) |
SQLServerSelectTool |
Executes read-only SELECT queries with positional parameters |
SQLServerWriteTool |
Executes write operations (INSERT, UPDATE, DELETE, MERGE) with positional parameters |
Troubleshooting
Error: "could not find driver"
Install the PDO SQL Server driver. See the Installation section.
Error: "Invalid object name"
Use schema-qualified table names: dbo.TableName instead of just TableName.
Error: "Login failed for user"
Verify your connection string and credentials. For Azure SQL, ensure your IP is allowed in the firewall rules.
Empty results from queries
An empty array [] is a valid result meaning no records matched. The toolkit instructs the LLM not to retry on empty results.
Connection timeout
Add timeout to your connection string:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Credits
- Adapted from Neuron AI MySQL Toolkit by Inspector.dev
- SQL Server adaptation by Izzuddin Mohsin
License
MIT License. See LICENSE for details.