Search…
Clone and Reset

Clone

At times you may need to duplicate a query. Using clone you have a performant way to duplicate a query without using the duplicate method.
QueryBuilder
1
var q1 = query.from( "users" ).where( "firstName", "like", "Jo%" );
2
var q2 = q1.clone();
3
q2.getFrom(); // "users"
Copied!

Reset

When you need to remove all configuration for a query, you can call the reset method.
QueryBuilder
1
var q1 = query.from( "users" ).where( "firstName", "like", "Jo%" );
2
var q2 = q1.reset();
3
q2.getColumns(); // "*"
Copied!
Last modified 7mo ago
Copy link
Edit on GitHub
Contents
Clone
Reset