Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Add type info as per spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornharrtell committed Sep 13, 2012
1 parent b516719 commit 38be89e
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/resources/database.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ module.exports = (server) ->

app.get '/db/:databaseName', (req, res) ->
res.send
type: 'database'
children: ['schemas']
1 change: 1 addition & 0 deletions lib/resources/db.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ module.exports = (server) ->
callback: (result) ->
databaseNames = (row.datname for row in result.rows)
res.send
type: 'databases'
children: databaseNames
1 change: 1 addition & 0 deletions lib/resources/root.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = (server) ->
callback: (result) ->
versionName = result.rows[0].character_value
res.send
type: 'server_root'
version: null
version_human: versionName
description: "PostgreSQL #{versionName}"
Expand Down
1 change: 1 addition & 0 deletions lib/resources/schema.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ module.exports = (server) ->

app.get '/db/:databaseName/schemas/:schemaName', (req, res) ->
res.send
type: 'schema'
children: ['tables']
1 change: 1 addition & 0 deletions lib/resources/schemas.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ module.exports = (server) ->
database: req.params.databaseName
callback: (result) ->
res.send
type: 'schemas'
children: (row.schema_name for row in result.rows)
1 change: 1 addition & 0 deletions lib/resources/table.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = (server) ->

app.get path, (req, res) ->
res.send
type: 'table'
children: ['rows']
# TODO: implement resources for children 'columns', 'constraints', 'indexes', 'rules', 'triggers'

1 change: 1 addition & 0 deletions lib/resources/tables.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ module.exports = (server) ->
database: req.params.databaseName
callback: (result) ->
res.send
type: 'tables'
children: (row.tablename for row in result.rows)

0 comments on commit 38be89e

Please sign in to comment.