Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: master
Checking mergeability… Don’t worry, you can still create the pull request.
Commits on Nov 16, 2012
@maxbrunsfeld maxbrunsfeld Merge pull request #1 from nathansobo/master
Small adjustment to the client-side spec server
Commits on Dec 01, 2012
@maxbrunsfeld maxbrunsfeld Rearrange directories to make room for server component
- rename lib/monarch -> lib/client
- rename lib/monarch_test_support -> lib/client_test_support
- add dir lib/core, where all code currently lives
- add dir lib/server, currently empty
- make corresponding changes in spec dir
- move jasmine server code from /spec/runner into /script
@maxbrunsfeld maxbrunsfeld Move 'requires' from src files into manifest
This will make it easier to require core files in
two different ways in node and in the browser.
@maxbrunsfeld maxbrunsfeld Add initial files for server-side component
- load core files using snockets
- add cake task for running jasmine node
- add simple test for the top-level monarch function
@maxbrunsfeld maxbrunsfeld Move in-memory DB logic from core into client
- add visitor module for operating on Relation and Expression classes
- add 'qualifiedName' properties to all relation and expression
  classes, for the aid of visitors
@maxbrunsfeld maxbrunsfeld Move HTTP logic from core into client b4dca03
Commits on Dec 02, 2012
@maxbrunsfeld maxbrunsfeld Move events logic into separate, client-only module b75e642
@maxbrunsfeld maxbrunsfeld Add top-level client manifest files
this makes it easier to 'require' the client and
client_test_support modules using sprockets
@maxbrunsfeld maxbrunsfeld In server:spec cake task, re-run specs when files change d8e46f1
@maxbrunsfeld maxbrunsfeld Add utility for loading files that modify the Monarch module 1faa86d
Commits on Dec 13, 2012
@maxbrunsfeld maxbrunsfeld Start work on SQL compilation
- add SQL builder module and AST node classes
- add .toBeLikeQuery matcher
@maxbrunsfeld maxbrunsfeld Add Monarch.Db.Schema, for altering DB schema a9f83a6
@maxbrunsfeld maxbrunsfeld Build record objects from SQL results c5d1ab4
@maxbrunsfeld maxbrunsfeld Add cakefile option to run specific server specs f4aa9f0
@maxbrunsfeld maxbrunsfeld Build composite tuples for joins
- SQL queries now provide fully-qualified column aliases,
e.g. "blogs"."title" as blogs__title
- Tuple builder maps columns to the appropriate records
using these aliases
@maxbrunsfeld maxbrunsfeld Improve message from toBeLikeQuery matcher 8a9715d
@maxbrunsfeld maxbrunsfeld Build subqueries for joins involving selections 6f050e0
@maxbrunsfeld maxbrunsfeld Add matchers for records constructed from db queries 679dbe7
@maxbrunsfeld maxbrunsfeld DRY up tuple builder a little 0e341db
@maxbrunsfeld maxbrunsfeld Add record retrieval for limits cd27231
@maxbrunsfeld maxbrunsfeld Add sql compilation for limits inside of joins 9495064
@maxbrunsfeld maxbrunsfeld Rename some SQL AST classes e6b840a
@maxbrunsfeld maxbrunsfeld Make orderings work properly with subqueries 83327ff
@maxbrunsfeld maxbrunsfeld Change formatting of joins in sql builder spec dcd5dfb
@maxbrunsfeld maxbrunsfeld Create tables during setup, not before each test 1ee68e9
@maxbrunsfeld maxbrunsfeld Sort in memory when testing queries with non-deterministic order 747ba11
@maxbrunsfeld maxbrunsfeld Add multi-table joins 4631cad
@maxbrunsfeld maxbrunsfeld Fix SQL, add record retrieval for unions & differences da128db
@maxbrunsfeld maxbrunsfeld Improve toBeLikeQuery matcher 59b21de
@maxbrunsfeld maxbrunsfeld Refactor subquery construction in sql builder e305696
@maxbrunsfeld maxbrunsfeld Use accessor methods for nodes in Sql.Query 1997f43
@maxbrunsfeld maxbrunsfeld Add unions inside of joins 348f5fd
Commits on Dec 14, 2012
@maxbrunsfeld maxbrunsfeld Support unions and differences inside of joins
- Add And and Equals node classes
- remove BinaryOperator node
- replace with Binary module, which Union, Difference,
  Join, And and Equals now include.
- rename Query to Select
Commits on Dec 15, 2012
@maxbrunsfeld maxbrunsfeld Optimize visitor mechanism
In visitor file, add #acceptVisitor methods
to all expressions and relations. This requires
that visitor file be loaded after relation and
expression classes.
@maxbrunsfeld maxbrunsfeld Require server-side files in normal node style
- eliminate many modules from the monarch namespace,
  requiring them when needed instead.
- move some methods from Db to Db.Connection,
  to make dependencies uni-directional
@maxbrunsfeld maxbrunsfeld Clean up tuple builder a2e5c6e
Commits on Dec 16, 2012
@maxbrunsfeld maxbrunsfeld Make use of .delegate in a few more places ccc97e7
@maxbrunsfeld maxbrunsfeld Fix some whitespace inconsistencies cc027e7
@maxbrunsfeld maxbrunsfeld Add missing requires of underscore.js 11a7b31
Commits on Dec 21, 2012
@maxbrunsfeld maxbrunsfeld Improve error handling in Db.Connection ad8b872
@maxbrunsfeld maxbrunsfeld Change some spec names to reflect non-global modules a2a6264
Commits on Dec 22, 2012
@maxbrunsfeld maxbrunsfeld Remove RecordRetriever module c740511
@maxbrunsfeld maxbrunsfeld Add Relation methods #at, #find and #first 59d7b1a
@maxbrunsfeld maxbrunsfeld Rename SqlBuilder to SelectBuilder ba9c65c
Commits on Dec 24, 2012
@maxbrunsfeld maxbrunsfeld Start sql compilation for inserts b78ae41
@maxbrunsfeld maxbrunsfeld Fix missing underscore.js in relation spec 2b132da
@maxbrunsfeld maxbrunsfeld Reword two specs 5758b62
@maxbrunsfeld maxbrunsfeld Run jasmine-node with '--nohelpers' option
This seems to be needed for the new jasmine-node
Commits on Dec 27, 2012
@maxbrunsfeld maxbrunsfeld Make #visit method work for null and undefined 78474bc
@maxbrunsfeld maxbrunsfeld Extract superclass from Insert and Select builders 1ac799a
@maxbrunsfeld maxbrunsfeld Sort lines in nodes list 1103e14
@maxbrunsfeld maxbrunsfeld Handle null values in query builders 5f20ecd
@maxbrunsfeld maxbrunsfeld Add Monarch.Util.reopen, for reopening classes ee811e0
@maxbrunsfeld maxbrunsfeld Add Table#create a4da850
@maxbrunsfeld maxbrunsfeld Start work on update statements 31d7040
@maxbrunsfeld maxbrunsfeld Rename methods on relations and query builders a789de3
Commits on Dec 28, 2012
@maxbrunsfeld maxbrunsfeld Add Table#updateAll 8cf0b5b
@maxbrunsfeld maxbrunsfeld Add missing async spec completion in table spec e7a5ab7
@maxbrunsfeld maxbrunsfeld Add Selection#create 1267732
@maxbrunsfeld maxbrunsfeld Add Selection#updateAll 22646eb
@maxbrunsfeld maxbrunsfeld Rename Nodes.Select#source to #table d39001d
@maxbrunsfeld maxbrunsfeld Move some query builder methods into superclass 8ac8e95
@maxbrunsfeld maxbrunsfeld Add Table and Selection #deleteAll 36f149e
Commits on Dec 29, 2012
@maxbrunsfeld maxbrunsfeld Refactor server-side Table 77288e0
@maxbrunsfeld maxbrunsfeld Do some minor cleanups a7b840c
@maxbrunsfeld maxbrunsfeld Add todo list 0fd775b
@maxbrunsfeld maxbrunsfeld Make .reopen a class method on Monarch.Base 0925db5
Commits on Dec 30, 2012
@maxbrunsfeld maxbrunsfeld Add Record#save, #isPersisted, and #destroy 1a2053c
@maxbrunsfeld maxbrunsfeld Update todos caf1aeb
Commits on Dec 31, 2012
@maxbrunsfeld maxbrunsfeld Use Table#deleteAll, #create in some more specs 78b193c
Commits on Jan 02, 2013
@maxbrunsfeld maxbrunsfeld Remove 'Db' sub-namespace 10200fd
Commits on Jan 04, 2013
@maxbrunsfeld maxbrunsfeld Make ConnectionPool a proper class 952c9c9
@maxbrunsfeld maxbrunsfeld Put exports assignments on separate lines, for prettiness 49d5f3c
Commits on Jan 05, 2013
@maxbrunsfeld maxbrunsfeld Shorten the jasmine async timeout 3b56259
Commits on Jan 06, 2013
@maxbrunsfeld maxbrunsfeld Add ConnectionPool#begin, Transaction e33380c
Commits on Jan 07, 2013
@maxbrunsfeld maxbrunsfeld Add server-side Repository class
On the server, a Repository object holds the following things:
  - a database connection
    (this could be a connection pool or a transaction object)
  - references to tables
  - an identity map (not yet added)

Relations retrieve their repository from their underlying
record class. Right now there is just one Repository,
but later we'll allow them to be cloned. This will allow
for each request to have its own identity map, and for
keeping track of separate database connections during 
@maxbrunsfeld maxbrunsfeld Move singleton Repository to client 0cd2c3a
@maxbrunsfeld maxbrunsfeld Remove old spec cleanup code
This must have been around since Monarch used JS.Class
@maxbrunsfeld maxbrunsfeld Use `name` instead of `displayName` in Record#toString fc9891d
@maxbrunsfeld maxbrunsfeld Add Repository#clone 23a9840
Commits on Jan 10, 2013
@maxbrunsfeld maxbrunsfeld Fix cloning of tables and record classes in Repository c1575b3
@maxbrunsfeld maxbrunsfeld Make Transaction into its own module c3574c0
@maxbrunsfeld maxbrunsfeld Add Record.transaction, .commit, .rollBack f5e7f87
@maxbrunsfeld maxbrunsfeld Clean up insert builder 1281aec
@maxbrunsfeld maxbrunsfeld Don't include undefined values in Record#fieldValues
This way, undefined values will be left out of
INSERT and UPDATE statements, so that default
values (e.g. sequence values) can be used.
@maxbrunsfeld maxbrunsfeld Use sequences for primary keys in specs 28a0ad9
Commits on Jan 11, 2013
@maxbrunsfeld maxbrunsfeld In Table#create, get the ids of the inserted rows e8c582c
@maxbrunsfeld maxbrunsfeld In Record#save, set record's id 8666928
Commits on Jan 12, 2013
@maxbrunsfeld maxbrunsfeld Add Record#reload 0b2bd9f
Commits on Jan 18, 2013
@maxbrunsfeld maxbrunsfeld Update package.json, upload to NPM c2c5e3a
Commits on Jan 21, 2013
@maxbrunsfeld maxbrunsfeld Rename lib to src
This is a first step towards making Monarch compatible with
client-side setups other than sprockets-style script
concatenation (browserify, inclusion of a single script).
We'll need to provide already-compiled and concatenated
javascript files for `client` and `client_test_support`. I'd
like to put these scripts in the `lib` directory, and put
the original coffeescript files in `src`, the way other
coffeescript modules do.
Commits on Jan 22, 2013
@maxbrunsfeld maxbrunsfeld Make Monarch browserify-compatible
- If a CommonJs module system is detected, client-side code
will require its dependencies and set `module.exports.
Otherwise, it will set `window.Monarch` as usual.
- The `package.json` now includes entry points for node
and browserify.
- All entry point files now live in `lib`. This includes
the server-side entry point, the concatenated javascript
files generated by running `cake build`, as well as
sprockets-compatible manifest files, which have the suffix
Commits on Jan 25, 2013
@maxbrunsfeld maxbrunsfeld Don't 'require' underscore on client
People probably would rather load it as a separate script
Commits on Jan 26, 2013
@maxbrunsfeld maxbrunsfeld Ensure all client-side source files are in closures
This way we can concatenate them before compilation
so that coffeescript doesn't have to wrap every
single one in another closure.
@maxbrunsfeld maxbrunsfeld Remove extra closures in compiled coffee-script 1eb7c89
Commits on Jan 27, 2013
@maxbrunsfeld maxbrunsfeld Add sublime-style ctags files to gitignore d38949b
Commits on Feb 05, 2013
@maxbrunsfeld maxbrunsfeld Move JSON serialization logic into single module
This is to prepare for the addition of the reverse
process: parsing relations from JSON, in service of
a 'sandbox' API endpoint.
Commits on Feb 10, 2013
@maxbrunsfeld maxbrunsfeld Add Relation.fromJson 19e20dd
@maxbrunsfeld maxbrunsfeld Add session middleware
This is a connect middleware function that attaches
a monarch repository to every request.
@maxbrunsfeld maxbrunsfeld Work around bug in snockets concatenation order 5e9f8f4
@maxbrunsfeld maxbrunsfeld Don't duplicate prototypal properties when cloning tables afc98d2
@maxbrunsfeld maxbrunsfeld Make #isEqual use components' #isEqual methods 7ab2d57
@maxbrunsfeld maxbrunsfeld Add Table#isEqual 3173582
@maxbrunsfeld maxbrunsfeld Add combined session and sandbox middleware 2feeb63
Commits on Feb 11, 2013
@maxbrunsfeld maxbrunsfeld Make use of the fat arrow in a couple of places 974c58d
@maxbrunsfeld maxbrunsfeld Add Relation#inRepository
This method makes a clone of the receiving relation,
but using the given repository (which may have a different
DB connection, and later, a different identity map).
This will be used by the sandbox.
Commits on Feb 14, 2013
@maxbrunsfeld maxbrunsfeld Clean up specs
- Share definitions of test record classes
- Move matchers into their own file
- Move fixture data into its own file
@maxbrunsfeld maxbrunsfeld Move transaction method from Record to Relation fd887aa
@maxbrunsfeld maxbrunsfeld Generate correct SQL for nested selections eb8535c
@maxbrunsfeld maxbrunsfeld In CompositeTuple#toString, use
(not .displayName)
Commits on Feb 15, 2013
@maxbrunsfeld maxbrunsfeld Refactor sandbox and middleware bd7fb70
Commits on Feb 16, 2013
@maxbrunsfeld maxbrunsfeld Bump dependencies bc79444
@maxbrunsfeld maxbrunsfeld Fix flaky tests for db query error handling 46a92ea
@maxbrunsfeld maxbrunsfeld Replace Cakefile with separate script files
cake's options format is annoying; optimist is
easier to use.
@maxbrunsfeld maxbrunsfeld Add .travis.yml file d6b1dbe
@maxbrunsfeld maxbrunsfeld Specify node in travis.yml 1e596ae
@maxbrunsfeld maxbrunsfeld Exit 1 when server tests fail c9ff104
Commits on Feb 17, 2013
@maxbrunsfeld maxbrunsfeld Print out core file load order for debugging 30da6a6
@maxbrunsfeld maxbrunsfeld Ensure Deferrable gets loaded before Promise 9db8c86
@maxbrunsfeld maxbrunsfeld Add travis-ci badge to README 1f08257
@maxbrunsfeld maxbrunsfeld Remove debugging output efd5a3e
@maxbrunsfeld maxbrunsfeld Remove unnecessary dependencies e5d0c81
@maxbrunsfeld maxbrunsfeld Bump version 21a4b4e
@maxbrunsfeld maxbrunsfeld Update todos cd888e5
@maxbrunsfeld maxbrunsfeld Use normal index file for nodes directory ad24a39
@maxbrunsfeld maxbrunsfeld Use parameterized queries
Move SQL string generation out of individual AST
node classes into Generator class.
Commits on Feb 19, 2013
@maxbrunsfeld maxbrunsfeld Refactor visitor
Instead of an object, just make it just a function.
Also, add a helper method .setup, which adds the
#acceptVisitor method to a class.
@maxbrunsfeld maxbrunsfeld Optimize SQL AST nodes for visitor pattern 43c641a
@maxbrunsfeld maxbrunsfeld Rename column node classes
Column -> SelectColumn
InsertColumn -> Column
@maxbrunsfeld maxbrunsfeld Put sql nodes in a single file ac75b91
@maxbrunsfeld maxbrunsfeld Clean up column name resolution logic 1f2f1f1
@maxbrunsfeld maxbrunsfeld Remove unneeded accessors on AST nodes e0b379e
@maxbrunsfeld maxbrunsfeld Generate subquery name in builder, not AST node
I want to keep the AST nodes pretty dumb.
@maxbrunsfeld maxbrunsfeld Clean up code for setting up record classes in specs b4c5f1a
Commits on Feb 20, 2013
@maxbrunsfeld maxbrunsfeld Make belongsTo work on the server
It had to be adjusted because #find uses continuations
on the server.
@maxbrunsfeld maxbrunsfeld Move direction strings into sql generator 77a74bb
Commits on Feb 23, 2013
@maxbrunsfeld maxbrunsfeld In specs, add parentId column to comments table
This is for testing joining a table to itself
@maxbrunsfeld maxbrunsfeld Clean up sql builders a little 63b794c
@maxbrunsfeld maxbrunsfeld Add SQL generation for table aliases 6a77f58
Commits on Feb 26, 2013
@maxbrunsfeld maxbrunsfeld Refactor SQL generation code related to aliases cdc2cda
@maxbrunsfeld maxbrunsfeld Bump coffee-script 914c5a3
@maxbrunsfeld maxbrunsfeld Reword select query spec descriptions 6009c0a
@maxbrunsfeld maxbrunsfeld Allow joining a table and itself on server-side be5e49f
@maxbrunsfeld maxbrunsfeld Make joins work when the same table occurs 3 times 5172a31
Commits on Feb 27, 2013
@maxbrunsfeld maxbrunsfeld Revert "Remove debugging output"
This reverts commit efd5a3e.
@maxbrunsfeld maxbrunsfeld Tweak load order again f2e19fd
@maxbrunsfeld maxbrunsfeld Revert "Revert "Remove debugging output""
This reverts commit 52e209e.