PHPackages                             xp-forge/sql - 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. xp-forge/sql

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

xp-forge/sql
============

SQL Subcommand

v1.1.0(2y ago)022[1 issues](https://github.com/xp-forge/sql/issues)BSD-3-ClausePHPPHP &gt;=7.0.0

Since May 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/xp-forge/sql)[ Packagist](https://packagist.org/packages/xp-forge/sql)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-forge-sql/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (3)Versions (12)Used By (0)

SQL subcommand
==============

[](#sql-subcommand)

[![Build status on GitHub](https://github.com/xp-forge/sql/workflows/Tests/badge.svg)](https://github.com/xp-forge/sql/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/6846f69b658ac9813b54b08c853ef5e1a81e4542b1bce31b6eb610e2d73fe647/68747470733a2f2f706f7365722e707567782e6f72672f78702d666f7267652f73716c2f76657273696f6e2e737667)](https://packagist.org/packages/xp-forge/sql)

SQL command line tool using XP database drivers.

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

[](#installation)

```
$ composer global require xp-forge/sql 'dev-master'
```

Usage
-----

[](#usage)

```
$ xp help sql
@FileSystemCL
Runs SQL statements
════════════════════════════════════════════════════════════════════════

> Execute a single SQL statement and print the results

  $ xp sql 'sqlite://./test.db' 'select * from test'

> Change output mode by appending -m and one of csv, vert

  $ xp sql 'sqlite://./test.db' 'select * from test;-m csv'

> Read SQL statement from standard input using "-"

  $ cat statement.sql | xp sql 'sqlite://./test.db' -

> Use named connections as configured in connections.ini.

  $ xp sql dev-db 'select * from account where id = 1'

The file connections.ini is per-user and can be found in one of:

> %LOCALAPPDATA%/Xp-forge.sql/ on Windows
> $XDG_CONFIG_HOME/xp-forge.sql/ inside an XDG environment
> $HOME/.xp-forge.sql/ otherwise

Invoking without arguments shows a list of available drivers.
```

*The `-m [vert,csv]` syntax is inspired by SQSH, see *

Drivers
-------

[](#drivers)

```
$ xp sql
@FileSystemCL
Available drivers via rdbms.DefaultDrivers
════════════════════════════════════════════════════════════════════════

> mysql+x: rdbms.mysqlx.MySqlxConnection
  Connection to MySQL Databases

> mysql+std: rdbms.mysql.MySQLConnection
  Connection to MySQL Databases via ext/mysql

> sybase+x: rdbms.tds.SybasexConnection
  Connection to Sybase Databases via TDS 5.0

> mssql+x: rdbms.tds.MsSQLxConnection
  Connection to MSSQL Databases via TDS 7.0

> sqlite+3: rdbms.sqlite3.SQLite3Connection
  Connection to SQLite 3.x Databases via ext/sqlite3
```

Examples
--------

[](#examples)

```
$ xp sql 'sqlite://./test.db' 'create table test (
  id integer primary key autoincrement,
  name varchar
)'
Query OK, 0 rows affected (0.02 sec)

$ xp sql 'sqlite://./test.db' 'insert into test (name) values ("Timm")'
Query OK, 1 rows affected (0.02 sec)

$ xp sql 'sqlite://./test.db' 'select * from test where id = 1'
id: 1
name: "Timm"

1 rows in set (0.00 sec)
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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

Every ~276 days

Recently: every ~362 days

Total

10

Last Release

782d ago

Major Versions

v0.5.0 → v1.0.02020-04-04

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (41 commits)")

---

Tags

command-linephpsqlxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-forge-sql/health.svg)

```
[![Health](https://phpackages.com/badges/xp-forge-sql/health.svg)](https://phpackages.com/packages/xp-forge-sql)
```

###  Alternatives

[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

4407.3M293](/packages/doctrine-doctrine-orm-module)[doctrine/doctrine-module

Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules

3957.9M116](/packages/doctrine-doctrine-module)[doctrine/doctrine-mongo-odm-module

Laminas Module which provides Doctrine MongoDB ODM functionality

86676.6k35](/packages/doctrine-doctrine-mongo-odm-module)

PHPackages © 2026

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