michaelavila / knex-querylab Goto Github PK
View Code? Open in Web Editor NEWA place to easily experiment with the knex.js syntax and see the generated SQL.
Home Page: https://michaelavila.com/knex-querylab/
License: MIT License
A place to easily experiment with the knex.js syntax and see the generated SQL.
Home Page: https://michaelavila.com/knex-querylab/
License: MIT License
Bug
The site simply becomes an empty page when you run a code given in the "To Reproduce" section in this message.
To Reproduce
Steps to reproduce the behavior:
knex('hello-world').select('foo').where("name", false /* or you can pass 'false' as the second parameter*/)
Desktop:
The problem is not about browser, device or OS
it happens everywhere.
Smartphone
The problem is not about browser, device or OS
it happens everywhere.
Additional context
when the site turns blank, you can see an error in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'slice')
meaning something could be wrong in your redux code. But I find this very unlikely. I think you should put an error boundry.
I hope this helps.
knex('table').with('table', knex.raw('select something from somewhere'))
Should compile to something like
with "table" as (select something from somewhere) select * from table
Instead, it doesn't compile at all.
Is your feature request related to a problem? Please describe.
It would be nice if Transactions would be supported too.
Describe the solution you'd like
I would like the examples from knex to work
// Using trx as a query builder:
knex.transaction(function(trx) {
const books = [
{title: 'Canterbury Tales'},
{title: 'Moby Dick'},
{title: 'Hamlet'}
];
return trx
.insert({name: 'Old Books'}, 'id')
.into('catalogues')
.then(function(ids) {
books.forEach((book) => book.catalogue_id = ids[0]);
return trx('books').insert(books);
});
})
.then(function(inserts) {
console.log(inserts.length + ' new books saved.');
})
.catch(function(error) {
// If we get here, that means that neither the 'Old Books' catalogues insert,
// nor any of the books inserts will have taken place.
console.error(error);
});
Describe alternatives you've considered
Maybe have list of what and what is not supported bei the querylab
I have tried to copy and paste a knex query which is working correctly in my application to the provided validator. But it doesn't validate the query.
Line 34 in 87d5ff5
I think toQuery
might have some limitations, e.g. see this comment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.