{"id":13578417,"url":"https://github.com/ng-galien/idea-plpgdebugger","last_synced_at":"2025-04-13T06:41:21.541Z","repository":{"id":40320437,"uuid":"443523860","full_name":"ng-galien/idea-plpgdebugger","owner":"ng-galien","description":"A plugin to debug PL/pg in Intellij","archived":false,"fork":false,"pushed_at":"2024-11-27T16:12:56.000Z","size":4107,"stargazers_count":53,"open_issues_count":15,"forks_count":8,"subscribers_count":7,"default_branch":"241","last_synced_at":"2025-03-24T11:43:29.932Z","etag":null,"topics":["datagrip-plugin","intellij","intellij-plugin","kotlin","plpgsql","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ng-galien.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ng-galien"}},"created_at":"2022-01-01T11:21:16.000Z","updated_at":"2025-03-21T03:52:56.000Z","dependencies_parsed_at":"2024-02-04T10:31:58.352Z","dependency_job_id":"31b75846-e4c7-4279-820f-6b2fc0369b60","html_url":"https://github.com/ng-galien/idea-plpgdebugger","commit_stats":{"total_commits":328,"total_committers":8,"mean_commits":41.0,"dds":0.6371951219512195,"last_synced_commit":"e23408f5854384b853bd71c3c92803e26648ed86"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":"JetBrains/intellij-platform-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ng-galien%2Fidea-plpgdebugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ng-galien%2Fidea-plpgdebugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ng-galien%2Fidea-plpgdebugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ng-galien%2Fidea-plpgdebugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ng-galien","download_url":"https://codeload.github.com/ng-galien/idea-plpgdebugger/tar.gz/refs/heads/241","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248675434,"owners_count":21143763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["datagrip-plugin","intellij","intellij-plugin","kotlin","plpgsql","postgresql"],"created_at":"2024-08-01T15:01:30.428Z","updated_at":"2025-04-13T06:41:21.498Z","avatar_url":"https://github.com/ng-galien.png","language":"Kotlin","funding_links":["https://github.com/sponsors/ng-galien"],"categories":["Kotlin"],"sub_categories":[],"readme":"# Intellij PL/pg SQL debugger\n\n![Build](https://github.com/ng-galien/idea-plpgdebugger/workflows/Build/badge.svg)\n[![Version](https://img.shields.io/jetbrains/plugin/v/18419-postgresql-debugger.svg)](https://plugins.jetbrains.com/plugin/18419-postgresql-debugger)\n[![Downloads](https://img.shields.io/jetbrains/plugin/d/18419-postgresql-debugger.svg)](https://plugins.jetbrains.com/plugin/18419-postgresql-debugger)\n\n\u003c!-- Plugin description --\u003e\nDebug PL/pg stored procedures, functions, triggers and views from Intellij IDEs (Ultimate only)\n\n## Features\n\n- Debug queries from editor by selecting a [function call](#debug-a-routine-from-the-editor)\n- Debug routines and triggers from [database explorer](#debug-a-routine-from-the-database-explorer)\n- Full support for variables inspection with [Docker custom debugger](https://github.com/ng-galien/idea-plpgdebugger/blob/221/docker/README.md)\n\nVisit the plugin [page](https://plugins.jetbrains.com/plugin/18419-postgresql-debugger) at JetBrains.  \nReport a bug or a problem =\u003e [Create an issue](https://github.com/ng-galien/idea-plpgdebugger/issues/new/choose)\n\u003c!-- Plugin description end --\u003e\n\n## Getting started\n\n### Install the debugger on the server\n\nYou can use the plugin with the standard pldbgapi extension, but you will not be able to inspect every variable type.  \nTo get the full experience, you can use an [enhanced version](https://github.com/ng-galien/pldebugger) with the plugin.  \n\nYou can compile the extension from the source code or use one of the [Docker images](https://hub.docker.com/repository/docker/galien0xffffff/postgres-debugger/general) available.\n\n\u003e The Docker image is based on the official PostgreSQL image and includes the debugger extension, from version 11 to 16 for amd64 and arm64.\n\u003e To build your own image, you can use the [Dockerfile](https://github.com/ng-galien/pldebugger/tree/print-vars/docker) provided.\n\n```shell\ndocker run -p 5515:5432 --name PG15-debug -e POSTGRES_PASSWORD=postgres -d galien0xffffff/postgres-debugger:15\n```\n\nOr install the [debugger](https://www.pgadmin.org/docs/pgadmin4/development/debugger.html) binaries on  your machine.\n\n### Activate the debugger on the database\n\nRun the following command on the database where you want to debug routines\n\n```sql\n--Take care to install the extension on the public schema\nCREATE EXTENSION IF NOT EXISTS pldbgapi;\n```\n\n### Debug a routine from the editor\n\nJust write a statement using the function you want to debug\n\n```sql\n--This is a statement in a console or in a file\nSELECT function_name(args);\n```\n(click on the debug icon on the top left of the editor)\n\n![](img/direct.gif)\n\n### Debug a routine from the database explorer\n\n![](img/indirect.gif)\n\n(Right-click on the routine you want to debug and select \"Debug Routine\")\n\n### Variable inspection\n\nIn the variables tab you can inspect:\n- Primitive types\n- Arrays\n- JSON\n\nWith the docker image you can also inspect:\n- Composite types\n- Record types\n\n![](img/inspect-variables.png)\n\n### Inline values\n\nArguments and variables are displayed in the code editor  \n\n![](img/inline-variables.png)\n\n### Debug process\n\nThe debug session is displayed as a background process. You can stop it by clicking on the stop icon. \n\nWhen you stop the debug session, the process is killed on the server side.  \n\nIf you debug a routine from the code editor, the process is automatically killed when you close the editor.  \n\nIf you debug a routine from the database explorer, the process remains active until you stop manually.\n\n![](img/background-process.png)\n\n## Limitation of the standard pldbgapi\n\nThe standard pldbgapi does not send back composite variable, but you can put it in arrays to inspect them.\n\n## Installation\n\n### Debugger binaries\n\nYou must first install the debugger extension and activate the shared library onto the server.  \n\n```shell\nEXPORT TAG = 11 # or 11, 12, 13, 14, 15\nEXPORT PG_LIB=postgresql-server-dev-${TAG}\nEXPORT PG_BRANCH=REL_${TAG}_STABLE\nEXPORT PLUGIN_BRANCH=print-vars\n\n# Install dependencies\napt --yes update \u0026\u0026 apt --yes upgrade \u0026\u0026 apt --yes install git build-essential libreadline-dev zlib1g-dev bison libkrb5-dev flex $PG_LIB \\\n#\ncd /usr/src/\n# Install postgres source\ngit clone -b $PG_BRANCH --single-branch https://github.com/postgres/postgres.git\n# Setup postgres\ncd postgres \u0026\u0026 ./configure\n# Install debugger extension\ncd /usr/src/postgres/contrib\ngit clone -b $PLUGIN_BRANCH --single-branch https://github.com/ng-galien/pldebugger.git\ncd pldebugger\n# Compile with the same options as postgres\nmake clean \u0026\u0026 make USE_PGXS=1 \u0026\u0026 make USE_PGXS=1 install\n```\n\nFollow these [instructions for PgAdmin](https://www.pgadmin.org/docs/pgadmin4/development/debugger.html) for a standard installation.\n\n\n### Intellij IDE\n\n- Using IDE built-in plugin system:\n  \n  \u003ckbd\u003eSettings/Preferences\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003eMarketplace\u003c/kbd\u003e \u003e \u003ckbd\u003eSearch for \"idea-plpgdebugger\"\u003c/kbd\u003e \u003e\n  \u003ckbd\u003eInstall Plugin\u003c/kbd\u003e\n  \n- Manually:\n\n  Download the [latest release](https://github.com/ng-galien/idea-plpgdebugger/releases/latest) and install it manually using\n  \u003ckbd\u003eSettings/Preferences\u003c/kbd\u003e \u003e \u003ckbd\u003ePlugins\u003c/kbd\u003e \u003e \u003ckbd\u003e⚙️\u003c/kbd\u003e \u003e \u003ckbd\u003eInstall plugin from disk...\u003c/kbd\u003e\n\n---\nPlugin based on the [IntelliJ Platform Plugin Template][template].\n\n[template]: https://github.com/JetBrains/intellij-platform-plugin-template\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fng-galien%2Fidea-plpgdebugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fng-galien%2Fidea-plpgdebugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fng-galien%2Fidea-plpgdebugger/lists"}