Skip to content

ajnsit/languages-that-compile-to-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 

Repository files navigation

Languages That Compile to SQL

A curated list of languages that compile to, or generate, SQL

Table of contents

Strongly Typed

Name Description Source
Ermine Lazy, Pure, with Strong Static Types. It's Haskell-like Functional Programming Language that adds support for Row Types. Compiles to SQL queries. https://github.com/ermine-language/

Alternate Query Syntax

Name Description Source
GraphQL Schema description, query, and manipulation langauge, well suited for web services. There's an implementation available that compiles GraphQL to Postgres SQL queries (Hasura GraphQL Engine). https://github.com/hasura/graphql-engine
LINQ LINQ is a declarative and typed query syntax that adds query capabilities to C#. Atleast one standalone LINQ to SQL translator written in C# is available as open source. https://github.com/ethanli83/EFSqlTranslator
Malloy is an experimental language for describing data relationships and transformations. It is both a semantic modeling language and a querying language that runs queries against a relational database. Malloy is currently available on BigQuery and Postgres. Malloy queries compile to SQL https://github.com/looker-open-source/malloy
PRQL pronounced "Prequel". PRQL stands for "Pipelined Relational Query Language", and is a simple, powerful, pipelined SQL replacement. Like SQL, it's readable, explicit and declarative. Unlike SQL, it forms a logical pipeline of transformations, and supports abstractions such as variables and functions. PRQL queries transpiles to SQL. https://github.com/prql/prql

Logic Programming

Name Description Source
Datalog Declarative and non-turing complete subset of prolog, which can be used to query relational databases. Query evaluation with Datalog is based on first order logic and is sound and complete. Datalog programs can be translated to recursive SQL queries (part of the SQL:1999 standard). https://github.com/ekoontz/psqlog (Any others?)
Yedalog A logic programming language from Google that compiles to SQL NONE
Logica Successor to Yedalog, and inspired by Datalog, it's an open source logic programming language from Google. It compiles to SQL which can run on Google BigQuery, and has experimental support for PostgreSQL and SQLite https://github.com/EvgSkv/logica
Constraint Handling Rules (CHR) A declarative, rule-based programming language. Although CHR is Turing complete, it is not commonly used as a programming language in its own right. Rather, it is used to extend a host language with constraints. Prolog is by far the most popular host language and CHR is included in several Prolog implementations, including SICStus and SWI-Prolog, although CHR implementations also exist for Haskell, Java, C, SQL, and JavaScript. There is a CHR2 to SQL converter available https://github.com/awto/chr2sql

Alternatives to SQL (that do not compile to SQL)

  1. EdgeDB is a new database and query language syntax. EdgeDB schemas contain objects which can link to other objects to form typed schema graphs which can be queried.

Relational Language extensions (that do not compile to SQL)

  1. Morel is a Standard ML interpreter which also adds relational extensions for powerful querying capabilities.
  2. Project:M36 implements a relational algebra engine as inspired by the writings of Chris Date. Unlike most database management systems (DBMS), Project:M36 is opinionated software which adheres strictly to the mathematics of the relational algebra. The purpose of this adherence is to prove that software which implements mathematically-sound design principles reaps benefits in the form of code clarity, consistency, performance, and future-proofing. Project:M36 can be used as an in-process or remote DBMS. Project:M36 is written entirely in the Haskell programming language.

Misc

  1. Advent of code 2021 solved with SQL queries. Code, Video explanations for each day.

About

A list of languages that compile to SQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published