predrag.pro

Visualize your database

An npm tool to visualize your database
and generate SQL with a local Ollama model.

Visualize your database

Getting started

  1. Create a .env file with the following content:
  2. # Change the connection string DATABASE_URL=postgres://user:password@host:5432/database
  3. From the root folder where the .env file is present, run:

    $npx @predragnikolic/pn-show-db --db=postgres

    That will open a browser and visualize your database.

Currently only Postgres is supported.

Generate SQL code with a local Ollama model

There is support for local Ollama models such as phi3 or sqlcoder.

When the --ollama-model=MODEL_NAME argument is specified, a wand icon will appear in the top left corner.

Setup Ollama and Phi

Download Ollama.

Run $ollama run phi3 to install phi3.

To use phi3 with @predragnikolic/pn-show-db, run:

$npx @predragnikolic/pn-show-db --db=postgres --ollama-model=phi3

Христос васкрсе!