Skip to content

Suprematistic hackable GUI SQL-manager written in SQL itself

License

Notifications You must be signed in to change notification settings

mgramin/malewicz

Repository files navigation

Malewicz

Hackable GUI SQL-manager written in SQL itself (and a pinch of the HTML templates).

"If you want something done, do it yourself. Yep!"

Jean-Baptiste Emanuel Zorg, "The Fifth Element", 1997.

Malewicz is a cross-platform Database GUI tool for developers, SQL programmers, DBAs and data analysts.

Try Malewicz on Heroku

space

table

Current status

⚠️ This experimental project is in early development phase. If you have ideas, feel free to text me, create a PR or open an issue.

What is Malewicz?

Malewicz is Yet Another WEB client for DB schema exploring and performance analysis. Something like PgHero, Pgweb or even phpMyAdmin, but with some key features:

  • Hackable - Malewicz was originally created specifically for hacking and extending (template driven, live reload)
  • Suprematistic - use only your SQL skills (and a little bit HTML) without any noisy boilerplate code
  • Template driven - we use all power of Jinja
  • Lightning-fast AJAX web interface - but without a single line of JavaScript (we use Hotwire Turbo)
  • Simple and powerful integration with awesome tools, for charts, diagrams etc.
  • Strong bodrer - between SQL-scripts (it's our main value) and representation templates
  • Reusable SQL-queries - you can reuse queries in other contexts and database tools.

Embedded SQL editor

Malewicz has no embedded SQL editor. Instead, you might use your favorite code editor (like Vim or VS Code) or IDE (like DBeaver or DataGrips) for edit plain sql-files.

We were inspired by

  • dbt - Just drop your SQL-queries to your repository and the magic happens
  • YeSQL - Keep the SQL as SQL
  • Treat your Database as Code

Run from sources

Init and activate virtual env (optional):

virtualenv .venv
source .venv/bin/activate

Install dependencies:

pip3 install -r requirements.txt

Set database connection parameters in config.toml file or set environment variable DATABASE_URL with datbase URI:

postgres://[USER]:[PASSWORD]@[HOST]:5432/[DATABASE]

Run:

python app.py

Run from Docker

cd demo
docker-compose up -d

SQL scripts conventions

  • Use Python-style naming for parameters: %(schema_name)s, %(max_table_count)s
  • Keep to axis when formatting

Recomended VS Code plugins

For productive and fast work with SQL scripts and Jinja2 templates we use Visual Studio Code with some additional plugins:

  • Better Jinja - Syntax highlighting for jinja(2) including HTML, SQL, JSON, Markdown and other templates.

About

Suprematistic hackable GUI SQL-manager written in SQL itself

Resources

License

Stars

Watchers

Forks

Packages

No packages published