Skip to content

wooly905/PRS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prs NuGet latest version MIT license

PRS

A simple command-line tool to query database schema in Microsoft SQL Server

Introduction:

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.

pic1 pic2 pic3

How to use this tool:

pic4

Setup connection string (prs wcs)

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.

pic5

Show connection string (prs scs)

pic6

Dump schema to local machine (prs dds [schema name])

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.

pic7

Find table (prs ft) - table name can be partial

When running any query command (ft, fc, ftc, fsp, sc), PRS prints the active schema in use, e.g., “Using schema: database1.schema.txt”.

pic8

Find column (prs fc) - find matched column in all tables

pic9

Find column in table(s) (prs ftc)

pic10

Display all columns of a table (shows FK info)

image

Find stored procedure

prs fsp [full or partial name of a storec procedure to find]

Manage multiple schemas

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.

About

A simple command-line tool to query database schema in Microsoft SQL Server

Topics

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages