/puny-sql-editor

A SQL Editor worthy of its name, it's puny.

Primary LanguageTypeScriptMIT LicenseMIT

Puny SQL Editor

A SQL Editor worthy of its name, it's puny.

Netlify Status

  NOTE: This project was made as a frontend interview task

Try it out

This repository has been deployed to Netlify and can be visited here.

Data for tables have been obtained from here and queries of following formats should work:

  • SELECT a,b,c from d ;
  • select a,b,c from d where e=f;
NOTE: Mind the space between semicolon in SELECT statements without WHERE clause

Setup

  • Clone the repository

      git clone https://github.com/sahil-shubham/puny-sql-editor.git
    
  • Install all the dependencies

      yarn
    
  • Make a copy of .env.template and fill your supabase tokens (mostly safe for public view, read here):

      cp .env.template .env
    
  • Run the development server

      yarn start
    

    Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. The linting is handled by husky before every commit.

Possible features

This uses supabase for storing tables.

  • This can be used to share specific tables of a database
  • The shared tables are updated in real time and don't go old as a normal csv
  • Some specific SQL Queries can be permitted to run to make filtering data on logic easier

Shortcomings

This project focuses mostly on the frontend side of an SQL Editor, ignoring and/or circumnavigating the need of a backend whenever needed. You are free to fork and improve this project to your liking.

  • This doesn't do any SQL parsing
  • This doesn't have any backend

Misc

Didn't feel any need for optimizing page load time, due to it being around 0.6s. The results were obtained from Lighthouse report visible here.