This file contains hidden or 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
4023872600770937735437024339230039857193748642107146325437999104299385123986290205920442084869694048004799886101971960586316668729948085589013238296699445909974245040870737599188236277271887325197795059509952761208749754624970436014182780946464962910563938874378864873371191810458257836478499770124766328898359557354325131853239584630755574091142624174743493475534286465766116677973966688202912073791438537195882498081268678383745597317461360853795345242215865932019280908782973084313928444032812315586110369768013573042161687476096758713483120254785893207671691324484262361314125087802080002616831510273418279777047846358681701643650241536913982812648102130927612448963599287051149649754199093422215668325720808213331861168115536158365469840467089756029009505376164758477284218896796462449451607653534081989013854424879849599533191017233555566021394503997362807501378376153071277619268490343526252000158885351473316117021039681759215109077880193931781141945452572238655414610628921879602238389714760885062768629671466746975 |
This file contains hidden or 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
-- After adding a Postgres source to your Hasura project, | |
-- head to the "Run SQL" page and copy-pasta the following SQL. | |
-- This SQL creates a messages table and inserts a 100 messages into the table. | |
CREATE TABLE messages ( | |
id bigserial primary key, | |
message text | |
); | |
INSERT INTO messages (message) VALUES |
This file contains hidden or 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
{ | |
"resource_version": 8, | |
"metadata": { | |
"version": 3, | |
"sources": [ | |
{ | |
"name": "default", | |
"kind": "postgres", | |
"tables": [ | |
{ |
This file contains hidden or 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
-- -- /******************************************************************************* | |
-- -- Chinook Database - Version 1.4 | |
-- -- Script: Chinook_PostgreSql.sql | |
-- -- Description: Creates and populates the Chinook database. | |
-- -- DB Server: PostgreSql | |
-- -- Author: Luis Rocha | |
-- -- License: http://www.codeplex.com/ChinookDatabase/license | |
-- -- Modified By: John Atten |
This file contains hidden or 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
import requests | |
#Fetch existing tables | |
tables = requests.post('http://localhost:8080/v1/query', json={ | |
"type":"select", | |
"args":{ | |
"table": {"schema": "information_schema", "name": "tables"}, | |
"columns": ["table_name"], | |
"where": {"table_schema": {"$eq": "public"}} | |
} |
This file contains hidden or 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
#Without query variables | |
mutation updateChildren { | |
delete_children(where: {parent_id: {_eq: 1}}) { | |
affected_rows | |
} | |
insert_children(objects: [{name: "child1", parent_id: 1}, {name: "child2", parent_id: 1}]) { | |
affected_rows | |
} |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
-- -- /******************************************************************************* | |
-- -- Chinook Database - Version 1.4 | |
-- -- Script: Chinook_PostgreSql.sql | |
-- -- Description: Creates and populates the Chinook database. | |
-- -- DB Server: PostgreSql | |
-- -- Author: Luis Rocha | |
-- -- License: http://www.codeplex.com/ChinookDatabase/license | |
-- -- Modified By: John Atten |
This file contains hidden or 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
{ | |
"user": [ | |
{ | |
"id": 456, | |
"name": "Sita K", | |
"address": { | |
"country": "India" | |
} | |
}, | |
{ |
This file contains hidden or 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
mutation($message: messages_insert_input!) { | |
insert_messages(objects:[$message]) { | |
returning { | |
id | |
sender_id | |
message | |
} | |
} | |
} |
This file contains hidden or 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
mutation($message: messages_insert_input!) { | |
insert_messages(objects:[$message]) { | |
returning { | |
id | |
sender_id | |
message | |
} | |
} | |
} |
NewerOlder