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

azimutt

v0.1.7

Published

Export database schema from relational or document databases. Import it to https://azimutt.app

Downloads

581

Readme

Azimutt CLI

Azimutt CLI is aimed at helping you explore databases, schema but also data.

It works with relational and document ones, such as Couchbase, MariaDB, MongoDB, MySQL, PostgreSQL, SQL Server 🎉

Use this CLI without installing it thanks to npx: npx azimutt@latest.

Get the help simply by running the CLI (npx azimutt@latest) or for a specific command using npx azimutt@latest help export for example.

Available commands

  • gateway (npx azimutt gateway): launch the Gateway server locally to proxy database calls from your computer
  • explore (npx azimutt explore <url>): open Azimutt in your browser with the db url already configured (& start the Gateway server)
  • export (npx azimutt export <url> [arguments]): export a database schema as JSON file to import in Azimutt
    • ex: npx azimutt export bigquery://bigquery.googleapis.com/my-project?key=key.json
    • ex: npx azimutt export couchbases://cb.gfn6dh493pmfh613v.cloud.couchbase.com
    • ex: npx azimutt export mariadb://user:[email protected]:3306/my_db
    • ex: npx azimutt export "mongodb+srv://user:[email protected]"
    • ex: npx azimutt export mysql://user:[email protected]:3306/my_db
    • ex: npx azimutt export postgresql://postgres:postgres@localhost:5432/azimutt_dev
    • ex: npx azimutt export snowflake://user:[email protected]?db=my_db
    • ex: npx azimutt export Server=host.com,1433;Database=db;User Id=user;Password=pass
    • url the database connection url, must contain everything needed (user, pass, port...)
    • --database is optional, restrict extraction to this database or database pattern (using %)
    • --catalog is optional, restrict extraction to this catalog or catalog pattern (using %)
    • --bucket is optional, restrict extraction to this bucket or bucket pattern (using %)
    • --schema is optional, restrict extraction to this schema or schema pattern (using %)
    • --entity is optional, restrict extraction to this entity or entity pattern (using %)
    • --sample-size is optional, defines how many items are used to infer a schema (for document databases or json fields)
    • --mixed-json is optional, split collections given the specified json field (if you have several kind of documents in the same collection)
    • --infer-json-attributes is optional, if JSON fields should be fetched to infer their schema
    • --infer-polymorphic-relations is optional, if kind field on polymorphic relations should be fetched to know all relations
    • --infer-relations build relations based on column names, for example a user_id will have a relation if a table users has an id column
    • --ignore-errors is optional, do not stop export on errors, just log them
    • --log-queries is optional, log queries when executing them
    • --format is optional, default to json but for relational database it could also be sql
    • --output is optional, database name will be inferred from url and prefixed by the timestamp
    • --debug allows to see the full stack trace of the error (can be helpful to debug)

Developing

Start with npm run setup to install dependencies and set up the CLI, then you have:

  • npm run exec to compile and launch the CLI (use -- args for CLI args, ex: npm run exec -- export postgresql://postgres:postgres@localhost:5432/azimutt_dev), or npm run build && node lib/index.js
  • npm run start to launch it with live reload (same, use -- args to pass arguments to the CLI)
  • npm run test to launch tests

Publish

  • update package.json and src/version.ts versions
  • update lib versions (npm run update + manual) & run npm install
  • test with npm run dry-publish and check azimutt-x.y.z.tgz content
  • launch npm publish

View it on npm.

Dev

If you need to develop on multiple libs at the same time (ex: want to update a connector and try it through the CLI), depend on local libs but publish & revert before commit.

  • Depend on a local lib: npm install <path>, ex: npm install ../gateway
  • "Publish" lib locally by building it: npm run build