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 🙏

© 2025 – Pkg Stats / Ryan Hefner

adfarmtosql

v1.0.0

Published

Quickly Create SQL Schemas from Azure Data Factory ARM Templates

Readme

Quickly Create SQL Schemas from Azure Data Factory

When using Azure Data Factory it can be time consuming to create schemas for your data warehouse landing tables automatically from your source data - especially if you have a lot of tables and columns to think about.

This node script reads the ARM template from your ADF data pipeline and creates a set of create table SQL statements. All columns are created with nvarchar(512) (which you can change!) with the idea that the casting will occur in your stored proc processing from landing to your final dw schema.

Instructions

  • Install the npm app
npm install -g adfarmtosql
  • Download the ARM template from your ADF instance

arm

  • Run the app passing in the path to the ARM template

Note: Run the app from the folder that you want to save the output in

adfarmtosql -p "C:\Users\jak\demo\demo42\arm_template.json"

Editing and running locally

By default, the app is very generic. If you need to make some changes to the output you can run locally to make any changes you need.

  • Get the code
git pull https://github.com/jakkaj/ADFArmSchemaExtract
  • Restore npm packages
npm install
  • Type npm run watch. This command is long running and will not exit. It watches the typescript code for changes and will automatically rebuild when changes are detected.

  • Type npm run outputwatch. This is also long running and will watch the built outputs from the typescript watcher and automatically re-run the app... so you can edit/view the result nice and fast without having to manually restart the app each time.

  • Save index.ts to kick-off the rebuild and run.

Make any edits you need to the tile to get your outputs as you need!

Outputs will be saved to ./sqloutputs. Each table will be in its own file. all.txt contains all the SQL statements in one file to run easily on your server.

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [lnd].[companyaccounts_gateways](
	[_id] [nvarchar](512) NULL,
	[companyaccounts_gateways_dim1_idx] [nvarchar](512) NULL,
	[created_at] [nvarchar](512) NULL,
	[updated_at] [nvarchar](512) NULL,
	[name] [nvarchar](512) NULL,
	[username] [nvarchar](512) NULL,
	[password] [nvarchar](512) NULL,
	[type] [nvarchar](512) NULL,
	[gateways._id] [nvarchar](512) NULL,
	[default] [nvarchar](512) NULL,
	[mode] [nvarchar](512) NULL,
	[merchant] [nvarchar](512) NULL,
	[meta_real_time_card] [nvarchar](512) NULL
) ON [PRIMARY]
GO