Comments (4)
Im not familiar with aws lambda, but it seems that SQLBuilder got problems loading the operator- and helper-modules located in /sql.
Some Background: SQLBuilder dynamically walks recursive through the /sql directory and loads all js-files located there. Each file represents an operator or helper like "select.js" or "from.js", etc.
Could you spend some time to analyse this. Maybe this would be some similar error with lamda https://stackoverflow.com/questions/49020710/lambda-enoent-no-such-file-or-directory
Hope this would help
Some more question: Does it work locally?
from json-sql-builder2.
@planetarydev yes it worked locally in windows system. we are using webpack it is creating the single index.js file. but these files inside /sql are not getting added to the deployment package.
sql
src
src/index.js
i made my deployment package look like this then also it is not able to find the folder
image
from json-sql-builder2.
Below warning will be displayed when Bundling with webpack.
WARNING in ./node_modules/json-sql-builder2/lib/operator.js
103:19-38 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/operator.js
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts
WARNING in ./node_modules/json-sql-builder2/lib/builder.js
474:18-31 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts
WARNING in ./node_modules/json-sql-builder2/lib/builder.js
551:19-42 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts
WARNING in ./node_modules/json-sql-builder2/lib/builder.js
568:17-40 Critical dependency: the request of a dependency is an expression
@ ./node_modules/json-sql-builder2/lib/builder.js
@ ./node_modules/json-sql-builder2/index.js
@ ./src/index.ts
from json-sql-builder2.
I think that it would not work with webpack because the require of all node-modules for operators and helpers will work dynamically by walking through the directories.
/****
* Register all Modules located in the /sql directory.
*
* All Files located in a directory named "helpers" will
* registered as Helper. All files located in "operators" will
* resgistered as Operator. Directories which named "private" will be skipped.
*
*/
_loadModules(){
let modules = tools.walk(path.join(__dirname, `../sql/`));
_.forEach(modules, (module) => {
if (module.endsWith('.js') && module.indexOf('private') == -1 && !path.basename(module).startsWith('.')) {
this._register(module);
}
});
}
/**
* @summary Creates a new Operator or Helper
*
* @param file {String} Specifies the path and filename of the operator or helper to register
*/
_register(file) {
let sqlModule = require(file);
``
from json-sql-builder2.
Related Issues (20)
- $ine broken for $createView HOT 2
- $concat broken for SQLite
- Select all, with further columns? HOT 1
- SyntaxError: Unexpected token ...
- Division arithmetic helper does not exists HOT 6
- Using cast function in WHERE clause HOT 3
- Support for UNSIGNED values in $createTable? HOT 2
- isValidIdent method question HOT 2
- order by function(value)
- Window functions support
- how can we add 'and' 'or' and 'not' condition in where clause? HOT 2
- MySQL | possible to search JSON values HOT 1
- complex sql handling : case statements, string functions, analytic functions HOT 2
- not able to use trim(), upper(), lower(), etc HOT 1
- Feature request: add function LAST_INSERT_ID() HOT 1
- Compatibility with MongoDB HOT 2
- Can not order by DESC?? HOT 1
- Alter Table
- syntax error in readme.md
- Does it support nested condition in where ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-sql-builder2.