kenodressel / mysql-to-rest Goto Github PK
View Code? Open in Web Editor NEWAn npm module to map a MySQL DB to a REST API.
Home Page: https://www.npmjs.com/package/mysql-to-rest
License: MIT License
An npm module to map a MySQL DB to a REST API.
Home Page: https://www.npmjs.com/package/mysql-to-rest
License: MIT License
Is there a way to use a connection pool instead of a single connection? It would be awesome.
Translate comments from German to English.
in 30 seconds after a request stops the server with error:
events.js:141
throw er; // Unhandled 'error' event
^
Error: Connection lost: The server closed the connection.
at Protocol.end (...\mysql-to-rest\node_modules\mysql\lib\protocol\Protocol.js:109:13)
at Socket. (...\mysql-to-rest\node_modules\mysql\lib\Connection.js:102:28)
at emitNone (events.js:72:20)
at Socket.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:893:12)
at doNTCallback2 (node.js:429:9)
at process._tickCallback (node.js:343:17)
can help me?
Suppose we have some table where Primary Key is in Auto Increment form. Then the current version of code will throw error while inserting.
I am proposing a fix at the time of calling the function sendSuccessAnswer in "insert" method.
var field = findPrim(columns, req.query[settings.paramPrefix + 'field']);
console.log(field);
console.log(insertJson[field]);
if(insertJson[field]==='undefined'){}
else { sendSuccessAnswer(req.params.table , res,insertJson[field], field);}
If primary key is provided in input then it will show the inserted row as result. And if primary key is not present it will just show the success message.
The operators "LIKE" and "IN" are not working properly.
The problem is that LIKE requires an apostrophe before and after the param and IN requires the parenthesis around the values.
This is awesome!!!
I have one question that I couldn't figure out.
If I want to have a where clause with a text string, what is the syntax?
For example:
http://localhost:8000/api/tasks?_limit=0,10&_fields=ACTIVITYDATE,TYPE,CITY,ISCLOSED&_order[ACTIVITYDATE}=DESC&CITY=New York
I get a bad column error.
Any suggestions would be appreciated.
What is the good way to have multiple db connections?
My client's mysql structure is that every of his clients have his own db so I need to connect to a certain db for the client that logged in.
I have a table with a single column, 'Description', which is the primary key. On performing a post request to this end point, the data is inserted, however request returns the following error:
{ [Error: ER_BAD_FIELD_ERROR: Unknown column 'id' in 'where clause']
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlState: '42S22',
index: 0 }
Is this caused by me not having an 'id' column?
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.