Skip to content

Commit

Permalink
Added insert or replace via insertReplace()
Browse files Browse the repository at this point in the history
  • Loading branch information
rblalock committed Jul 11, 2013
1 parent 7d3c98e commit 371acb7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions joli.js
@@ -495,6 +495,8 @@ var joliCreator = function() {
return 'insert into ' + this.data.from + ' (' + this.data.set.join(', ') + ') values (' + this.data.values.join(', ') + ')';
case 'replace':
return 'replace into ' + this.data.from + ' (' + this.data.set.join(', ') + ') values (' + this.data.values.join(', ') + ')';
case 'insert_replace':
return 'insert or replace into ' + this.data.from + ' (' + this.data.set.join(', ') + ') values (' + this.data.values.join(', ') + ')';
case 'select':
var join = '';

@@ -674,6 +676,11 @@ var joliCreator = function() {
this.data.from = table;
return this;
},
insertReplace: function(table) {
this.data.operation = 'insert_replace';
this.data.from = table;
return this;
},
select: function(columns) {
this.data.operation = 'select';

0 comments on commit 371acb7

Please sign in to comment.