Skip to content

Instantly share code, notes, and snippets.

Avatar

Chad Nickell nickell

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am nickell on github.
  • I am nickell (https://keybase.io/nickell) on keybase.
  • I have a public key ASDhA6Za0tfmRW4_e0rT33vDz0EiMsNEJnpmY2GrjGavAwo

To claim this, I am signing this object:

View postgres_camelize_functions.sql
create or replace function camelize(text)
returns text as $$
declare parts text[] = string_to_array($1, '_');
declare capitalized_parts text[] = (select array_agg(initcap(n)) from unnest(parts) as n);
begin
return parts[1] || array_to_string(capitalized_parts[2:], '');
end;
$$ language plpgsql;
create or replace function camelize_keys(json)