question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

queryBuilder.toString() not working correctly

See original GitHub issue

I’m not sure when this stopped working, but I’m using Objection v2.1.3 and when I call MyModel.query().toString() I get [object QueryBuilder] (same with .toSql()). Previously I would get a string of SQL. This is in an older part of my codebase that was written early last year sometime. Has the usage of toString/toSql changed since then? I’m looking at the documentation on the site and I don’t see where I could be going wrong here. Any help would be very much appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
koskimascommented, May 7, 2020

Oh damn! I’ll fix those asap. I had no idea those were outdated. Thanks for pointing this out.

2reactions
dizlexikcommented, May 5, 2020

Yeah, I found that after your comment yesterday, but I’m talking about these:
https://vincit.github.io/objection.js/api/query-builder/other-methods.html#tostring
https://vincit.github.io/objection.js/api/query-builder/other-methods.html#tosql

Those are what I was looking at originally and was very confused as to why it wasn’t working. It would be very helpful if there was a note there, and especially if that includes the migration link you just referenced.

Read more comments on GitHub >

github_iconTop Results From Across the Web

queryBuilder.toString() not working correctly #1743 - GitHub
I'm not sure when this stopped working, but I'm using Objection v2.1.3 and when I call MyModel.query().toString() I get [object ...
Read more >
c# - QueryBuilder is not encoding `@` in query parameters ...
ToQueryString() , the @ symbol is not encoded? Is there a way to get a properly encoded string or a reason it's not...
Read more >
Cannot evaluate com.couchbase.lite.Select.toString()
Hi, i'm trying to create a dynamic query using couchbase lite 2.0.2. What i'm doing is to add select, from and where dynamically, ......
Read more >
org.hibernate.envers.internal.tools.query.QueryBuilder.build ...
Best Java code snippets using org.hibernate.envers.internal.tools.query.QueryBuilder.build (Showing top 6 results out of 315) ; public void addWhere( String ...
Read more >
Migration from objection 2.x to 3.0 | Objection.js
To get a knex raw builder, you need to use knex.raw directly. # QueryBuilder.toString and QueryBuilder.toSql have been removed. You can use QueryBuilder....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found