Ziyang Hu 1 year ago
commit ab399ba28b

@ -274,6 +274,7 @@ Follow the links in the table below:
| [Golang](https://github.com/cozodb/cozo-lib-go) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQR | | [Golang](https://github.com/cozodb/cozo-lib-go) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQR |
| [C/C++/language with C FFI](./cozo-lib-c) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQR | | [C/C++/language with C FFI](./cozo-lib-c) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQR |
| [Standalone HTTP server](./cozo-bin) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQRST | | [Standalone HTTP server](./cozo-bin) | Linux (x86_64, ARM64), Mac (ARM64, x86_64), Windows (x86_64) | MQRST |
| [Lisp](https://github.com/pegesund/cozodb-lisp) | Linux (x86_64 so far) | MR |
For the storage column: For the storage column:

@ -12,7 +12,7 @@
void run_query(int32_t db_id, const char *query) { void run_query(int32_t db_id, const char *query) {
const char *empty_params = "{}"; const char *empty_params = "{}";
char *res; char *res;
res = cozo_run_query(db_id, query, empty_params); res = cozo_run_query(db_id, query, empty_params, false);
printf("%s\n", res); printf("%s\n", res);
cozo_free_str(res); cozo_free_str(res);
} }
@ -32,4 +32,4 @@ int main() {
cozo_close_db(db_id); cozo_close_db(db_id);
return 0; return 0;
} }

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

@ -31,6 +31,30 @@
"created_at": "2023-05-11T17:33:21Z", "created_at": "2023-05-11T17:33:21Z",
"repoId": 551374215, "repoId": 551374215,
"pullRequestNo": 107 "pullRequestNo": 107
},
{
"name": "turnerdev",
"id": 48462986,
"comment_id": 1633419301,
"created_at": "2023-07-13T01:52:22Z",
"repoId": 551374215,
"pullRequestNo": 145
},
{
"name": "pegesund",
"id": 198916,
"comment_id": 1642413475,
"created_at": "2023-07-19T16:39:15Z",
"repoId": 551374215,
"pullRequestNo": 151
},
{
"name": "CrowdHailer",
"id": 5862302,
"comment_id": 1656326030,
"created_at": "2023-07-28T20:55:41Z",
"repoId": 551374215,
"pullRequestNo": 164
} }
] ]
} }
Loading…
Cancel
Save