dmfay / massive-js

A data mapper for Node.js and PostgreSQL.
2.49k stars 158 forks source link

Function script does not exist #620

Closed DriscollRichie closed 6 years ago

DriscollRichie commented 6 years ago

Summary

db.listFunctions() provides an array of my function, but massive says function does not exist.

Example

screen shot 2018-08-03 at 3 04 17 pm

Expected behavior

The function to exist.

Actual behavior

The function does not exist.

dmfay commented 6 years ago

It says db.get_bins is not a function; is there anything there or is it just undefined?

Also, you'll need to await that invocation but that's a separate issue.

vitaly-t commented 6 years ago

@DriscollRichie The error tells you, that what you defined as get_bins in file binsCtrl.js, is not a function. Looks like an error on your side.

DriscollRichie commented 6 years ago

@dmfay It showed it as an available function in the console when I console.logged db.listFunctions(), but it turns out that the await was the problem. Such a simple mistake. Don't code when you've been drinking! Sorry for the foolishness. Thank you!

vitaly-t commented 6 years ago

Don't code when you've been drinking

Seriously? That is the only way to do it! :smile:

dmfay commented 6 years ago

Obviously the solution is to drink more and get on that Ballmer peak :wink: