Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rtlayzell committed Jun 21, 2024
0 parents commit 904a996
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# temp directory
.temp
.tmp

# EdgeDB Generated
/dbschema/edgeql-js
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EdgeQL Query Builder (possibly) excessive build time and memory Issues

This repository has been created to demonstrate the excessive memory consumption when transpiling the edgeql-js.

| | |
|---|---|
| **OS** | Windows 11 |
| **Node** | 20.14.0 |

```bash
npm install
npm run db:reset
npx tsc index.ts
```

Observe that the build takes quite a long time and the memory usage climbs into 4GB+
9 changes: 9 additions & 0 deletions dbschema/default.esdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module default {
type Participant {
exchange := .<participants[is Exchange];
}

type Exchange {
multi participants: Participant;
}
}
12 changes: 12 additions & 0 deletions dbschema/migrations/00001-m1hy42f.edgeql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE MIGRATION m1hy42f2fzrg5h6v4ujyp7tukm4kxighqffyzyelz6vyputmv7zksq
ONTO initial
{
CREATE TYPE default::Exchange;
CREATE TYPE default::Participant;
ALTER TYPE default::Exchange {
CREATE MULTI LINK participants: default::Participant;
};
ALTER TYPE default::Participant {
CREATE LINK exchange := (.<participants[IS default::Exchange]);
};
};
2 changes: 2 additions & 0 deletions edgedb.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[edgedb]
server-version = "5.4"
6 changes: 6 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import e from './dbschema/edgeql-js';
import * as edgedb from 'edgedb';

const query = e.select(e.Exchange, () => ({
...e.Exchange['*']
}));
134 changes: 134 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "edgedb-js-mem-test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"db:gen": "npx @edgedb/generate edgeql-js",
"db:init": "edgedb project init --server-instance edgedb_js_mem_test --non-interactive && edgedb configure set listen_addresses 127.0.0.1 ::1 && npm run db:migrate",
"db:migrate": "edgedb migration create && edgedb migrate && npm run db:gen",
"db:destroy": "edgedb instance destroy -I edgedb_js_mem_test --force",
"db:reset": "npm run db:destroy && npm run db:init"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"edgedb": "^1.5.7"
},
"devDependencies": {
"@edgedb/generate": "^0.5.3"
}
}
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"target": "ES2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"outDir": "./dist",
"baseUrl": "./",
}
}

0 comments on commit 904a996

Please sign in to comment.