{"id":18550286,"url":"https://github.com/xp-forge/sql","last_synced_at":"2026-01-24T02:02:53.642Z","repository":{"id":57084826,"uuid":"92814672","full_name":"xp-forge/sql","owner":"xp-forge","description":"SQL Subcommand","archived":false,"fork":false,"pushed_at":"2024-10-05T11:14:37.000Z","size":36,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T01:47:21.070Z","etag":null,"topics":["command-line","php","sql","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-forge.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-30T08:55:55.000Z","updated_at":"2024-10-05T11:14:41.000Z","dependencies_parsed_at":"2022-08-24T14:59:11.741Z","dependency_job_id":null,"html_url":"https://github.com/xp-forge/sql","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-forge","download_url":"https://codeload.github.com/xp-forge/sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250546039,"owners_count":21448255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","php","sql","xp-framework"],"created_at":"2024-11-06T21:04:06.615Z","updated_at":"2026-01-24T02:02:48.609Z","avatar_url":"https://github.com/xp-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"SQL subcommand\n==============\n\n[![Build status on GitHub](https://github.com/xp-forge/sql/workflows/Tests/badge.svg)](https://github.com/xp-forge/sql/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-forge/sql/version.svg)](https://packagist.org/packages/xp-forge/sql)\n\nSQL command line tool using XP database drivers.\n\n## Installation\n\n```bash\n$ composer global require xp-forge/sql 'dev-master'\n```\n\n## Usage\n```bash\n$ xp help sql\n@FileSystemCL\u003c./src/main/php\u003e\nRuns SQL statements\n════════════════════════════════════════════════════════════════════════\n\n\u003e Execute a single SQL statement and print the results\n\n  $ xp sql 'sqlite://./test.db' 'select * from test'\n\n\u003e Change output mode by appending -m and one of csv, vert\n\n  $ xp sql 'sqlite://./test.db' 'select * from test;-m csv'\n\n\u003e Read SQL statement from standard input using \"-\"\n\n  $ cat statement.sql | xp sql 'sqlite://./test.db' -\n\n\u003e Use named connections as configured in connections.ini.\n\n  $ xp sql dev-db 'select * from account where id = 1'\n\n\nThe file connections.ini is per-user and can be found in one of:\n\n\u003e %LOCALAPPDATA%/Xp-forge.sql/ on Windows\n\u003e $XDG_CONFIG_HOME/xp-forge.sql/ inside an XDG environment\n\u003e $HOME/.xp-forge.sql/ otherwise\n\nInvoking without arguments shows a list of available drivers.\n```\n\n*The `-m [vert,csv]` syntax is inspired by SQSH, see http://manpages.ubuntu.com/manpages/precise/man1/sqsh.1.html*\n\n## Drivers\n\n```bash\n$ xp sql\n@FileSystemCL\u003c./src/main/php\u003e\nAvailable drivers via rdbms.DefaultDrivers\n════════════════════════════════════════════════════════════════════════\n\n\u003e mysql+x: rdbms.mysqlx.MySqlxConnection\n  Connection to MySQL Databases\n\n\u003e mysql+std: rdbms.mysql.MySQLConnection\n  Connection to MySQL Databases via ext/mysql\n\n\u003e sybase+x: rdbms.tds.SybasexConnection\n  Connection to Sybase Databases via TDS 5.0\n\n\u003e mssql+x: rdbms.tds.MsSQLxConnection\n  Connection to MSSQL Databases via TDS 7.0\n\n\u003e sqlite+3: rdbms.sqlite3.SQLite3Connection\n  Connection to SQLite 3.x Databases via ext/sqlite3\n```\n\n## Examples\n\n```bash\n$ xp sql 'sqlite://./test.db' 'create table test (\n  id integer primary key autoincrement,\n  name varchar\n)'\nQuery OK, 0 rows affected (0.02 sec)\n\n$ xp sql 'sqlite://./test.db' 'insert into test (name) values (\"Timm\")'\nQuery OK, 1 rows affected (0.02 sec)\n\n$ xp sql 'sqlite://./test.db' 'select * from test where id = 1'\nid: 1\nname: \"Timm\"\n\n1 rows in set (0.00 sec)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-forge%2Fsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fsql/lists"}