2. `cd etest/edb_modules`
3. Edit `etest.esdl`:
```sql
module etest {
type User {
property email -> str;
property password -> str;
property name -> str;
};
type Session {
required single link user -> User;
required single property allottedDuration -> std::duration {
default := (WITH
MODULE api
SELECT
<duration>'24 hours'
);
};
required single property createdAt -> std::datetime {
default := (WITH
MODULE api
SELECT
datetime_current()
);
};
required single property sessionID -> std::str;
single property token -> std::str;
};
function create_new_session(EMAIL: std::str, PASS: std::str) -> SET OF Session using (
FOR USER IN {validate_credentials(EMAIL, PASS)}
UNION (
INSERT Session {
token := <str>(SELECT random_big_str_id()),
sessionID := <str>(SELECT random_big_str_id()),
user := USER
}
)
);
function validate_credentials(EMAIL: std::str, PASS: std::str) -> SET OF User using (
SELECT
User
FILTER
.email = EMAIL
AND
.password = PASS
LIMIT 1
);
}
then write and quit.
In the same directory, open and write cinema.esdl :
module cinema {
type Movie {
required property title -> str;
# the year of release
property year -> int64;
required link director -> Person;
required multi link actors -> Person;
}
type Person {
required property first_name -> str;
required property last_name -> str;
}
}
Output:
(bootstrap) 1018 $ edm make
../edgemorph.toml
Compiling your EdgeDB modules....
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/david/.pyenv/versions/3.8-dev/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
TypeError: compile() takes 1 positional argument but 2 were given
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/david/code/edgemorph/edm/edm", line 715, in
main(args)
File "/home/david/code/edgemorph/edm/edm", line 599, in main
eval(f"{func_name}(arg)")
File "", line 1, in
File "/home/david/code/edgemorph/edm/edm", line 293, in make
batch_compilation(retrieved)
File "/home/david/code/edgemorph/edm/edm", line 309, in batch_compilation
async_res = [
File "/home/david/code/edgemorph/edm/edm", line 310, in
job.get(timeout=12)
File "/home/david/.pyenv/versions/3.8-dev/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
TypeError: compile() takes 1 positional argument but 2 were given
Summary
Running
edm make
|edm make *
fails when multiple module files are reachable withinedgemorph.toml
.Recreation Steps
edm init etest
edgemorph.toml
manually:[edgemorph.codegen] schema_name = "Test"
[edgemorph.codegen.rust] enabled = "true"
[edgemorph.codegen.rust.modules] [edgemorph.codegen.rust.modules.etest] source = "/edb_modules/etest.esdl" output = "/src/lib/edm_etest.rs" [edgemorph.codegen.rust.modules.cinema] source = "/edb_modules/cinema.esdl" output = "/src/lib/edm_cinema.rs"
[edgemorph.codegen.python] enabled = "true"
[edgemorph.codegen.python.modules] [edgemorph.codegen.python.modules.etest] source = "/edb_modules/etest.esdl" output = "/etest/edm_etest.py" [edgemorph.codegen.python.modules.cinema] source = "/edb_modules/cinema.esdl" output = "/etest/edm_cinema.py"
[edgedb] [edgedb.databases] [edgedb.databases.primary] name = "" dsn = ""
[edgedb.databases.primary.modules] etest = "/edb_modules/etest.esdl" cinema = "/edb_modules/cinema.esdl"
then write and quit.
cinema.esdl
:Output:
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/home/david/code/edgemorph/edm/edm", line 715, in
main(args)
File "/home/david/code/edgemorph/edm/edm", line 599, in main
eval(f"{func_name}(arg)")
File "", line 1, in
File "/home/david/code/edgemorph/edm/edm", line 293, in make
batch_compilation(retrieved)
File "/home/david/code/edgemorph/edm/edm", line 309, in batch_compilation
async_res = [
File "/home/david/code/edgemorph/edm/edm", line 310, in
job.get(timeout=12)
File "/home/david/.pyenv/versions/3.8-dev/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
TypeError: compile() takes 1 positional argument but 2 were given