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 🙏

© 2026 – Pkg Stats / Ryan Hefner

pptb-forge-sql

v1.0.0

Published

Write and execute SQL against Dataverse — SELECT, INSERT, UPDATE, and DELETE. Translates to FetchXML and Web API calls.

Readme

Forge SQL

Write and execute SQL against Dataverse — SELECT, INSERT, UPDATE, and DELETE. Translates to FetchXML and Web API calls, with a Monaco-powered editor, schema autocomplete, and built-in safeguards for destructive operations.

Forge SQL is inspired by Mark Carrington's SQL4CDS and serves as a lightweight alternative within Power Platform ToolBox until SQL4CDS is fully ported.


Features

  • SQL editor powered by Monaco with context-aware autocomplete (entities, attributes)
  • Schema browser sidebar — collapsible entity tree loaded from Dataverse metadata
  • FetchXML inspector — view, copy, and inspect the generated FetchXML for every query
  • Results grid with sorting, column resizing, pagination, and CSV/JSON export
  • Query history with search, re-run, and pin — persisted via ToolBox settings
  • Full DML support: INSERT, UPDATE, DELETE with execution safeguards
  • Execution timing and row count in the status bar
  • Light/dark theme support via Power Platform Toolbox

Supported SQL

SELECT

SELECT [DISTINCT] [TOP n] <columns | aggregates | *>
FROM <entity> [AS alias]
[INNER | LEFT JOIN <entity> AS alias ON <condition>]
[WHERE <conditions>]
[GROUP BY <columns>]
[HAVING <conditions>]
[ORDER BY <columns> [ASC | DESC]]

Supported aggregates: COUNT, SUM, AVG, MIN, MAX

INSERT

-- Single row
INSERT INTO <entity> (col1, col2) VALUES (val1, val2)

-- Multi-row
INSERT INTO <entity> (col1, col2) VALUES (val1, val2), (val3, val4)

UPDATE

-- WHERE clause is required
UPDATE <entity> SET col1 = val1, col2 = val2 WHERE <conditions>

DELETE

-- WHERE clause is required
DELETE FROM <entity> WHERE <conditions>

DML Safeguards

UPDATE and DELETE without a WHERE clause are rejected at parse time. For operations that do have a WHERE clause, additional safeguards apply based on the number of affected rows:

| Safeguard | INSERT | UPDATE | DELETE | |------------------------|----------------|-----------------|---------------| | WHERE clause required | N/A | Yes | Yes | | Row count preview | N/A | Yes | Yes | | Sample data preview | No | Optional | Yes | | Confirmation dialog | No (low risk) | >10 records | Always | | Type-to-confirm | No | >100 records | >50 records | | Batch progress | >10 rows | Always | Always | | Cancel mid-batch | >10 rows | Yes | Yes |


Examples

-- Query active accounts, most valuable first
SELECT TOP 10 name, revenue FROM account WHERE statecode = 0 ORDER BY revenue DESC

-- Join contacts to their parent account
SELECT a.name, c.fullname FROM account a INNER JOIN contact c ON a.accountid = c.parentcustomerid

-- Count accounts by status
SELECT statecode, COUNT(accountid) FROM account GROUP BY statecode

-- Insert a record
INSERT INTO account (name, revenue) VALUES ('Contoso Ltd', 50000)

-- Insert multiple records
INSERT INTO account (name, revenue) VALUES ('Contoso Ltd', 50000), ('Fabrikam', 75000)

-- Update inactive accounts
UPDATE account SET revenue = 0 WHERE statecode = 1

-- Delete inactive contacts
DELETE FROM contact WHERE statecode = 1

Installation

npm install
npm run build

Once built, install the tool in Power Platform Toolbox and load it from the ToolBox interface.


Development

# Start dev server with hot module replacement
npm run dev

# Production build
npm run build

# Preview production build
npm run preview

# Run tests
npm run test

The test suite covers the SQL parser and FetchXML generator (203 tests across SELECT and DML).


License

MIT