You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL functions that return RECORD and SETOF RECORD are very handy because they can return results with variable structures, unlike most PostgreSQL functions which must always return results with the same column/columns. For example if we wanted to create a function bundle.row_at_commit(meta.row_id, commit_id), if its return type was SETOF RECORD it could any row at any particular commit. The caveat though is that when you call a function that returns SETOF RECORD, you have to also include the structure of the expected result.
We can support these with endpoint, but would need to add an additional parameter that specifies the expected table structure.. Design and implement. Generally, functions and the result sets they return need an audit. We probably want to follow a pattern similar to how we do with relations, aka methods that return row (zero or one rows as JSON), rows (zero or more rows as JSON), field (the literal value returned, as the configured mimetype). There is a whole matrix of how these would map to all the different types of PostgreSQL result types, as well as all the different datum.js types.
The text was updated successfully, but these errors were encountered:
PostgreSQL functions that return
RECORD
andSETOF RECORD
are very handy because they can return results with variable structures, unlike most PostgreSQL functions which must always return results with the same column/columns. For example if we wanted to create a functionbundle.row_at_commit(meta.row_id, commit_id)
, if its return type wasSETOF RECORD
it could any row at any particular commit. The caveat though is that when you call a function that returnsSETOF RECORD
, you have to also include the structure of the expected result.We can support these with endpoint, but would need to add an additional parameter that specifies the expected table structure.. Design and implement. Generally, functions and the result sets they return need an audit. We probably want to follow a pattern similar to how we do with relations, aka methods that return
row
(zero or one rows as JSON),rows
(zero or more rows as JSON),field
(the literal value returned, as the configured mimetype). There is a whole matrix of how these would map to all the different types of PostgreSQL result types, as well as all the different datum.js types.The text was updated successfully, but these errors were encountered: