Skip to content

Instantly share code, notes, and snippets.

building $W

Michael Salmon hahla

building $W
  • Verizon
  • Berlin
View GitHub Profile
# Your init script
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
# An example hack to log to the console when each text editor is saved.
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
View postgres_showschema.sql
-- This function replicates the functionality of \d table_name
-- It's useful if you work in a sql tool such as intelliJ, where \d does not work.
--- usage: select * from check_schema('table_name');
drop function check_schema(text);
CREATE FUNCTION check_schema(text)
RETURNS TABLE (f1 text, attname name, format_type text, substr text, attnotnull boolean, attnum smallint) AS $$
SELECT $1 as f1, a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod),