<commit_before>.. _edgedb-js-intro:

===========================
EdgeDB TypeScript/JS Client
===========================

.. toctree::
   :maxdepth: 3
   :hidden:

   driver
   querybuilder
   generation
   literals
   types
   funcops
   parameters
   objects
   select
   insert
   update
   delete
   with
   for
   group
   reference

This is the official EdgeDB client library for JavaScript and TypeScript. It's
the easiest way to connect to your database and execute queries from a Node.js
or Deno backend.



.. _edgedb-js-installation:

**Installation**

To get started, install the ``edgedb`` module from NPM.

.. code-block:: bash

    $ npm install edgedb      # npm users
    $ yarn add edgedb         # yarn users

There are two components of this library:

- Use the *driver* to establish a connection to your database and execute
  EdgeQL queries (written as strings).
- Use the *query builder* to write queries in a code-first, typesafe way.
  Recommended for TypeScript users.


Migration to 2.0
================

We recently released ``v0.21.0`` of the ``edgedb`` module on NPM and
``deno.land/x``, which supports the latest EdgeDB 2.0 features and protocol.
It is also backwards-compatible with v1 instances as well, so we recommend
all users upgrade.

```bash
npm install edgedb@latest
```

Breaking changes
----------------

- All ``uuid`` properties are now decoded to include hyphens. Previously
  hyphens were elided for performance reasons; this issue has since been
  resolved.

  .. code-block:: typescript

    client.querySingle(`select uuid_generate_v1mc();`);
    // "ce13b17a-7fcd-42b3-b5e3-eb28d1b953f6"


- All ``json`` properties and parameters are now parsed/stringified internally
  by the client. Previously:

  .. code-block:: typescript

    const result = await client.querySingle(<commit_msg>Fix code block<commit_after>.. _edgedb-js-intro:

===========================
EdgeDB TypeScript/JS Client
===========================

.. toctree::
   :maxdepth: 3
   :hidden:

   driver
   querybuilder
   generation
   literals
   types
   funcops
   parameters
   objects
   select
   insert
   update
   delete
   with
   for
   group
   reference

This is the official EdgeDB client library for JavaScript and TypeScript. It's
the easiest way to connect to your database and execute queries from a Node.js
or Deno backend.



.. _edgedb-js-installation:

**Installation**

To get started, install the ``edgedb`` module from NPM.

.. code-block:: bash

    $ npm install edgedb      # npm users
    $ yarn add edgedb         # yarn users

There are two components of this library:

- Use the *driver* to establish a connection to your database and execute
  EdgeQL queries (written as strings).
- Use the *query builder* to write queries in a code-first, typesafe way.
  Recommended for TypeScript users.


Migration to 2.0
================

We recently released ``v0.21.0`` of the ``edgedb`` module on NPM and
``deno.land/x``, which supports the latest EdgeDB 2.0 features and protocol.
It is also backwards-compatible with v1 instances as well, so we recommend
all users upgrade.

.. code-block:: bash

  npm install edgedb@latest


Breaking changes
----------------

- All ``uuid`` properties are now decoded to include hyphens. Previously
  hyphens were elided for performance reasons; this issue has since been
  resolved.

  .. code-block:: typescript

    client.querySingle(`select uuid_generate_v1mc();`);
    // "ce13b17a-7fcd-42b3-b5e3-eb28d1b953f6"


- All ``json`` properties and parameters are now parsed/stringified internally
  by the client. Previously:

  .. code-block:: typescript

    const result = await client.querySingle(
{'fraction_non_alphanumeric': 0.11970684039087948, 'fraction_numerical': 0.01520086862106406, 'mean_word_length': 3.309941520467836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4461170', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1048, 'n_words': 418}