Skip to content

Commit

Permalink
Query builder (#225)
Browse files Browse the repository at this point in the history
* Docs and make reservedKeywords a named import

* More docs

* Fix polymorphics inside nested shapes

* Update docs

* Update error message for unused named arguments

* Write docs

* Fix string indexing bug

* Clean up select. Fix tests

* First pass as docs. Add catchall for pointersToSelectParams

* Drop scoped expr select + allow path exprs in `e.with`

* Fix scoped expr caching

* Fix `e.detached`

* Allow select shapes with only computed keys

* Re-implement `pathify` using proxy

* Rename `withParams` to `params`

* Throw a better error when `run()` called on non-runnable expressions

* Merge `namedTuple` constructor into `tuple` + implement tuple paths + implement array index/slice

* Improve error message when query has no parameters, but args are passed to `query` method

* Fix typo

* Fix lint

* Revert package version change

* Fix tests

* Allow js literal scalars in insert/update shapes

* Various operator and scalar related changes

- Add `jsnumber` type
- Make `int*` and `float*` cast only types
- Replace operator functions with `e.op`
- Allow js literals in functions, operators, `e.array`, `e.tuple` and `e.set`
- Add index and slice methods on array, string and bytes typesets
- Add destructure method on json typesets
- Allow `string` in `e.jsnumber()` + `any` in `e.json()`

* Fix deprecated recursive rmdir warning

* Update `update` to closure api

* Add `e.set` overload that allows an array instead of a tuple of a type

* Update offset and limit cardinality inference to override lower cardinality to zero

* Fix toEdgeQL bug

* Fix build

* Excessively deep (#229)

* Add select modifier methods + pathify computed properties

* Excessively deep fix (#228)

* Mostly fix shape pathify

* Simplify select

* Attempts

* Clear playground

* Modifier methods don't change cardinality

* Clean up

* Remove trace from git

* Update delete tests

Co-authored-by: James Clarke <[email protected]>

* Fix bug

* Un-skip select test

* Re-export `TypeSet` type as `Set`

* Add support for more complex param types

* Fix lint

* Increase timeout

* Remove logging

* Rename jsnumber to number

* Simplify scripts

* Allow properties/links with defaults to be optional in `e.insert`

* Fix `e.update` with multi properties

* Allow `null` in insert/update shapes for optional props/links

* Fix cardinality inference for `assert_exists`

* Disable select modifier methods

* Remove `delete` method from select expr + make top level `e.delete` function

* Make all expressions runnable

* Fix lint

* Rename functions with same names as types + Remove direct runtime imports from generated modules

* Add edgedb-generate module

* Docs

* Remove $ imports

* $is to is

* Support plain JS data in e.select

* to assert_single

* Remove e.number from public API. Make all types constructable. Remove cast syntax from all int/float literals.

* edgedb-generate -> edgeql-js

* Work on docs

* Fix rendering of top level exprs in sets

* Fix output dir overwrite detection

* Fix lint

* Work on docs

* Change order -> order_by

* Update docs

* Split up docs pages. Fix json numerical indexing

* Document literals

* Lowercase is in backlinks. Add dollarsign to getType and getTypeByName.

* Work on docs

* Finish docs. Fix tests.

* 0.19-alpha.2

* Add annotation to code blocks

* Update with

* Fix autocomplete in update, add createClient re-export

* Add parenthesis to cast EdgeQL. Fix update bug.

* 0.19.alpha-4

* Add line breaks

* 0.19 alpha5

* Remove trace

Co-authored-by: James Clarke <[email protected]>
  • Loading branch information
colinhacks and jaclarke authored Feb 10, 2022
1 parent ecf9fb7 commit 6907257
Show file tree
Hide file tree
Showing 137 changed files with 21,960 additions and 2,504 deletions.
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The NodeJS driver for EdgeDB
# The official Node.js client library for EdgeDB

[![Build Status](https://github.com/edgedb/edgedb-js/workflows/Tests/badge.svg?event=push&branch=master)](https://github.com/edgedb/edgedb-js/actions) [![NPM](https://img.shields.io/npm/v/edgedb)](https://www.npmjs.com/package/edgedb) [![Join GitHub discussions](https://img.shields.io/badge/join-github%20discussions-green)](https://github.com/edgedb/edgedb/discussions)

Expand Down Expand Up @@ -54,9 +54,13 @@ A local installation of EdgeDB is required to run tests. Download
EdgeDB from [here](https://www.edgedb.com/download) or
[build it manually](https://www.edgedb.com/docs/reference/dev).

We use TypeScript, yarn, prettier, and tslint to develop edgedb-js.
To run the test suite, run `yarn test`. To lint or format the code, run
`yarn lint` / `yarn format`.
```bash
$ git clone [email protected]:edgedb/edgedb-js.git
$ cd edgedb-js
$ yarn # install dependencies
$ yarn build # compile TypeScript
$ yarn tests # run tests
```

## License

Expand Down
Loading

0 comments on commit 6907257

Please sign in to comment.