pgEdit resource topics.

pgEdit TextMate Help


pgEdit is a TextMate bundle for working with PostgreSQL relational databases. It supports PostgreSQL specific syntax coloring (e.g. dollar quoting), SQL execution, context specific help, completion, and recognition of SQL language constructs (tables, functions, triggers, etc.). pgEdit uses psql for executing SQL and takes advantage of many psql features.


HTML and DocBook output

If you need to produce documentation with SQL source code, pgEdit has several commands you might find useful. The Copy for HTML command copies the selected source text to the clipboard in HTML format. The HTML consists of a PRE element with SPAN elements to describe the syntax coloring. The CSS From Syntax Colors command can be used to copy a cascading style sheet (CSS) fragment to the clipboard with your current color settings. This allows you to modify the syntax coloring used in any HTML page by having them all refer to the same CSS file.

The Copy for DocBook command performs a similar function in creating a DocBook ProgramListing element with syntax coloring information on the clipboard. The XSL From Syntax Colors command puts the XSL style sheet information for the current color settings on the clipboard. This information, along with the CSS style information, allows DocBook to be used to produce syntax colored program listings for both HTML and PDF output.

Here is a short trigger function to illustrate the HTML output:


Using EXPLAIN in pgEdit

pgEdit has three commands to execute variations of PostgreSQL's EXPLAIN command. In PostgreSQL this command is used to provide execution plan information about the SQL statement. All three forms of the pgEdit command make it easy to use EXPLAIN for anything in your file without making modifications. The pgEdit Explain command simply executes the current SQL line containing the cursor with PostgreSQL's EXPLAIN keyword prepended to the statement. Similarly, the Explain Analyze command prepends EXPLAIN ANALYZE which actually executes the command giving actual rather than estimated statistics.


Why pgEdit?

Editors are for application development

There are many PostgreSQL development and administration tools available, and some are free. But pgEdit is the first editor optimized solely for PostgreSQL development. The typical PostgreSQL tool gives a big tree view of databases, schemas, tables, functions and so on (pgEdit will eventually have one too). This is fine for administration or simple development tasks, but gets in the way of developing complex database applications. The key issue is that an editor provides locality - you can group related tables, functions, triggers, and other database objects together in a file. As with other software development, you can build version controlled files of logically related objects rather than trying to work from a from a big tree view of objects listed by type and in alphabetical order.


Subscribe to RSS - pgEdit