CSNW / sql-bricks

Transparent, Schemaless SQL Generation
http://csnw.github.io/sql-bricks
MIT License
204 stars 25 forks source link

Major Refactor to support dialect extension files #38

Closed prust closed 10 years ago

prust commented 10 years ago

The main piece here was splitting up each statement's _toString() into an ordered set of clauses, each with a separate clause_id and templating function. This will enable adding or overriding specific clauses in dialect extension files.

I also fixed some DRY violations by creating a few helper functions that help create the common API methods (a method that takes a list of columns, a method that takes a list of tables, etc), wrote a mini templating language to make it easier to define the different clauses and fixed a bug in the FOR UPDATE syntax.

prust commented 10 years ago

This is in support of #36. Merging.