Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface Deno prerequisites #851

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading