-
Notifications
You must be signed in to change notification settings - Fork 1
edm: edgemorph development manager
the command line tool for the edgemorph framework
-
edm init
[ directory_name | . ]
Initializes an edgemorph project in the
directory_name
specified. Ifdirectory_name
is neither empty nor the.
character, and the directory does not already exist, then this call creates the directory. Otherwise, the current working directory is assigned by default. This value becomes theproject_root
variable. Next, the command creates theedb_modules
folder under theproject_root
. Then,$project_root/edb_modules/mod_${project_root}.edgeql
is created and pre-populated with:
module ${project_root} {
}
Finally,
$project_root/edgemorph.toml
is created. It is pre-populated with:
[edgemorph]
enable_rs_binding = "true"
enable_py_binding = "true"
project_root = ["${project_root}"]
mod_directories = [
"${project_root}/edb_modules"
]
edgemorph_output = {
rust = [
["mod_${project_root}.edgeql", "${project_root}/src/lib/edm_${project_root_last_child}.rs"]
],
python = [
["mod_${project_root}.edgeql", "${project_root}/${project_root_last_child}/edm_${project_root_last_child}.py"]
]
}
[edgedb]
databases = {
edgedb_primary = [{
dsn = "",
modules = ["${project_root}/edb_modules/mod_${project_root}.edgeql"]
}]
}
-
edm add
[ new_module ]
If
new_module
is present on the filesystem and does not conflict with any module names already allocated withinedgemorph.toml
, then its information is written toedgemorph.toml
and is registered with each of the possible database names.
-
edm make
[ edb_module | * ]
Retrieves each of the module files from
edgemorph.toml
and ifedb_module
is non-empty and in the set of registered modules, this call forwards theedb_module
to the lower-level calledm compile
. Alternatively, ifedb_module
is empty then this same procedure is done for each of the registered module files. If compilation is successful, this process writes a file to disk with the edgemorph-augmented SDL migration. Then, the command informs the user to runedb make install
can be run to compile the EdgeQL source to local package targets. Otherwise, this process prints the syntactical errors emitted byedgeql-parser
and exits.
-
edm compile
[ edb_module_path ]
_Panics when
edb_module_path
is not a valid target. Otherwise, runs the source module through a single-pass compilation process leveraging theedgeql-parser
. When the output matchesResult<T>
,edm compile
digests the AST tokens into static Edgemorph datastructures with trait implementations for calling module-level prepared at the database level and separate implementations for binding public-facing methods to EdgeQL functions that can queried directly on the database.
-
edm test
[ edgedb_ident ] [ database_name ]
Panics when
edgedb_ident
anddatabase_name
are not jointly available inedgemorph.toml
. Otherwise, checks whether connectivity can be established between edgemorph and theedgedb_ident
fordatabase_name
.
-
edm make install
[ (edb_module)+ | * ]
Checks
edgemorph.toml
for theedgedb_ident
anddatabase_name
pairs associated withedb_module
. Panics if these correspondences are not registered. Otherwise, runsedm_test
for each of the relevant pairs. For each one that does not panic, this process starts a transaction with the databases and commits N migrations for each of the K-many SDL migrations stored in the$project_root
.