Skip to content

Instantly share code, notes, and snippets.

@dector
Last active September 13, 2022 10:48
Show Gist options
  • Save dector/849c1f1baf9e5929fae6f4c395ea388c to your computer and use it in GitHub Desktop.
Save dector/849c1f1baf9e5929fae6f4c395ea388c to your computer and use it in GitHub Desktop.
import Surreal from "https://deno.land/x/surrealdb@v0.2.1/mod.ts"
const db = new Surreal('http://localhost:8000/rpc')
await db.signin({ user: 'root', pass: 'root' })
await db.use('test', 'test')
console.log("Fetching #1")
console.log(await db.query(`select * from posts`))
console.log("Fetching #2")
console.log(await db.query(
`select *
from posts`
))
console.log("Done")
Deno.exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment