This repository has been archived by the owner on Feb 16, 2021. It is now read-only.
SQL AST #5
Labels
🧘 status/waiting
This may go somewhere but needs more information
💬 type/discussion
This is a request for comments
Subject of the feature
A new member to the unified family for parsing, constructing and transforming SQL queries / statements.
Problem
I'm constantly finding myself running into walls with sql builders / orms in the node space. The implementations tend to be very specific and as a result very limit. SQL is a rather mature standard, however the tools available really only implement specific use-cases for sql queries rather than a standard.
For example, most tools assume that I wont to
select
from a table, and as a result, that is my only option. But the standard allows for selecting from explicitvalues
, asub query
, the result of afunction
, etc.more over, functions can accept the result of other functions, or be variadic.
Additionally, different database engines provide slightly different syntaxes and features that can, generally speaking, be translated from one engine to the other.
Nothing in the ecosystem really does this, and it seems to me a standard, and tooling around a AST would go a long way to making working with sql less restrictive + painful
Expected behavior
Alternatives
There are numerous attempts, as SQL is necessary skill for most developers. However, they all fall a bit short when you need to do something beyond the simple use cases.
knex is one of the more popular, but its API is restrictive and very difficult to work with if your use cases aren't supported by it directly.
Sqorn is newer, and very nice - but still very restrictive in a number of aspects.
SQL dialect is very expressive and can do a lot of this, but working with it is very clunky and adding functionality is difficult, and very specific to the engine implementation.
The text was updated successfully, but these errors were encountered: