Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Get record before oreo is initialized #55

Open
will123195 opened this issue Nov 15, 2016 · 1 comment
Open

Get record before oreo is initialized #55

will123195 opened this issue Nov 15, 2016 · 1 comment
Labels
Milestone

Comments

@will123195
Copy link
Owner

If a query is run before oreo is done reading the schema from the db:

SELECT ""
FROM "users"
WHERE true

It would be more graceful to use * instead of "".

@MannyC
Copy link
Contributor

MannyC commented Mar 1, 2018

I've been getting something along these lines even though the call is being made from db.onReady()?

oreo: initialized in 1983ms
oreo: writing /home/normal/tarragon-server/src/config/schema.json
SELECT ""
FROM "securities"
WHERE true
SQL ERROR: { error: zero-length delimited identifier at or near """"
    at Connection._8c7‍.r.Connection.parseE (/home/normal/tarragon-server/node_modules/pg/lib/connection.js:567:11)
    at Connection._8c7‍.r.Connection.parseMessage (/home/normal/tarragon-server/node_modules/pg/lib/connection.js:391:17)
    at Socket.<anonymous> (/home/normal/tarragon-server/node_modules/pg/lib/connection.js:129:22)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:594:20)
  name: 'error',
  length: 110,
  severity: 'ERROR',
  code: '42601',
  detail: undefined,
  hint: undefined,
  position: '8',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'scan.l',
  line: '1087',
  routine: 'scanner_yyerror' }

line of code

const securities = await db.securities.find()

only seems to happen on the first call (or at least very early calls)

Not critical in its current form as it gets run again soon after.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants