Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
WRITER_SCHEMA = <<-JSON | |
{ "type": "record", | |
"name": "User", | |
"fields" : [ | |
{"name": "username", "type": "string"}, | |
{"name": "age", "type": "int"}, | |
{"name": "verified", "type": "boolean", "default": "false"} | |
]} | |
JSON |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
SELECT json_build_object( | |
'total', (SELECT n_live_tup FROM pg_stat_user_tables WHERE relname='sometable'), | |
'count', count(sometable_rows.*), | |
'offset', 0, | |
'results', json_agg(row_to_json(sometable_rows)) | |
) | |
FROM (SELECT * FROM sometable | |
ORDER BY "time" | |
LIMIT 10 OFFSET 0) | |
sometable_rows; |