QUERY-supporting http server online

Hello everyone!

I just wanted to share a quick note about some work that I was doing
to add QUERY support to freenginx. I hope that here is a decent place
to post. I apologize if it is unhelpful.

I have been working on adding support for QUERY to freenginx. As it
stands, I have added support for the QUERY method. That alone, did not
provide anything really _useful_ so I wrote a module that would
_roughly_ emulate the examples in the current draft. The module is a
front end for a SQLite database.

The server is running on `query.obs.cr` and you can use curl to make
QUERY requests. There are three tables available now in the database:
ietf, contacts and contact (sic).

The schema for `ietf` is

```SQL
CREATE TABLE ietf (wg_name text, wg_descr text);
```

The schema for `contact` is

```SQL
CREATE TABLE contact ("name" text, "handle" text);
```

and the schema for `contacts` is
```SQL
CREATE TABLE contacts (surname text, givenname text, email text);
```

The tables contain only little bits of data and the data attempts to
match the examples in the draft:

ietf:
| wg_name | wg_descr|
| -- | -- |
| httpbis | HTTP working group |

contacts:
| surname | givenname | email |
| -- | -- | -- |
|Smith|John|john.smith@example.org|
|Jones|Sally|sally.jones@example.org|
|Dubois|Camille|camille.dubois@example.org|

contact:
| name | handle |
| -- | -- |
| will | hawkinsw |

(Sorry, I had to throw myself in there somehow!)

The server currently works by extracting the final part of the URI's
path and treating that as the name of the table to complete the SQL
query embedded in the body of the QUERY request (like several of the
draft's examples). So, if you wanted to see how it looks, you can use
curl

```bash
$  curl -X QUERY https://query.obs.cr/this/is/contact/ -d "select name, handle"
```
```bash
$  curl -X QUERY https://query.obs.cr/is/contact/ -d "select name, handle"
```
and
```bash
$  curl -X QUERY https://query.obs.cr/contact/ -d "select name, handle"
```

will all result in

```
will,hawkinsw,
```

If anyone is interested in knowing more about this lark, please let me
know! I would be more than happy to share. If you think that there are
things that would be good to add, please let me know that, too! I am
more than happy to add anything that would be helpful. My plan is to
put something like this description on https://query.obs.cr but that
might not be done before Monday. So, I wanted to post this here.

Thanks for all the work that you all are doing!

Sincerely,
Will

Received on Monday, 16 September 2024 05:53:31 UTC