A Pen by michael salmon on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 $$ | |
BEGIN | |
RETURN QUERY | |
SELECT $1 as f1, a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod), |
A Pen by Carrara Website Solutions on CodePen.