Skip to content

Instantly share code, notes, and snippets.

@thirumurthy
Created August 19, 2018 04:41
Show Gist options
  • Save thirumurthy/18afde43aac2f43c60d2b9cad68c65fd to your computer and use it in GitHub Desktop.
Save thirumurthy/18afde43aac2f43c60d2b9cad68c65fd to your computer and use it in GitHub Desktop.
Sails common API function
// you can refer https://sailsjs.com/documentation/reference/waterline-orm/datastores/send-native-query
// Build our SQL query template.
var SPNAME_CALL_SQL = `call sp_spname($1,$2)`;
// Send it to the database.
var rawResult = await sails.sendNativeQuery(SPNAME_CALL_SQL, [ 'dog', 'cat' ]);
return exits.success();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment