News for hackers. Stuff that matters.
Re:Show HN: No-Code SQL Builder by mritchie712 on Tuesday May 10, 2022 @11:51PM (#31335661)
Why did you decide not to connect to the database and pull the schema info automatically? If you don't want to connect, you could write a query against the information_schema to give to your users to run and paste the results back into craft.
Re:Show HN: No-Code SQL Builder by craftsquick on Tuesday May 10, 2022 @11:58PM (#31335689)
The primary reason was that this was built in one weekend! The information_schema query is a great idea actually, I'll build that in -- thank you!
Re:Show HN: No-Code SQL Builder by ano88888 on Wednesday May 11, 2022 @10:09PM (#31348417)
Wow , a lot got done in one weekend. Could you please share which framework/libraries/tools you use to build it ?
Re:Show HN: No-Code SQL Builder by craftsquick on Thursday May 12, 2022 @12:53AM (#31349430)
Thanks! Frontend: React/Redux and React Flow (for the graph) Backend: Node and Knex.js (for the query generation)
Re:Show HN: No-Code SQL Builder by dirslashls on Wednesday May 11, 2022 @12:54AM (#31335973)
Nice work and great use of React Flow.

What level of sophisticated queries can be created with it? For example, can it do "Top N and Other"? Which BTW, was recently added for SQL Frames ( https://sqlframes.com/docs/data_sets/top_n_other_sets )

Most of these visual SQL builders I have seen only tackle the basic level of SQL. I am interested in an advanced SQL builder myself to plug as a no-code SQL builder to front the SQL Frames API.

Re:Show HN: No-Code SQL Builder by craftsquick on Wednesday May 11, 2022 @01:07AM (#31336026)
You should be able to build every SQL query with this. I built an example Top-N query here: https://imgur.com/a/2xKLltl

Right now building Top-N (and my example) assumes you know the rank function exists, but over time it should be easy enough to pre-build "nodes" that do things like this automatically :)