Skip to content

Commit f8c39ff

Browse files
committed
fix: output .noWait() as 'NOWAIT'
was previously output as 'NO WAIT'
1 parent 27bb077 commit f8c39ff

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ <h2 id="select">select</h2>
502502
<p id="forUpdate">
503503
<b class="header">forUpdate, noWait</b><code>sel.forUpdate([tbl, ...]) / sel.noWait()</code>
504504
<br />
505-
<p>Add the <tt>FOR UPDATE</tt> clause to lock all selected records from all tables in the select (or just the tables specified), along with an optional <tt>NO WAIT</tt> at the end:</p>
505+
<p>Add the <tt>FOR UPDATE</tt> clause to lock all selected records from all tables in the select (or just the tables specified), along with an optional <tt>NOWAIT</tt> at the end:</p>
506506
<pre>
507507
select('addr_id').from('person').forUpdate().of('addr_id').noWait();
508-
// SELECT addr_id FROM person FOR UPDATE OF addr_id NO WAIT
508+
// SELECT addr_id FROM person FOR UPDATE OF addr_id NOWAIT
509509
</pre>
510510
</p>
511511

sql-bricks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
Select.defineClause('forUpdate', function(opts) {
314314
if (this._forUpdate)
315315
return `FOR UPDATE${this._of ? ` OF ${handleColumns(this._of, opts)}` : ''}` +
316-
(this._noWait ? ' NO WAIT' : '');
316+
(this._noWait ? ' NOWAIT' : '');
317317
});
318318

319319

tests/doctests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ check(select().from('person').where({'last_name': 'Flintstone'}).union() .sele
166166
});
167167

168168
it("select('addr_id').from('person').forUpdate().of('addr_id').noWait();", function() {
169-
check(select('addr_id').from('person').forUpdate().of('addr_id').noWait(), "SELECT addr_id FROM person FOR UPDATE OF addr_id NO WAIT");
169+
check(select('addr_id').from('person').forUpdate().of('addr_id').noWait(), "SELECT addr_id FROM person FOR UPDATE OF addr_id NOWAIT");
170170
});
171171

172172
it("insert('person', {'first_name': 'Fred', 'last_name': 'Flintstone'});", function() {

tests/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ describe('SQL Bricks', function() {
374374
check(select().from('user').forUpdate().of('user'),
375375
'SELECT * FROM "user" FOR UPDATE OF "user"');
376376
});
377-
it('should support FOR UPDATE OF ... NO WAIT', function() {
377+
it('should support FOR UPDATE OF ... NOWAIT', function() {
378378
check(select().from('user').forUpdate().of('user').noWait(),
379-
'SELECT * FROM "user" FOR UPDATE OF "user" NO WAIT');
379+
'SELECT * FROM "user" FOR UPDATE OF "user" NOWAIT');
380380
});
381381
});
382382

0 commit comments

Comments
 (0)