Skip to content

Releases: elliotchance/vsql

v0.9.2

31 Aug 01:23
75f9e3c
Compare
Choose a tag to compare
server: Added SSL negotiation (#31)

A client may ask if the server supports SSL through a special
StartupMessage. This is now supported and was the cause of psql hanging
on connect.

Added a "-v" option to the server (disabled by default) to hide all of
the sent and received messages (which may be helpful for debugging).

Added a "-p" option to set the server port.

Fixes #29

v0.9.1

28 Aug 19:01
e875194
Compare
Choose a tag to compare
Merging vsql into a single binary (#30)

It's better to build a single vsql binary that now works as:

    vsql test.vsql   # cli
    vsql server test.vsql   # run as server

There has also been some documentation and small cleanup.

v0.9.0

28 Aug 17:13
ca2d058
Compare
Choose a tag to compare
Adding virtual tables (#28)

Virtual tables allow you to register tables that have their rows
provided at the time of a `SELECT`. The callback for the virtual
table will be called repeatedly until `t.done()` is invoked, even if
zero rows are provided in an iteration. All data will be thrown away
between subsequent `SELECT` operations.

There are a couple of reasons why this is needed:

1. When using vsql as a PostgreSQL server, there are various tables that
different client access (such as `pg_database`) that can be provided
virtually during the connection but do not need to exist as real tables
just to satisfy the connection.

2. It's handy to be able to inject memory-based runtime data from a V
program to interact, or be used exclusively with the database engine.
Apart from virtual tables being faster, it makes SQL-based ETL much
easier.

v0.8.0

22 Aug 22:35
bf3e689
Compare
Choose a tag to compare
Completely rebuilt parser (#27)

This completely rebuilds the parser from a trivial top-down to using a
Earley parser based on the correct BNF rules described in the 2016 SQL
standard. Or, at least the rules/partial rules that apply to the
features already implemented.

The parser is now generated from the `grammar.bnf` by a python script
(yes, I know, not pure V anymore - I'll replace that in a future patch).
As a consequence of using the correct grammar some notable changes are:

1. The "FROM" clause is mandatory. This is unfortunate, but all tests have
been updated with dummy tables.

2. A new (rather large) list of non-reserved words has been added. These
in combination with the existing reserved words make up the SQL
"key words" and extend the list of bad entity names we were using in
some places. Some examples of this are; T is no longer allowed as a
table name and A is no longer allowed as a column name.

3. LOG() was removed because it didn't follow the SQL standard (which
takes 2 parameters). This can be implemented in a future patch along
with some other basic functions that are missing.

4. NULL cannot be used as a non-contextual value (ie.
`SELECT NULL IS NULL FROM t1`). That means it cannot be used by itself
in an expression where the database couldn't figure out what type it
could be, like an `INSERT`. So a few tests had to be removed. In the
future this will be possible with a `CAST`:
`SELECT CAST(NULL AS INTEGER) IS NULL FROM t1`.

5. More flexible exact numeric values such as `.3` and `3.`.

There still is a lot of cleanup to make in the lexer area but I'll that
for a future patch.

Back story:

This was an unexpectedly extraordinarily complex refactoring that took
weeks instead of days because originally I built an LR(0) (bottom-up
parser) which I thought was sufficient for SQL grammar, but it turns out
that it's not because there are some ambiguous rules that can be
resolve by picking a conflict path.

So, I had to rebuild the entire parser again as as LALR parser which is
also a bottom-up parser but contains one extra look ahead token (hence
the "LA" in the name) but the SQL grammar is still to ambigous for even
this type of parser.

Finally, I rebuilt the parser again for the third and forth time using
an two different Earley parsers. The first was lark which was nice, but
too difficult to rewrite in V, so I had to scrap that. Finally settled
on a minimal Earley parser I found for python which lacks any
optimization (like precalculating tables) and lacked any error handling
other than "parser failed".

The Earley parser works for any ambiguous grammar because it generates
multiple solutions rather than trying to handle conflict resolution. For
our case, we actually don't care which solution we use since they would
all be syntactically valid.

Fortunately, this ended up making the parser way easier (less code) to
implement and I was able to built error handling. Yay!

v0.7.0

01 Aug 14:49
72a43a4
Compare
Choose a tag to compare
Added OFFSET and FETCH for SELECT (#25)

The `OFFSET` and `FETCH` clauses can be used to control the rows limits
that are returned.

Improved tests but adding an optional `/* setup */` for each test and
added an FAQ page.

v0.6.2

31 Jul 14:29
ab53338
Compare
Choose a tag to compare
Allow custom functions with register_function() (#23)

Custom functions make vsql a lot more flexible when working with V.

Also added an `examples` directory that doubles as a set of integration tests
since all examples are tested on CI.

v0.6.1

31 Jul 06:43
0d9081b
Compare
Choose a tag to compare
Adding support for "AS" aliases (#22)

The `AS` in `SELECT` statements allow custom column names to be used.
Also, fixed a bug with `*` not being handled correctly in SELECT
expressions.

v0.6.0

30 Jul 23:44
82971d3
Compare
Choose a tag to compare
Support functions in expressions (#21)

- Expressions now support functions, starting with some common SQL
standard functions `ABS`, `SIN`, `COS`, `TAN`, `ACOS`, `ASIN`, `ATAN`,
`SINH`, `COSH`, `TANH`, `MOD`, `LOG`, `LOG10`, `LN`, `EXP`, `POWER`,
`SQRT`, `FLOOR`, `CEIL` and `CEILING`.
- Better documentation around types and their specific limitations.
Including replacing cases of `FLOAT` with the more appropriate
`DOUBLE PRECISION` (since `FLOAT` is an alias).
- Added SQLSTATE 42883: no such function.

v0.5.2

29 Jul 15:40
5c9002c
Compare
Choose a tag to compare
Fix releases (#20)

The asset uploader does not play friendly with environment variables so
we'll have to use a fixed name for now.

v0.5.1

29 Jul 15:17
898951f
Compare
Choose a tag to compare
Produce binaries for releases (#19)

A zip file containing the standalone vsql-cli and vsql-server can be
downloaded from the Github Releases page to use vsql without needing a
V compilication environment.

At the moment only macOS and windows binaries are produced because
linux cross compilation is not working for me yet:
https://github.com/vlang/v/issues/10992

Fixes #17