Commit Graph

20 Commits

Author SHA1 Message Date
Asdine El Hrychy
a69899076c Ensure table constraints have names 2022-04-09 11:18:18 +04:00
Asdine El Hrychy
9187269128 Use cockroachdb errors 2022-01-22 11:37:00 +04:00
Asdine El Hrychy
65c3b29866 Delete engine interface 2022-01-16 10:31:08 +04:00
Asdine El Hrychy
575498d67e Remove Wasm related code 2022-01-15 23:29:21 +04:00
Asdine El Hrychy
da2be37a69 Replace msgpack with unique encoder for keys and values 2021-12-22 22:21:49 +04:00
Asdine El Hrychy
8983d68daf Support composite primary keys 2021-12-04 23:42:43 +05:30
Asdine El Hrychy
a7309a70c5 Add tree package 2021-12-04 10:51:07 +04:00
Asdine El Hrychy
a4958fee6a Add support for CHECK (#436) 2021-11-09 21:14:10 +04:00
Asdine El Hrychy
ef3280d980 Fix field constraint behavior on array indexes 2021-10-26 22:43:18 +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
4f74b22c70 Move catalog to database package 2021-08-10 22:22:17 -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
Asdine El Hrychy
fa66f81fb6 Improve default value expressions 2021-07-02 18:41:33 +04:00
Asdine El Hrychy
9009753d63 Create sequence for docids (#417)
Each table with no primary key now creates a sequence to manage docids
2021-06-28 22:45:50 +04: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
6b6bc6b155 Normalize table and index storage (#410)
Table and index information is now stored the same way, with minimal data:

sql: query used to create the table / index
table_name / index_name
store_name
2021-06-06 20:02:40 +04:00
Asdine El Hrychy
9918cd6f55 Thread safe statements (#406)
Previously, expressions and params were evaluated
during the planning phase. This change builds the query
plan without evaluating params and expressions
which are then evaluated only during the execution phase.
2021-06-04 10:56:23 +04:00
Asdine El Hrychy
7757022ea6 Add support for ON CONFLICT clause
By default, if there is a conflict when inserting a document,
we abort the current statement. Are considered conflicts
any error returned by duplicate primary keys or unique
constraint violations. The ON CONFLICT clause only
supports the DO NOTHING action, which returns no error.
2021-05-28 13:22:28 +04:00
Asdine El Hrychy
37ebf47ea8 Move packages under internal package
These packages are not part of the public API and can break at any time.
2021-05-23 11:05:41 +04:00