GithubHelp home page GithubHelp logo

jeffpapp / mssql-schema-reader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fredlackey/mssql-schema-reader

0.0 0.0 0.0 446 KB

Retrieves schema layout from Microsoft SQL Server to assist with code generation. LocalDb is not currently supported.

License: MIT License

JavaScript 100.00%

mssql-schema-reader's Introduction

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

mssql-schema-reader's People

Contributors

fredlackeyofficial avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.