Giter Club home page Giter Club logo

mysql-to-rest's Issues

Error: Connection lost: The server closed the connection.

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?

Problem in sendSuccessAnswer when inserting in a table where primary key is auto increment key.

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.

LIKE and IN not working properly

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.

Multiple DB Connections

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.

Error on single column POST request

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.