ajnsit/languages-that-compile-to-sql

A list of languages that compile to SQL

74

27 commits

updated Jun 28, 2022

See the code

README

Languages That Compile to SQL

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

Table of contents

Strongly Typed

NameDescriptionSource
ErmineLazy, 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

NameDescriptionSource
GraphQLSchema 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
LINQLINQ 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
Malloyis 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 SQLhttps://github.com/looker-open-source/malloy
PRQLpronounced "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

NameDescriptionSource
DatalogDeclarative 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?)
YedalogA logic programming language from Google that compiles to SQLNONE
LogicaSuccessor 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 SQLitehttps://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 availablehttps://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.

Contributors

ajnsit

27 commits

ajnsit/languages-that-compile-to-sql

A list of languages that compile to SQL

74

27 commits

updated Jun 28, 2022

See the code

README

Languages That Compile to SQL

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

Table of contents

Strongly Typed

NameDescriptionSource
ErmineLazy, 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

NameDescriptionSource
GraphQLSchema 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
LINQLINQ 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
Malloyis 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 SQLhttps://github.com/looker-open-source/malloy
PRQLpronounced "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

NameDescriptionSource
DatalogDeclarative 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?)
YedalogA logic programming language from Google that compiles to SQLNONE
LogicaSuccessor 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 SQLitehttps://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 availablehttps://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.

Contributors

ajnsit

27 commits