Skip to content

Commit

Permalink
Surface Deno prerequisites (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
raddevon authored Feb 6, 2024
1 parent 3a35839 commit 8244e66
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,28 @@ generators from npm using your package manager of choice.
$ bun add edgedb # database driver
$ bun add --dev @edgedb/generate # generators

.. note:: Deno users

Create these two files in your project root:

.. code-block:: json
:caption: importMap.json
{
"imports": {
"edgedb": "https://deno.land/x/edgedb/mod.ts",
"edgedb/": "https://deno.land/x/edgedb/"
}
}
.. code-block:: json
:caption: deno.js
{
"importMap": "./importMap.json"
}
.. _edgedb-js-quickstart:

Quickstart
Expand Down
21 changes: 21 additions & 0 deletions docs/interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,27 @@ The following command will run the ``interfaces`` generator.

$ bunx @edgedb/generate queries

.. note:: Deno users

Create these two files in your project root:

.. code-block:: json
:caption: importMap.json
{
"imports": {
"edgedb": "https://deno.land/x/edgedb/mod.ts",
"edgedb/": "https://deno.land/x/edgedb/"
}
}
.. code-block:: json
:caption: deno.js
{
"importMap": "./importMap.json"
}
This will introspect your schema and generate TypeScript interfaces that correspond to each object type. By default, these interfaces will be written to a single file called ``interfaces.ts`` into the ``dbschema`` directory in your project root. The file will contain the following contents (roughly):

.. code-block:: typescript
Expand Down
21 changes: 21 additions & 0 deletions docs/queries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,27 @@ The following command will run the ``queries`` generator.

$ bunx @edgedb/generate queries

.. note:: Deno users

Create these two files in your project root:

.. code-block:: json
:caption: importMap.json
{
"imports": {
"edgedb": "https://deno.land/x/edgedb/mod.ts",
"edgedb/": "https://deno.land/x/edgedb/"
}
}
.. code-block:: json
:caption: deno.js
{
"importMap": "./importMap.json"
}
The generator will detect the project root by looking for an ``edgedb.toml``,
then scan the directory for ``*.edgeql`` files. In this case, there's only one:
``queries/getUser.edgeql``.
Expand Down
21 changes: 21 additions & 0 deletions docs/querybuilder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,27 @@ The following command will run the ``edgeql-js`` query builder generator.

$ bunx @edgedb/generate edgeql-js

.. note:: Deno users

Create these two files in your project root:

.. code-block:: json
:caption: importMap.json
{
"imports": {
"edgedb": "https://deno.land/x/edgedb/mod.ts",
"edgedb/": "https://deno.land/x/edgedb/"
}
}
.. code-block:: json
:caption: deno.js
{
"importMap": "./importMap.json"
}
The generation command is configurable in a number of ways.

``--output-dir <path>``
Expand Down

0 comments on commit 8244e66

Please sign in to comment.