becls/swish

Sqlite?

Closed this issue · 3 comments

Why did you choose Sqlite? Are you planning to add support for traditional sql/nosql servers? Just wondering what's on the roadmap.

We chose SQLite because we wanted a small, no-install relational store for logging. There are no plans to add support for other databases. You can use Swish to communicate with them via sub-processes.

Thanks bob, my mistake, I was thinking of the SQLite integration as a traditional db driver, not for logging purposes. I've been interested in implementing some AWS lambda functions using chez scheme and you seem to be very involved. It seems quite doable as all that is required is to create a custom runtime as outlined here:
https://aws.amazon.com/blogs/apn/aws-lambda-custom-runtime-for-php-a-practical-example/
However it requires making http requests and therefore an http client. As far as I am aware swish does not provide this functionality and I haven't really been able to find an http client for chez scheme. I've considered building one using foreign code and sockets in c as illustrated in this chez scheme example: https://github.com/cisco/ChezScheme/blob/master/examples/socket.ss (here it uses unix sockets but I suppose I could convert it to internet sockets). However I didn't want to reinvent the wheel unless necessary, I'm not an experienced lisp or c programmer (I use Go and Javascript daily), however I imagine I could accomplish this if push came to shove.

Sorry if this isn't the appropriate forum for this question (it almost certainly is not, just wasn't sure how to contact you).

While Swish doesn't directly support a HTTP client API, it is pretty straightforward to get the basics right.

  1. You can connect-tcp to a host at a port.
  2. Use put-bytevector and flush-output-port to send a GET request.
  3. Call http:read-status to determine success.
  4. Call http:read-header to extract the header.

Sometimes that is enough. Other times, you may need code like http:get-content-params. There is still debate over exporting that function.