tjanczuk / edge-sql Goto Github PK
View Code? Open in Web Editor NEWAccess MS SQL from Node.js using Edge.js
License: Other
Access MS SQL from Node.js using Edge.js
License: Other
If I change the stored procedure to not use parameters and just send exec sp_III_UpdateOperMgr
it executes properly.Otherwise if it requires parameters I get an error**"Could not find stored procedure 'sp_III_UpdateOperMgr @quoteNumber,@poNumber'."**
Below is the javascript.
var updateOpMgrSql = edge.func('sql',{
connectionString: GM_CONNECTION_STRING,
source:function () {
/*
exec sp_III_UpdateOperMgr @quoteNumber,@poNumber
*/
},
});
I think it is unacceptable to have date fields converted to string, they should be returned as objects. Is it possible?
I am executing a simple query on a remote SQL Server Database using this code:
var edge = require('edge');
var CONST_CONNECTION = "Data Source=10.6.65.233;Initial Catalog=MyDB;User Id=remote; Password=remote;";
var selectAll = edge.func('sql', {
connectionString: CONST_CONNECTION,
source: function () {
/*
SELECT * FROM dbo.UserName
*/
}
});
selectAll(null, function(err, result) {
if (err) { console.log("error "); return;}
console.log(result);
});
When I execute this query I get the following error :
Missing method System.Data.SqlClient.SqlCommand::ExecuteReaderAsync(CommandBehavior) in assembly /usr/local/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll, referenced in assembly /home/merca/login/oauth-server/node_modules/edge-sql/lib/edge-sql.dll
I have run npm test in the edge module and I get 69 tests complete (11 seconds), as far as I can see edge-sql does not have any tests.
I am running on Ubuntu 14.04 with Mono JIT compiler version 3.4.0
I would like to be able to set properties of the SqlCommand object, such as CommandTimeout (see https://msdn.microsoft.com/en-us/library/System.Data.SqlClient.SqlCommand(v=vs.110).aspx) I am willing to make the modifications and submit PR but would like some input on how best to pass them in. One thought is to use a special named parameter like _CommandProperties and do not load it in the AddParameters function but process it after the command is created in the ExecuteQuery function.... Thoughts?
I have a project which uses Edge-SQL quite successfully, but if I launch my edge-sql script in the background (bash: "node myapp.js &"), whenever the SQL code is executed on my windows machine, a new (presumably DOS) window pops up for just a moment.
It's a bit annoying that it flickers on my screen, but the more irritating issue is that it steals keystrokes. (If I'm typing rapid-fire at the moment the window pops up, all of the keys I hit while the window is open are not sent to my editor.)
This also happens if I run my process using PM2 (http://pm2.keymetrics.io/)
Has anyone else seen something like this? Any suggestions for how to at least make those windows open minimized and not capture focus?
Thanks!
When I read the source code, I noticed it has support for executing stored procedures which was added in Nov 2013. I tried it out and it seems to work fine in my test cases.
Before I go ahead and commit to using this functionality, I was wondering if there are additional reasons why this hasn't yet been advertised in edge's documentation.
Appreciate it.
Alex
Hello there,
When a column is declared as "smallint" in SQL SERVER, we get a "short" back in C#. And trying to cast in back to "int" fails since it got encapsulated as an "Object" in EdgeCompiler.cs.
Ex.:
short aNumber = 9;
object o = aNumber;
int number = (int)aNumber; // -> fails;
To adress it, we've to add
else if (type == typeof(short))
{
resultRecord[i] = (int)(short)resultRecord[i];
}
in compiler.cs.
Hope, it helps.
Hi.
Can I use EDGE-SQL with other DB than MS-SQL?
Thanks
Attempting to use the edge-sql component to query a stored procedure, async is a must so have spent time getting CoreCLR to work in our environment.
Can you suggest why this might be?
Unable to resolve project from /opt/app/node_modules/mssql-nix/node_modules/edge-sql/lib
The only thing I can think of is functionality is encapsulated in a npm dependency, do you think this would be a problem?
I am finding that a connection string fails when using a server name with a slash in it.
For instance Server=servername;Database=dbname;Integrated Security=True
works but Server=servername\secondpart;Database=dbname;Integrated Security=True
does not work. The response is error: 40 - Could not open a connection to SQL Server
.
The error response is more or less "The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections".
What is odd is that even if my server is servername\secondpart
, if I put just servername
in the connection string, it will connect to servername\secondpart
.
I'm happy to provide more explanation, but that is all I'm really seeing.
When attempting to select a field of Geometry type within a query, the execution fails returning an error of "Data is Null."
Detailed error:
{ Error: Data is Null. This method or property cannot be called on Null values.
at Error (native)
Message: 'Data is Null. This method or property cannot be called on Null values.',
Data: {},
InnerException: null,
TargetSite: {},
StackTrace: ' at System.Data.SqlTypes.SqlDouble.get_Value()',
HelpLink: null,
Source: 'System.Data',
HResult: -2146232015,
message: 'Data is Null. This method or property cannot be called on Null values.',
name: 'System.Data.SqlTypes.SqlNullValueException' }
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.