PRQL / prql

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement
https://prql-lang.org
Apache License 2.0
9.94k stars 218 forks source link

Prql Web #271

Closed max-sixty closed 2 years ago

max-sixty commented 2 years ago

So far, we have a working version "in very black & white": https://github.com/max-sixty/prql/pull/270

It would be great if this could become a bit like the Editor at the bottom of the pest site — i.e. a nice-looking site that we can host and people can use to try PRQL. We can then deploy with GitHub pages.

In the future, we could also add things like syntax highlighting, and even some of the Database Cohesion features like autocomplete and type-inference, and allow running on a WASM-hosted SQLite, or a Cloud database with user creds, like Google BigQuery. (We could also do some of that from VSCode, like Malloy does. But that's more difficult, and it would be great to get something closer working initially.

I'll start by saying: this is not my area of expertise, and I've been unproductive over the past few days trying to get this working. So all help is appreciated, and please don't think that I have strong confidence in any views here.

I can see a couple of parts to this:

Rust <> JS&HTML

Currently we're using Sycamore, which seems to have a good conceptual framework, and a lot of community energy behind it.

I think the Sycamore approach is probably over-complicated relative to our needs — we don't need a fully dancing app relative to something that just updates the query output when we type. But if the complexity of our implementation is also limited, then that's fine. The examples are good, though the docs are a bit light.

Very open to other suggestions. The other library that looked compelling was Yew. The docs are better. It seemed to stop development at the end of 2020, but has recently picked back up.

Dioxus looked really cool, but its focus is multi-platform, so may come with baggage (but maybe not, I didn't look deeply).

I could also imagine using something more basic, if that actually made it simpler. Particularly if eventually using something like Monaco Editor required writing lots of plain JS anyway.

HTML & CSS

It would be nice to have a somewhat presentable page; it doesn't have to be the Sistine Chapel, but better than the text box in the linked PR.


Pest site:

image
max-sixty commented 2 years ago

Possibly we could use the full Monaco editor without that much work, because of https://github.com/siku2/rust-monaco ...

max-sixty commented 2 years ago

After https://github.com/max-sixty/prql/pull/308 and some basic™ HTML, this is viable!

max-sixty commented 2 years ago

This blog post has some good ideas for adding things like completions: https://flareapp.io/blog/36-building-a-better-search-with-monaco-and-amcharts

(though maybe we jump all the way to an LSP: https://github.com/max-sixty/prql/issues/330)

max-sixty commented 2 years ago

This is in a reasonable place, please open issues for more features (e.g. #276)