Coder Social home page Coder Social logo

plpgsql-pydebug's Introduction

Build Status

PL/pgSQL PyDebug

This is a CLI debugger for PL/pgSQL. It is in its early stages and rather archaic. It does make use of the pldbgapi extension for PostgreSQL. You can typically install it from the main PG repository.

Usage

  1. Checkout from GitHub
  2. Install requirements: pip3 install -r requirements.txt
  3. Ensure you have the pldbgapi extension installed (it will warn you if not)
  4. Start a debug session: ./run.py --dsn <dsn>. The <dsn> is the complete connection string to your running PostgreSQL instance.
  5. Start to debug a PL/pgSQL function by calling run <function call> (see below).

Shortcomings aka the list of shame

  • Output could be prettier / more readable.
  • Not everything tested.
  • Error handling might be incomplete, it could bail out and leave connections open.
  • source, brset commands do not yet work with other functions than the active target functions. In other words: you can use them only on functions which do not call other functions respectively you can step into them but not show their source or set breakpoints.
  • Not all commands from pldbgapi implemented.

Commands aka the list of fame

Currently, the following commands are available. There is no extensive syntax checking as of now, so you'll maybe run into trouble here and there.

  • run <function call> starts debugging, ensure that <function call> is complete with all arguments, i.e. like run example_function_1(2).
  • stop stops debugging.
  • continue causes the execution to proceed to the next breakpoint.
  • vars displays all variables of the current frame.
  • si step-into, step into a function call, stop at the next executable instruction/breakpoint.
  • so step-over, step over a function call, stop at the next executable instruction/breakpoint.
  • source show the source of the current target function. Does not yet take into account that you could have nested functions.
  • stack show the current stack.
  • brshow show all active breakpoints.
  • brset <line> set a breakpoint in the current target function at the given line. Caution: does not work with nested functions yet.
  • exit exits the debugger.

plpgsql-pydebug's People

Contributors

sdressler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.