Skip to content

richardwu/better-sql

Repository files navigation

BetterSQL™ - an attempt at a SQL optimizer

This is a (very) rough prototype for SQL optimization in OCaml.

Build

You will first need to install OCaml and OPAM.

On macOS with Homebrew

brew intall ocaml
brew install opam

Clone this project

git clone https://github.com/richardwu/better-sql.git

and run

make setup
make build

Interactive

To interactively test this, simply download utop, and load the necessary definitions from the source files. For example (in topological order of dependencies):

#use "table.ml";;

#use "columnsPerTable.ml";;

#use "columns.ml";;

#use "expr.ml";;

open Expr;;    (* elides the need to prefix with module name *)
let e1 = fromOp(SCAN(Table.fromName "a"));;
Columns.prettyprint (columns e1);;

Testing

make test

About

An attempt at a SQL optimizer in OCaml.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published