A simple command-line tool to query database schema in Microsoft SQL Server
This is a tool to help you quickly search the names of objects (columns, tables, stored procedure) in Microsoft SQL server. This tool has been released as a dotnet global tool. You can install it by the following dotnet command,
dotnet tool install wooly905.prs -g
The followings are the examples to show you how to use this tool.
The following screenshots show you the tables and columns created by Hangfire.
This is the first thing to do for this tool. Make sure your connection string is good with correct host URL, database name, username, and password.
This command dumps the database schema into your local user folder. Schema name is required and determines the saved file name.
Examples:
prs dds database1
Notes:
- Schemas are saved under your user profile: %APPDATA%.prs\schemas
- The saved file is .schema.txt and becomes the active schema after dump.
- All query commands use the active schema.
When running any query command (ft, fc, ftc, fsp, sc), PRS prints the active schema in use, e.g., “Using schema: database1.schema.txt”.
prs fsp [full or partial name of a storec procedure to find]
PRS supports storing multiple schemas locally and switching between them.
- List saved schemas and show the active one
prs ls
- Switch active schema (by schema name, not file name)
prs use [schema name]
- Remove a saved schema (by schema name)
prs rm [schema name]
Notes:
- Query commands always read from the active schema.
- The active schema pointer is stored under %APPDATA%.prs\active.txt.