Using TextMate for SQL queries
TextMate offers an SQL bundle. That bundle can also be used to query MySQL and PostgreSQL databases directly from TextMate. The configuration for the database access is done though environment variables. Specifically the following ones in the case of PostgreSQL: PGHOST: Database host PGPORT: Postgres port (usually the default of 5432 just works) PGUSER: User name PGDATABASE: Database to run queries on TM_DB_SERVER: Tells TextMate to use PostgreSQL. You can either set up these environment variables in the TextMate settings or - much more helpful - per project. In the project drawer deselect all files (by clicking on an empty spot) and then open the properties. There you can add project-specific environment variables. ...