This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- description: creates a dynamic temporary pivot table: | |
--- first argument is the name of the pivot-table | |
--- second the data select | |
--- third an array of key fields | |
--- fourth an array of pivot columns | |
--- fifth an array of returning fields | |
--- | |
--- usage (example): select * from pivottable( 'mypivot', 'select * from mydata', array['id', 'name', 'description'], array['parametername'], array['parametervalue::text', 'parametervaluetext'] ); fetch all from mypivot; | |
CREATE OR REPLACE FUNCTION pivottable( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const typeDefs = ` | |
type Comment { | |
id: Int!, | |
body: String!, | |
postId: Int, | |
authorId: Int, | |
archived: Boolean | |
} | |
type Post { |