Skip to content

Commit

Permalink
add typeorm!
Browse files Browse the repository at this point in the history
  • Loading branch information
lastmjs committed May 6, 2024
1 parent 4fa1ef8 commit 124b0a3
Show file tree
Hide file tree
Showing 20 changed files with 7,090 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,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
4 changes: 2 additions & 2 deletions examples/sqlite/test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@ function postsTestsAfterBatch(origin: string): Test[] {
{
name: '/posts not empty',
test: async () => {
const response = await fetch(`${origin}/posts?limit=300`);
const response = await fetch(`${origin}/posts?limit=200`);
const responseJson = await response.json();

return {
Ok: responseJson.length === 300
Ok: responseJson.length === 200
};
}
},
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 124b0a3

Please sign in to comment.