Skip to content

Chore/misc updates #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ PG_API_DB_NAME="postgres"
PG_API_DB_USER="postgres"
PG_API_DB_PORT=5432
PG_API_DB_PASSWORD="postgres"
PG_API_DB_SSL=false
```

Then run any of the binaries in the releases.
Expand All @@ -42,5 +41,4 @@ Apache 2.0

We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves. Thanks to these sponsors who are making the OSS ecosystem better for everyone.

[![Worklife VC](https://user-images.githubusercontent.com/10214025/90451355-34d71200-e11e-11ea-81f9-1592fd1e9146.png)](https://www.worklife.vc)
[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)
2 changes: 1 addition & 1 deletion src/api/columns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ router.get('/', async (req, res) => {
if (!include_system_schemas) payload = removeSystemSchemas(data)
return res.status(200).json(payload)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ router.get('/', async (req, res) => {
const { data } = await RunQuery(req.headers.pg, config)
return res.status(200).json(data)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand All @@ -19,7 +19,7 @@ router.get('/version', async (req, res) => {
const { data } = await RunQuery(req.headers.pg, version)
return res.status(200).json(data[0]) // only one row
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand Down
8 changes: 4 additions & 4 deletions src/api/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ router.get('/', async (req, res) => {
const { data } = await RunQuery(req.headers.pg, getExtensionsQuery)
return res.status(200).json(data)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand All @@ -28,7 +28,7 @@ router.post('/', async (req, res) => {

return res.status(200).json(extension)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(400).json({ error: error.message })
}
})
Expand All @@ -46,7 +46,7 @@ router.patch('/:name', async (req, res) => {

return res.status(200).json(updated)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(400).json({ error: error.message })
}
})
Expand All @@ -64,7 +64,7 @@ router.delete('/:name', async (req, res) => {

return res.status(200).json(deleted)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(400).json({ error: error.message })
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/api/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ router.get('/', async (req, res) => {
if (!include_system_schemas) payload = removeSystemSchemas(data)
return res.status(200).json(payload)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/api/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ router.get('/', async (req, res) => {

return res.status(200).json(payload)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ router.get('/', async (req, res) => {
if (!include_system_schemas) payload = removeSystemSchemas(data)
return res.status(200).json(payload)
} catch (error) {
console.log('throwing error')
console.log('throwing error', error)
res.status(500).json({ error: error.message })
}
})
Expand Down
9 changes: 8 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
export const PG_API_URL = process.env.PG_API_URL || 'http://localhost'
export const PG_API_PORT = Number(process.env.PG_API_PORT || 1337)
export const CRYPTO_KEY = process.env.CRYPTO_KEY || 'SAMPLE_KEY'
export const PG_CONNECTION = 'postgres://postgres:postgres@localhost:5432/postgres'

const PG_API_DB_HOST = process.env.PG_API_DB_HOST || 'localhost'
const PG_API_DB_NAME = process.env.PG_API_DB_NAME || 'postgres'
const PG_API_DB_USER = process.env.PG_API_DB_USER || 'postgres'
const PG_API_DB_PORT = Number(process.env.PG_API_DB_PORT) || 5432
const PG_API_DB_PASSWORD = process.env.PG_API_DB_PASSWORD || 'postgres'

export const PG_CONNECTION = `postgres://${PG_API_DB_USER}:${PG_API_DB_PASSWORD}@${PG_API_DB_HOST}:${PG_API_DB_PORT}/${PG_API_DB_NAME}`

export const DEFAULT_ROLES: string[] = [
'pg_read_all_settings',
Expand Down