Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b81762

Browse files
committed
closes Vincit#1743
1 parent d3c3733 commit 7b81762

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

doc/api/query-builder/other-methods.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -711,44 +711,6 @@ Gets the Model subclass this builder is bound to.
711711
| -------------------- | ------------------------------------------- |
712712
| [Model](/api/model/) | The Model subclass this builder is bound to |
713713

714-
## toString()
715-
716-
```js
717-
const sql = queryBuilder.toString();
718-
```
719-
720-
Returns the SQL string suitable for logging input **but not for execution**, via Knex's `toString()`. This method should not be used to create queries for database execution because it makes no guarantees about escaping bindings properly.
721-
722-
Note: In the current release, if the query builder attempts to execute multiple queries or throw any exception whatsoever, **no error will throw** and instead the following string is returned:
723-
724-
```
725-
This query cannot be built synchronously. Consider using debug() method instead.
726-
```
727-
728-
Later versions of Objection may introduce a native way to retrieve an executable SQL statement, or handle this behavior differently.
729-
730-
##### Return value
731-
732-
| Type | Description |
733-
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
734-
| string | The SQL this query builder will build, or `This query cannot be built synchronously. Consider using debug() method instead.` if an exception is thrown |
735-
736-
## toSql()
737-
738-
```js
739-
const sql = queryBuilder.toSql();
740-
```
741-
742-
An alias for `toString()`.
743-
744-
Note: The behavior of Objection's `toSql()` is different from Knex's `toSql()` (see above). This method may be deprecated soon.
745-
746-
##### Return value
747-
748-
| Type | Description |
749-
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
750-
| string | The SQL this query builder will build, or `This query cannot be built synchronously. Consider using debug() method instead.` if an exception is thrown |
751-
752714
## skipUndefined()
753715

754716
```js

0 commit comments

Comments
 (0)