Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

edm: edgemorph development manager

David M. Golembiowski edited this page Sep 30, 2020 · 3 revisions

edm: edgemorph development manager

the command line tool for the edgemorph framework


Formal specification


  • edm init [ directory_name | . ]

Initializes an edgemorph project in the directory_name specified. If directory_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 the project_root variable. Next, the command creates the edb_modules folder under the project_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 within edgemorph.toml, then its information is written to edgemorph.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 if edb_module is non-empty and in the set of registered modules, this call forwards the edb_module to the lower-level call edm compile. Alternatively, if edb_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 run edb make install can be run to compile the EdgeQL source to local package targets. Otherwise, this process prints the syntactical errors emitted by edgeql-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 the edgeql-parser. When the output matches Result<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 and database_name are not jointly available in edgemorph.toml. Otherwise, checks whether connectivity can be established between edgemorph and the edgedb_ident for database_name.


  • edm make install [ (edb_module)+ | * ]

Checks edgemorph.toml for the edgedb_ident and database_name pairs associated with edb_module. Panics if these correspondences are not registered. Otherwise, runs edm_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.