from Hacker News

BlocklySQL: A new block-based editor for SQL

by leeuw01 on 12/23/20, 12:51 PM with 38 comments

  • by misterdata on 12/24/20, 8:09 AM

    We have been using something like this based on Blockly in production for over seven years now to build dashboards. GIF demo: https://www.dialogic.nl/wp-content/uploads/2018/02/demo1.gif

    Our users (researchers) had no problems learning the concepts of querying but didn't want to be bothered learning SQL syntax - hence we built this (also, our system does quite a bit of magic behind the scenes to allow mixing e.g. CSV data with data from a database, and also allows for things not easily done in SQL, e.g. pivot tables, so it's not just SQL).

  • by Cieplak on 12/24/20, 8:47 AM

    What is the Deutsch Limit?

    A term made up by Fred Lakin describing a comment Peter Deutsch made at a VL talk by Scott Kim and Warren Robinett about a visual machine language they had invented.

    Deutsch said something like:

    > "Well, this is all fine and well, but the problem with visual programming languages is that you can't have more than 50 visual primitives on the screen at the same time. How are you going to write an operating system?"

    This points out the obvious density advantage of text. This barrier has become known as the "Deutsch Limit," stated as:

    > The problem with visual programming is that you can't have more than 50 visual primitives on the screen at the same time.

    ...

    This is clearly a problem with visual representations. However, it is not immediately clear to me that a similar limit does not also exist in textual languages.

    When textually programming I frequently use an Emacs window with about 50 lines of text on my 19" monitor. Anyone older than about 35 complains that they cannot read the text because the font is too small. I use a lot of whitespace in my programs, so we might assume that the 50 lines in the editor contain 40 meaningful lines. Most common programming styles dictate limiting the number of "primitives" or statements to one or two per line, giving my textual screen at most 80 primitives.

    http://www.faqs.org/faqs/visual-lang/faq

  • by sfgweilr4f on 12/24/20, 3:44 AM

    I like the idea and the look of the whole thing but I couldn't figure out how to easily

    SELECT * from customers

    so... I'm kind of bummed out. The blocks seemed to not stick together. They'd just "island" and sit by themselves. I finally managed to push them together for a "SELECT FROM customers" combination of blocks. But there was a "clause" thing stuck on the screen.

    I felt like this should be a really quick thing to do.

    After all that I then got:

    Ungültige Abfrage: Unknown table 'web1312.customers'

    so the table I selected didn't even exist. Possibly.

    Sadness.

    (Maybe its a firefox thing? Can I blame firefox?)

  • by tangus on 12/24/20, 2:15 PM

    Well, I spent 5 minutes laboriously building a query for the whole thing to hang on me when I reached the ORDER BY clause.

    I actually don't see how this is better than a cheat sheet with SQL keywords and autocompletion of tables/fields.

  • by xaedes on 12/24/20, 2:46 AM

    Suggestion: Make the block palette sections collapsable, so one see more than just one category. The way it is, it is a lot of unnecessary clicking.
  • by leeuw01 on 12/23/20, 12:51 PM

  • by ben509 on 12/24/20, 7:19 AM

    Very cool. I think it might benefit from some kind of context. If you could select an open piece, it could restrict the available pieces to what's valid at that point.
  • by victor106 on 12/24/20, 2:44 AM

    This looks really cool.

    Anyone know of a tool that can parse a complex sql and generate a table diagram showing the various joins etc.,?

  • by 51Cards on 12/24/20, 3:44 AM

    I used to use a tool called FlySpeed SQL Query that had a great quick SQL builder using a UI. This reminds me of it a lot (though it wasn't block based). Great concept!
  • by renke1 on 12/24/20, 12:23 PM

    This might be useful to teach beginners in our company the basics of SQL. We already use a rather "playful" approach to teach Java to them.
  • by quantumwoke on 12/24/20, 9:09 AM

    Completely freezes up permanently after placing a single block for me on Chrome latest, Windows.
  • by hardwaresofton on 12/24/20, 6:39 AM

    I get a blank screen on top where I assume a diagram should be in FF 85.0b3 (64-bit)
  • by ris on 12/24/20, 6:28 PM

    Um, nope. Couldn't figure out how to use the JOINs and gave up.