Commit Graph

11 Commits

Author SHA1 Message Date
Asdine El Hrychy
d981a577c0 db: introduce row type 2023-12-01 20:39:23 +04:00
Asdine El Hrychy
22196e4ecc Allow spaces in functions 2022-06-19 21:31:26 +04:00
Asdine El Hrychy
5c8b32c044 Allow duplicated fields 2021-11-07 15:30:18 +04:00
Asdine El Hrychy
cfdb78487f Parse path fields with brackets 2021-09-02 17:38:47 +04:00
Jean Hadrien Chabran
4a6e68439a Refactor to handle errors with internal/errors (#432)
All new error handling code now rely on internal/errors package
which provides a compilation time toggle that enables to capture
stacktraces for easier debugging while developing.

It also comes with a new testutil/assert package which replaces the require
package when it comes to checking or comparing errors and printing the
stack traces if needed.

Finally, the test target of the Makefile uses the debug build tag by default. 
A testnodebug target is also provided for convenience and to make sure no
tests are broken due to not having used the internal/errors or testutil/assert package.

See #431 for more details
2021-08-22 11:47:54 +03:00
Asdine El Hrychy
d3b81ad6f1 Add support for scientific notation for doubles 2021-07-25 22:36:31 -04:00
Asdine El Hrychy
43a9b3e560 Parse blob literal (#423)
We now have a literal representation for BLOBs. Any string literal starting
with '\x' is parsed as an hex encoded blob. This mimics PostgreSQL's behavior.

```sql
SELECT '\xAAFF';
```
2021-07-23 21:15:29 +04:00
Asdine El Hrychy
f966172cee Introduce Value interface (#422)
This replaces the Value struct by an interface to allow us to override some
values behavior in the future.
It also introduces a new package types, which contains type definitions, comparison,
and arithmetics.
Concerning encoding, Genji now only uses on type of encoding for values. This simplifies
indexing logic as well as table access in general.
2021-07-21 22:05:44 +04:00
Jean Hadrien Chabran
e556fc3048 Add functions packages support (#419)
* Add packaged functions support

* Add tests for math.floor func

* Export FunctionsTable

* Extract func stuff into its own package

* Rename stuff

* Fix tests

* Move doc package to cmd/genji

* Adjust naming, typos
2021-07-17 13:07:16 +02:00
Asdine El Hrychy
661c0eacce Add support for sequences (#416)
This adds support for sequences to Genji. For now, only sequence creation and use is supported, dropping or modifying a sequence will be added later.

To create a sequence:

```sql
CREATE SEQUENCE seq INCREMENT BY 10 MINVALUE 100 NO MAXVALUE START 500 CACHE 32 CYCLE;
```
2021-06-26 17:53:52 +04:00
Asdine El Hrychy
f402374ca3 Move parser to internal package 2021-05-23 21:03:11 +04:00