romcok / appsync-pg-hello

Example Serverless AppSync Lambda resolver for PostgreSQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

appsync-pg-hello

Serverless AppSync Lambda resolver for PostgreSQL.

# node test.js

Received event {
   "sql": "SELECT * FROM hello LIMIT 10"
}
Executing SQL: SELECT * FROM hello LIMIT 10
[ { id: 1, content: 'Hello Postgres!' },
  { id: 2, content: 'Hello again!' } ]

--- RESULT ---

 [ { id: 1, content: 'Hello Postgres!' },
  { id: 2, content: 'Hello again!' } ]

--------------

Received event {
   "sql": "SELECT * FROM hello WHERE id = :ID",
   "variableMapping": {
      ":ID": 1
   }
}
Executing SQL: { text: 'SELECT * FROM hello WHERE id = $1', values: [ 1 ] }
[ { id: 1, content: 'Hello Postgres!' } ]

--- RESULT ---

 [ { id: 1, content: 'Hello Postgres!' } ]

About

Example Serverless AppSync Lambda resolver for PostgreSQL.


Languages

Language:JavaScript 100.0%