All Questions
151
questions
0
votes
1
answer
3k
views
PROTOCOL_SEQUENCE_TIMEOUT while doing dynamic MySQL Connection in sails-js
My Sails js Application has a Multi-tenant Database Structure. So as per Multitenant Logic, I had to create a dynamic database connection in the controller File. I am following this Method https://...
1
vote
3
answers
1k
views
Node.js auto migrations
I have been doing Django for several years and was spoiled by their automigrations that they have supported for a very long time. Recently I started using SailsJS (which I am very new to) and noticed ...
0
votes
1
answer
81
views
Best Practice to Safely Migrate Database in SailsJS App when using Mysql
I have an application developed with SailsJS and mysql. Only a logged in user is meant to be able to create a fresh user. During development stage, I made creation of the first user easy with a simple ...
0
votes
0
answers
394
views
Best Practice to storing server logs and front end log in mysql database
I have an api which stores all the logs of the server every seconds. This api stores all the logs which are recorded in the server every seconds.
To track record of the front end javascript. This api ...
0
votes
0
answers
376
views
create model with two column as primary key in sails.js
hi i have table in MySql as user_role and it have two columns Userid (int) and RoleId (int) and the combination of both is a primary key now how can i represent that in sails.js model User_role.js you ...
4
votes
1
answer
564
views
sails js Error: Handshake inactivity timeout
I am saving quite some data into the database and I kept on getting this error
Error: Handshake inactivity timeout
at Handshake.<anonymous> (/project/node_modules/mysql/lib/protocol/Protocol.js:...
0
votes
1
answer
152
views
Waterline - Where with sum of fields
I've got the following model Test
module.exports = {
attributes: {
a: {
type: 'number'
},
b: {
type: 'number'
}
}
}
I would like to ...
1
vote
0
answers
312
views
Insert large value in mysql db without changing max_allowed_packet Node js waterline orm
In order to insert value larger than the max_allowed_packet into mysql, according to mysql docs we can increase max_allowed_packet value from the mysql by using this command mysql --max_allowed_packet=...
1
vote
1
answer
363
views
Map.prototype.forEach not iterating over Map
I initialized a Map from the MySQL RowDataPacket array which I get through Sails Model. Then when console log that Map I could see the results but when I iterate over the Map using Map.prototype....
0
votes
1
answer
631
views
Sailsjs fetch data from two different mysql databases
I'm building a rest api using sails js v 1.x
I need to connect two mysql database so I have defined them in config/datastores.js file life this:
module.exports.datastores = {
default: {
...
1
vote
1
answer
35
views
Sails.js: how to do updatedDate for records?
I am trying to figure out how to get an updatedDate record to save into entries on my basic MySQL-enabled CRUD application. I have this in my models/user.js for the createdDate:
createdData: {
...
3
votes
0
answers
649
views
Sails.JS: AUTO INCREMENT Implementation Failed
I'm developing a Sails.JS app that performs CRUD operations with a MySQL database using waterline ORM. My models have an attribute id set to auto-increment with the beforeCreate function, yet every ...
0
votes
1
answer
96
views
Waterline causing 100% CPU Usage
Can anyone help me with my waterline configuration? I'm using waterline in my application and it's showing 100% CPU usage. This is due to database fetching in the background. Does anyone know how to ...
1
vote
1
answer
396
views
SailsJS 1.0 : Error in .create() for a model in Mongo with One Way Association to a model stored in MySQL
I have a Users model stored in MongoDb and a UserTypes model stored in MySQL.
When I try to create a new User:
Users.create({name: "Shivam", userType: 1})
I get following error:
{ AdapterError: ...
0
votes
1
answer
66
views
How LIKE operation performed with MySQL In sails?
I'm trying to fetch related data from a table in sails. But it shows me some errors.
Here is code.
let category = req.param('category');
let q = req.param('search_box');
console.log(...