jsarafajr / knex-soql Goto Github PK
View Code? Open in Web Editor NEWSOQL Dialect for Knex.js query builder
License: MIT License
SOQL Dialect for Knex.js query builder
License: MIT License
βοΈ Important announcement: Greenkeeper will be saying goodbye π and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io
14.0.0
to 14.1.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
eslint-config-airbnb-base is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Cool project! Tried to use it to construct a raw soql query and received the following error:
let query = knex("Lead").select(["..."]).orderBy("CreatedDate", "desc").limit(10)
console.log(Object.keys(query.toString()));
Uncaught (in promise) TypeError: this._wrapString is not a function
at FormatterSOQL.wrap (formatter.js?c688:13)
at FormatterSOQL.columnize (formatter.js?c3fb:56)
at columns.forEach.col (compiler.js?9793:12)
at Array.forEach (<anonymous>)
at QueryCompilerSOQL.columns (compiler.js?9793:8)
at eval (compiler.js?9ba8:157)
at Array.map (<anonymous>)
at QueryCompilerSOQL.select (compiler.js?9ba8:156)
at QueryCompilerSOQL.toSQL (compiler.js?9ba8:110)
at BuilderSOQL.toSQL (builder.js?fbe0:115)
at BuilderSOQL.Target.toQuery (interface.js?a440:26)
at BuilderSOQL.toString (builder.js?fbe0:109)
at encodeURIComponent (<anonymous>)
at Rest.eval (rest.js?aafa:37)
at step (tslib.es6.js?4d3a:91)
at Object.eval [as next] (tslib.es6.js?4d3a:72)
Any thoughts? Thanks.
Hi guys,
Query Builder
You can use knex-soql to build SOQL queries without execution:
const client = require('knex-soql');
const knex = require('knex')({ client });
const subquery = knex('Account.Contacts')
.select(['Contact.Id', 'Contact.Name'])
.orderBy('LastModifiedDate', 'desc')
.limit(3);
const query = knex('Account')
.select(['Id', 'Name', subquery])
.where({ Id: '1337' });
console.log(query.toString());
/*
select Id, Name, (
select Contact.Id, Contact.Name
from Account.Contacts
order by LastModifiedDate desc
limit 3
)
from Account
where Id = '1337'
*/
Specs:
knex: 2.2.0
knex-soql: 0.6.2
Node version: 16.15.0
Hi @jsarafajr, do you plan to publish an update to npm with the latest changes?
Thanks!
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.