Skip to main content

A web-based MySQL/MariaDB GUI editor

Project description

Lagun

Lagun

A minimal, web-based MySQL/MariaDB GUI editor. Install it, run it, use it.

Features

  • Web-based SQL editor with syntax highlighting, autocompletion, and multi-tab support
  • Multi-statement execution — run multiple statements at once, each result shown in its own sub-tab
  • Schema browser — explore databases, tables, columns, and indexes; resizable sidebar
  • Schema management — create, modify, and drop tables, columns, and indexes
  • In-line data editing — edit cells, insert rows, delete rows directly in the grid
  • Import & export — CSV and SQL formats with streaming for large datasets; export respects active column filters
  • Query history — full SQL with word wrap, copy or load any entry back into the editor
  • Bookmarks — save and organize frequently used tables
  • Connection management — import and export connection configs
  • Secure connections — SSL/TLS, credentials stored in OS keyring, encrypted session backup
  • LDAP/AD authentication — optional, via ldapgate

Install

pip install lagun

Usage

lagun serve

Opens the GUI in your browser. Connect to any MySQL or MariaDB database from there.

Options:

--host TEXT          Bind host. [default: 127.0.0.1]
--port INTEGER       Bind port. [default: 8080]
--no-open            Don't open the browser automatically.
--ldap-config PATH   Path to ldapgate YAML config to enable LDAP authentication.

LDAP Authentication

Lagun can require users to log in via LDAP/AD before accessing the editor. This uses ldapgate as FastAPI middleware — no separate proxy process needed.

pip install 'lagun[ldap]'
lagun serve --ldap-config /path/to/ldapgate.yaml

Shared connections and audit log

For LDAP deployments, an administrator can provide connections centrally and limit each one to selected LDAP usernames:

export LAGUN_DBS_PASSWORD='database-password'
lagun serve --ldap-config /etc/lagun/ldap.yaml --connections-config /etc/lagun/connections.yaml
connections:
  - id: dbs-production
    name: DBS Production
    host: mariadb.internal
    port: 3306
    username: shared_mariadb_user
    password_env: LAGUN_DBS_PASSWORD
    default: true
    selected_databases: [app, analytics]
    allowed_users: [alice, bob]

Listed users can use the connection but cannot edit it. Removing it in the UI only hides it for that user. LDAP users may also create private connections; those are visible only to their owner. Edit this file and restart Lagun to change shared access. Set selected_databases to limit the visible schema browser/search scope for a managed connection; omit it or use an empty list to show all non-system schemas the database user can access.

LDAP API activity is recorded in Lagun's local lagun.db, not in MariaDB. By default that database is ~/.lagun/lagun.db; set LAGUN_DB to relocate the whole local store (saved connections, settings, and audit events), for example LAGUN_DB=/var/lib/lagun/lagun.db. Read it from the server with lagun audit and purge old entries with lagun audit purge --older-than 90.

For direct local HTTP usage, set proxy.secure_cookies: false in the ldapgate config. Keep secure_cookies: true in production and run Lagun behind HTTPS with trusted_proxies configured so LDAPGate can honor X-Forwarded-Proto.

When LDAP is enabled, a logout button appears in the top-right corner of the tab bar.

See the ldapgate README for config file documentation.

Screenshots

SQL Editor Schema View Data View with Search Data View with Filter

Development

Requires uv.

git clone https://github.com/anudeepd/lagun
cd lagun
uv sync
uv run lagun serve

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lagun-0.1.36.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lagun-0.1.36-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file lagun-0.1.36.tar.gz.

File metadata

  • Download URL: lagun-0.1.36.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lagun-0.1.36.tar.gz
Algorithm Hash digest
SHA256 dccf1c266a7fe8d8c0e0968ac0a08bac8b525573d6f188d29dfa9592932c9ff9
MD5 87427f01c3c34abaf83799ce59f66cb5
BLAKE2b-256 95c6629d6d8e1c41649bc43d6eefeaec2cfe15f111421200b53199f215c7e364

See more details on using hashes here.

File details

Details for the file lagun-0.1.36-py3-none-any.whl.

File metadata

  • Download URL: lagun-0.1.36-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lagun-0.1.36-py3-none-any.whl
Algorithm Hash digest
SHA256 38b4eb20676e20984a119d183178a4229b7d70c8503c0e742a7a3c33b5b6c2e3
MD5 97f7598cfc96058f0749679f83647c31
BLAKE2b-256 74ad388fa341eeb5a726c05d7e6b056469349b61e95cfdc0ab8ee7ece7d705af

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page