Relationale is a domain-specific language implementing relational algebra atop a general-purpose host language. Its features include a static type system, type inference, lexical scope, and delayed evaluation. By keeping its values in the same type system as the host language, it avoids any type system impedence mismatches. A proof-of-concept is being developed in Python.
The problems arising from the clash between the type systems of databases and the languages interacting with them are widely recognized. Further, the shortcomings of SQL as a language are commonly bemoaned. This has resulted in the relational model losing much of the mindshare of the current generation of software engineers. By giving the query language a facelift, and by integrating it better into the host programming language, Relationale is an attempt to make the relational model appealing again.
A brief (and currently just short of complete) overview of the language is available.
While the system isn't fully developed yet, here's an idea of how things would look from the perspective of Python:
# Create a new Relationale interpreter, restoring the given image file. rel = Relationale('mydb.img') # Register some variables in the interpreter and extend the already-defiend # ``employees`` relvar with them. rel.reg(name='Nick', emp_id=14, dept_id=3) rel.exec('employees += { (emp_name: name, emp_id: emp_id, dept_id: dept_id) }') # Execute a statement in Relationale, returning a ``Relation`` object. result = rel.exec('employees | [dept_id = 3]') print 'Employees with a dept_id of 3:' for i in result: print i.emp_name # ``i`` is a ``Tuple`` instance.
Relationale is licensed under the terms of the MIT license.