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.

Does knex have support to temporary tables?

See original GitHub issue

When trying to list a temporary table (mysql), knex does not retrieve data. On the other hand, if I create the same table as not temporary, everything is ok.

Here is the query I am using to retrieve data:

                knex.from('users').withSchema('myDatabase').limit(10).offset(0)
                    .then((list) => {
                        console.log(list);
                    });

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
wubzzcommented, May 24, 2017

Generally a better idea when using temporary tables is to run within a transaction since it will only untilize a single connection.

3reactions
rnd111commented, Sep 3, 2020

Is there any example temporary table ? assuming I use a transaction?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Schema Builder | Knex.js
Creates a new table on the database based on another table. Copy only the structure : columns, keys and indexes (expected on SQL...
Read more >
How to set up one connection pool or one connection without ...
But my App doesn't see any temporary table at an existing connection pool. It means that every router request starts a new connection...
Read more >
[Solved]-use knex to dynamically create join table-postgresql
Coding example for the question use knex to dynamically create join table-postgresql.
Read more >
Stop using Knex.js. Using SQL query builder is an…
I chose to use knex.js as an example because it is the most popular SQL query builder in the Node.js ecosystem and we...
Read more >
Bookshelf.js | Home
You'll need to install a copy of Knex, and either mysql , pg , or sqlite3 from npm. ... The Bookshelf library is...
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