Last active
March 27, 2021 08:20
-
-
Save njbmartin/87dd14226e2a10216fba81c91ed22da7 to your computer and use it in GitHub Desktop.
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
import { DiggyDB, DiggyQuery } from "diggydb-nodejs" | |
const db = new DiggyDB({ | |
hostname: "example.com", | |
accessKeyId: process.env.AWS_ACCESS_KEY_ID, | |
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, | |
}) | |
interface Framework { | |
id: string | |
name: string | |
version: string | |
downloads: string | |
} | |
const table = "framework" | |
const tableResult = await db.queryTable<Framework[]>(table) | |
// returns | |
const tableResult = [ | |
{ | |
id: "3a7b68cf-686a-4135-b48b-6471deb3643a", | |
name: "gatsby", | |
version: "3.1.2", | |
downloads: "409,484", | |
}, | |
{ | |
id: "aae3d92e-7230-43e4-b63c-1efe00081ae6", | |
name: "next.js", | |
version: "10.0.9", | |
downloads: "1,144,043", | |
}, | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment