Blockly to generate SQL statements

2,390 views
Skip to first unread message

Bernard Bout

unread,
Jul 24, 2015, 11:35:06 PM7/24/15
to Blockly
Hi

I came across this youtube video where they generate SQL statements using Blockly like blocks.

https://www.youtube.com/watch?v=8D1rm6NARVo

Any ideas/ pointers/ links to any source code to be able to generate similar code?

Thanks

Neil Fraser

unread,
Jul 25, 2015, 1:19:27 AM7/25/15
to blo...@googlegroups.com
Interesting video.  The colour blending in the blocks is neat.  Hadn't seen that before, thanks for pointing it out.

You might try contacting the video's author:
https://plus.google.com/111232330768438769132/posts

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Carlos Pereira

unread,
Jul 25, 2015, 7:30:18 PM7/25/15
to Blockly, bernar...@gmail.com
The colour gradient to indicate type is indeed quite a nice feature. Let us know if you find more information :)

Kalpesh Rathod

unread,
Jun 6, 2016, 6:14:49 PM6/6/16
to Blockly
Any update on source code or example to download ? Where can we download this sample example of video ?

Michael Kolodziejczyk

unread,
Dec 15, 2016, 9:56:31 AM12/15/16
to Blockly, bernar...@gmail.com
Hi,

I uploaded a version of the colour-gradient as Blockly Plugin on Github. You can clone it from Github https://github.com/SPE-Systemhaus/blockly-colour-gradient or install it with bower by typing:
bower install --save blockly-colour-gradient

I'm sorry for waiting so long to get a response, but I was a little busy ... I wrote my master thesis and following this there were some other projects todo before I had time to update/rework the colour-gradient ;-) It works with the current Blockly version on Github.

Cheers,
Michael Kolodziejczyk

Michael Kolodziejczyk

unread,
Dec 15, 2016, 10:01:30 AM12/15/16
to Blockly
Hi,

there will be a Christmas present in the following days ... I will give a notification when I finished wrapping the present ;-)

Cheers,
Michael Kolodziejczyk

Michael Kolodziejczyk

unread,
Dec 23, 2016, 9:15:05 AM12/23/16
to Blockly
Hi,

I hold my promise and made the current version of the Blockly SQL Workspace available for all!

You can try it online @ https://sql.spe-systemhaus.de/
The sources are hosted on GitHub @ https://github.com/SPE-Systemhaus/blockly-sql-app

Feedback is appreciated ;-)

Merry christmas and happy new year ...


Cheers,
Michael Kolodziejczyk

Am Samstag, 25. Juli 2015 05:35:06 UTC+2 schrieb Bernard Bout:

Bernard Bout

unread,
Dec 23, 2016, 5:27:12 PM12/23/16
to Blockly
Absolutely cool. Thanks Michael. Will try it out and let you know.

Visited the demo page but did not find any way to RUN the sql generated. Is this code only to generate the statements or can you run the code from Blockly as well?

BErnard

Michael Kolodziejczyk

unread,
Dec 28, 2016, 11:04:41 AM12/28/16
to Blockly
At the moment you have to copy the SQL Statements and execute it on your DBMS or in a Script. The following database structure is loaded for the online example: https://launchpad.net/test-db/

I am using a MariaDB [https://mariadb.org/] and HeidiSQL [http://www.heidisql.com/] to test the generated statements. I planned adding a direct SQL execution from the workspace ... coming soon ;-)

Bojan Vukotić

unread,
Apr 21, 2017, 9:27:23 AM4/21/17
to Blockly
Good work!

I wanted to download code and try it by myself, but installation is too complex, why do we need php, couldn't it be avoid?
Original blockly is very easy to use - just download it, unzip it somewhere, open an index.html file from domes folder and that's it. It is not the case here

Martin Virtel

unread,
Apr 17, 2018, 7:45:52 PM4/17/18
to Blockly
I like the idea! I am thinking of using your work to develop a EPL (instead of SQL) generator. EPL is used for event processing (http://esper.espertech.com/release-5.2.0/esper-reference/html/epl_clauses.html) - it's close to SQL.

Hovever, after downloading and installing everything, the parser throws an error (see below). What am I missing?

(npm 3.10.10, node 6.14.1)

Thanks! M

$ grunt parser
Running "jison-processor:sql" (jison-processor) task
(... lots of parser output ...)
Warning: SQLStatement is not defined Use --force to continue.

Aborted due to warnings.

Michael Kolodziejczyk

unread,
Apr 18, 2018, 9:53:09 AM4/18/18
to Blockly
I just misunderstood how to handle with own variables in the jison-file and I circumvented the abortion by using '--force'. But you are right I had to try to get to the bottom of that warning :-D

So I fixed this and I pushed the changes into the repo, so grunt should run without warnings and without using '--force'...

thanks...

Michael Kolodziejczyk

unread,
Apr 18, 2018, 10:04:54 AM4/18/18
to Blockly
I am very sorry, I missed the notification about your message...

PHP is needed to connect to a database to grep the database structure and save it as json into the folder 'databases'.

At the moment you have to build the SQL Workspace by your own. I haven't tagged a release at the moment like blockly itself :-D For the future I plan to push a package, that can be used without building it... I hope it's well enough documented so that developer's can do that by his own ;-)
Reply all
Reply to author
Forward
0 new messages