npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mssql-schema-reader

v1.0.9

Published

Saves SQL Server (MSSQL) schema to JSON or file.

Downloads

16

Readme

Microsoft SQL Server Schema Reader (mssql-schema-reader)

Retrieves schema layout from Microsoft SQL Server (aka "MSSQL") and persists to either JSON or file (or both). LocalDb is not currently supported.

Author & Usage

Having written code for the Microsoft platform since the 80's, and deeply planted in the .NET world, I prefer the design tool provided by SQL Server Management Studio. However, these days, more and more of my work in on NodeJS and the MEAN Stack. The Microsoft SQL Server Schema Reader is just one more tool to help me bridge the gap. This will eventually be at the heart of code generator focused on allowing me to design on the Microsoft platform but develop on any. When the day comes in which another data modeling tool works as well as SQL Server's, I may completely jump ship.

Thanx,
Fred Lackey
[email protected]


Requirements

This module has been tested with Microsoft SQL Server 2014. According to the documentation of the underlying drivers, this module should work with Microsoft SQL Server 2000 and above. Please drop me a quick email with your results if you choose to use it with any version other than 2014: [email protected]

Limitations

LocalDb is currently not supported. The underlying driver uses the TDS Protocol which does not currently support LocalDb. I will be happily enhance the project if you find a driver that does support LocalDb. Just shoot me an email and let me know what you found.

Installation

The target platform is NodeJS, therefore the install command shall be...

npm install --save mssql-schema-reader

Files & Folders

The contents of the project are as follows:

/
|--/lib							The "guts" of the module, of course.
|--/samples						Sample files for your pleasure:
   |-- config.json.js			Config file used by the TDS driver.      
   |-- schema-info.json			Raw content pulled down from the server.      
   |-- schema-pretty.json		Schema file rendered from saved "info" file.
   |-- TestDatabase20150922.sql	Script file used to create sample database.        
|--/tests
   |-- saveInfo.js				Simple test method used during development.        
|--index.js						Main entry point of module.

Usage & Limitations

Raw Data (Info Commands)

Several queries are executed against the SQL Server database to learn about the database schema. This raw information is used by the schema parser, to create your pretty schema document, and may be stored for later offline use. You should never have to look at these, but they are there if you would like to use them.

Pretty Data (Schema Commands)

The raw data (from the info commands) are passed to the Schema Parser to create the schema object. These are generally the commands you want to work with.

Commands

createConfig
Convenience method to help build a simple config object needed by the connection.

See the following page for more info on the Config object:
www.npmjs.com/package/mssql#connection

info.fromServer or schema.fromServer
Retrieves the needed data from the server. This data is not saved to disk. The info. version will return raw data. The schema. version will retrieve the hierarchical schema object.

info.fromServerToDisk or schema.fromServerToDisk
Same as the fromServer commands, however the data is written to disk. The file at the target path will be overwritten.

info.fromDisk or schema.fromDisk
Retrieves the needed data from the disk. The server is not contacted.


Last updated: 9/23/2015 6:05:00 PM