Merge pull request #164 from CrowdHailer/patch-1

make examples execute in order
main
Ziyang Hu 1 year ago committed by GitHub
commit febf96e4b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,14 +24,14 @@ const {CozoDb} = require('cozo-node')
const db = new CozoDb()
function printQuery(query, params) {
db.run(query, params)
return db.run(query, params)
.then(data => console.log(data))
.catch(err => console.error(err.display || err.message))
}
printQuery("?[] <- [['hello', 'world!']]")
printQuery("?[] <- [['hello', 'world', $name]]", {"name": "JavaScript"})
printQuery("?[a] <- [[1, 2]]")
await printQuery("?[] <- [['hello', 'world!']]")
await printQuery("?[] <- [['hello', 'world', $name]]", {"name": "JavaScript"})
await printQuery("?[a] <- [[1, 2]]")
```
### Basic API
@ -136,4 +136,4 @@ If you did everything correctly, you should get the hello world message printed
node example.js
```
under this directory.
under this directory.

Loading…
Cancel
Save