Skip to content

Commit c7c9623

Browse files
committed
Add db and static file
1 parent 382aad8 commit c7c9623

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

api/env.wit

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,22 @@ enum field-type {
2222
state,
2323
query
2424
}
25+
enum query-type {
26+
select,
27+
insert,
28+
update,
29+
delete
30+
}
2531

2632
return-result: function(res: list<u8>, ident: u32)
27-
return-error: function(code: u32, res: string, ident: u32)
33+
return-error: function(code: s32, res: string, ident: u32)
2834
log-msg: function(msg: string, level: log-level, ident: u32)
29-
fetch-url: function(method: http-method, url: string, body: list<u8>, ident: u32) -> u32
30-
graphql-query: function(endpoint: string, query: string, ident: u32) -> u32
31-
cache-set: function(key: string, value: list<u8>, ttl: u32, ident: u32) -> u32
32-
cache-get: function(key: string, ident: u32) -> u32
33-
request-get-field: function(field-type: field-type, key: string, ident: u32) -> u32
34-
get-ffi-result: function(ptr: u32, ident: u32) -> u32
35+
fetch-url: function(method: http-method, url: string, body: list<u8>, ident: u32) -> s32
36+
graphql-query: function(endpoint: string, query: string, ident: u32) -> s32
37+
cache-set: function(key: string, value: list<u8>, ttl: u32, ident: u32) -> s32
38+
cache-get: function(key: string, ident: u32) -> s32
39+
request-get-field: function(field-type: field-type, key: string, ident: u32) -> s32
40+
get-static-file: function(name: string, ident: u32) -> s32
41+
db-exec: function(query-type: query-type, name: string, ident: u32) -> s32
42+
get-ffi-result: function(ptr: u32, ident: u32) -> s32
3543
return-abort: function(msg: string, file: string, line-num: u32, col-num: u32, ident: u32)

0 commit comments

Comments
 (0)