Skip to content

Commit

Permalink
Merge branch 'update_dfx_0_20_1' of github.com:demergent-labs/azle in…
Browse files Browse the repository at this point in the history
…to update_dfx_0_20_1
  • Loading branch information
lastmjs committed Jun 10, 2024
2 parents eb63c88 + 71459b1 commit adf80c9
Show file tree
Hide file tree
Showing 20 changed files with 7,113 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ jobs:
"examples/simple_user_accounts",
"examples/sqlite",
"examples/sqlite_drizzle",
"examples/sqlite_typeorm",
"examples/stable_b_tree_map_instruction_threshold",
"examples/stable_memory",
"examples/stable_structures",
Expand Down
7 changes: 3 additions & 4 deletions examples/sqlite/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,18 +501,17 @@ function usersTestsAfterBatch(origin: string): Test[] {

function postsTestsAfterBatch(origin: string): Test[] {
const totalNumPosts = POSTS_BATCH_AMOUNT + 1;
const limit = totalNumPosts - 99; // to not hit the instruction limit

return [
{
name: '/posts not empty',
test: async () => {
const response = await fetch(
`${origin}/posts?limit=${totalNumPosts}`
);
const response = await fetch(`${origin}/posts?limit=${limit}`);
const responseJson = await response.json();

return {
Ok: responseJson.length === totalNumPosts
Ok: responseJson.length === limit
};
}
},
Expand Down
3 changes: 3 additions & 0 deletions examples/sqlite_typeorm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.azle
.dfx
node_modules
16 changes: 16 additions & 0 deletions examples/sqlite_typeorm/batch_create_users.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Set the number of times to execute the curl command
count=1000 # Change this number as needed

# URL to which the POST request will be sent
url="http://$(dfx canister id sqlite_typeorm).localhost:8000/users/batch/800"

# Loop as many times as specified in the count variable
for ((i=0; i<count; i++))
do
echo "POST request #$i"
curl -X POST "$url"
done

echo "All POST requests have finished"
9 changes: 9 additions & 0 deletions examples/sqlite_typeorm/dfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"canisters": {
"sqlite_typeorm": {
"type": "azle",
"main": "src/index.ts",
"candid_gen": "automatic"
}
}
}
Loading

0 comments on commit adf80c9

Please sign in to comment.