cl-2sql

Lisp to SQL compiler for Common Lisp
git clone https://logand.com/git/cl-2sql.git/
Log | Files | Refs | README | LICENSE

commit 713e9113770f7c35304e030c1111b93d3e4c8cb2
parent 3b9a79f8e0368d8bb9c2c43a8ac1cb0bf78c2918
Author: Tomas Hlavaty <tom@logand.com>
Date:   Wed,  7 Sep 2011 00:56:35 +0200

README updated

Diffstat:
MREADME | 159+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 151 insertions(+), 8 deletions(-)

diff --git a/README b/README @@ -1,3 +1,12 @@ +http://ondoc.logand.com/d/900/5/ +http://users.encs.concordia.ca/~haarslev/publications/jvlc92/node6.html +http://www.cliki.net/MOP%20design%20patterns +http://www.alu.org/mop/concepts.html +http://www.alu.org/mop/dictionary.html +http://www.lispworks.com/documentation/lw60/LW/html/lw-227.htm + + + - meta-syntax with keywords (small, fast, not extensible) - syntax with macros (M-. etc) @@ -41,11 +50,145 @@ http://www.bricklin.com/firstspreadsheetquestion.htm - But VisiCalc was not an accounting program at all, it just made it - possible for people to do accounting. Programs that were overly - tuned for such function (Javelin, Lotus Improv, etc.) completely - failed...What made VisiCalc novel was the ability to not only - interact but have it learn by example. Again, VisiCalc doesn't - summarize or do anything, it is just a tool to allow others to work - out their ideas and reduce the tedium of repeating the same - calculations. +> But VisiCalc was not an accounting program at all, it just made it +> possible for people to do accounting. Programs that were overly +> tuned for such function (Javelin, Lotus Improv, etc.) completely +> failed...What made VisiCalc novel was the ability to not only +> interact but have it learn by example. Again, VisiCalc doesn't +> summarize or do anything, it is just a tool to allow others to work +> out their ideas and reduce the tedium of repeating the same +> calculations. + + + + + + + + 2sql + + Tomas Hlavaty + <http://logand.com/contact.html> + + 2011-09-06 + + Updated: 2011-09-07 + +2sql is an extensible Lisp to SQL compiler and runtime with ORM layer +built on top of it. + + Table of Contents + ================= + + - Motivation and comparison with other projects + - Dependencies + - 2sql compiler + - Printer + - Compiler + - Macros + - Backends + - Portability + - Object Relational Mapping + - Custom persistent slot types + - Inheritance + - Schema evolution + - Portability + + Motivation and comparison with other projects + ============================================= + + Dependencies + ============ + + - split-sequence + - ironclad + - babel + - cl-postgres + - sqlite + - closer-mop + + 2sql compiler + ============= + + Printer + ------- + + Compiler + -------- + + Macros + ------ + + Backends + -------- + + Portability + ----------- + + Object Relational Mapping + ========================= + +Use 2SQL-ORM:DEFPCLASS to define persistent classes or use DEFCLASS +directly and inherit from 2SQL-ORM::PERSISTENT-OBJECT and specify +:METACLASS 2SQL-ORM::PERSISTENT-CLASS. If the persistent class +inherits from mixins, those must have the persistent class metaclass +too. + +To create a persistent instance, use MAKE-PINSTANCE. + +Instance cache must be manually cleared as necessary when using UPDATE +or DELETE-FROM SQL commands except when: + + - SETF on a persistent slot is used; + - DELETE-PINSTANCE is called. + + Custom persistent slot types + ---------------------------- + +Types must be specified for all persistent slots because the SQL types +are derived from the Lisp types. Use 2SQL-ORM:DEFPTYPE to define new +Lisp type with SQL type mapping. For example, + +CODE + (2sql-orm:defptype username () '(2sql-orm:text 32 3)) +END + +defines a new type username where (< 3 (length a) 32). + + Inheritance + ----------- + +Persistent class inheritance is supported. The concept lives only on +the lisp side and does not map to table inheritance even if supported +by the database backend. + + Schema evolution + ---------------- + +TODO Schema evolution not implemented yet + + Portability + ----------- + +2sql-orm is less portable then plain 2sql because of feature mismatch +between database backends and varied MOP compatibility between +different Lisps. + + | | sbcl | ccl | clisp | ecl | + |------------+------+-----+-------+-----| + | postgresql | Y | | | | + | sqlite | | | | | + | oracle | | | | | + | mysql | | | | | + +Currently works on sbcl only. + + - TODO fix ccl issue with proxy: ccl is strict with types. Slot + type should probably be something like (or proxy user) or so. + + - TODO clisp crashes + + - TODO ecl has issues with deftype? + + - TODO sqlite doesn't have sequences, needed for oid (mysql have + similar problem?)