Open mathiasrw opened 9 years ago
@mathiasrw Do you know how to create object-functions in JavaScript?
Function are first class objects in JavaScript so it would be something like
var call = function(x){
console.log("Calling "+x);
};
call.rescue="911";
call('a friend'); // Calling a friend
call(call.rescue); // Calling 911
Ill make an example using "new" when I get home
But how to use prototypes with functions?
Hmmmm. Im on it...
The problem is located in this file: https://github.com/agershun/alasql/blob/master/src/20database.js
One of the options: we can define functions for each database.
Hmmmmmm. It's not quite.... Hmmmm.
I'll post a stackoverflow question tomorrow
Lets see what http://stackoverflow.com/questions/31290361/new-instance-of-function-with-object-property will give us...
hmmm. still working on this...
Im not finding any solution
In node I can do this
but I cant use same notation if I make a new database
I will have to use
exec
for it to work:would it be possible to avoid the exec for initiated databases so one can reuse code woriginally written for the main alasql database?