tfb.config.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. const postgres = require('@pg')
  2. const { constants } = postgres
  3. const { BinaryInt, VarChar } = constants
  4. const db = {
  5. hostname: 'tfb-database',
  6. user: 'benchmarkdbuser',
  7. pass: 'benchmarkdbpass',
  8. database: 'hello_world',
  9. version: constants.PG_VERSION,
  10. port: 5432
  11. }
  12. const fortunes = {
  13. portal: '',
  14. formats: [],
  15. name: 'fortunes',
  16. maxRows: 0,
  17. params: [],
  18. sql: 'select * from Fortune',
  19. fields: [
  20. { format: BinaryInt, name: 'id' },
  21. { format: VarChar, name: 'message', htmlEscape: true }
  22. ]
  23. }
  24. const worlds = {
  25. portal: '',
  26. formats: [BinaryInt],
  27. name: 'worlds',
  28. maxRows: 0,
  29. params: [0],
  30. sql: 'select id, randomNumber from World where id = $1',
  31. fields: [
  32. { format: BinaryInt, name: 'id' },
  33. { format: BinaryInt, name: 'randomnumber' }
  34. ]
  35. }
  36. const templates = {
  37. fortunes: 'fortunes.html',
  38. settings: { rawStrings: false, compile: true }
  39. }
  40. const maxQuery = 500
  41. const maxRows = 10000
  42. const message = 'Hello, World!'
  43. const json = { message }
  44. const extra = { id: 0, message: 'Additional fortune added at request time.' }
  45. module.exports = {
  46. db, fortunes, worlds, templates,
  47. maxQuery, maxRows, message, json,
  48. extra
  49. }